Page 1 of 1

material only visible when lit

PostPosted: Fri Jun 09, 2017 10:45 am
by DaLiberator
Hi,
I would like to create a material that reveals a second texture only when you are shining a flashlight on it. The light is held by player and moves around.

Re: material only visible when lit

PostPosted: Fri Jun 09, 2017 12:30 pm
by DaLiberator
I found the example but am still not sure how to feed the transform and rotation values to the shader. Second question is once I have the transform and rotation, how do I get it to reveal only where the light is hitting?

Re: material only visible when lit

PostPosted: Fri Jun 09, 2017 12:46 pm
by Ricardo Teixeira
DaLiberator wrote:I found the example but am still not sure how to feed the transform and rotation values to the shader. Second question is once I have the transform and rotation, how do I get it to reveal only where the light is hitting?


Hello,

I think that we might be able to provide a sample that simply reacts to a specific light value. I will get back to you as soon as possible.

Check the Smear sample included in the main package, it demonstrates a simple way to use external values to control specific actions in your shader.

Thanks!

Re: material only visible when lit

PostPosted: Fri Jun 09, 2017 2:15 pm
by Ricardo Teixeira
DaLiberator wrote:I found the example but am still not sure how to feed the transform and rotation values to the shader. Second question is once I have the transform and rotation, how do I get it to reveal only where the light is hitting?


Hello,

We made a sample that generates the effect that you want to achieve, please examine the attached package and let us know if you have any questions. Use the Color to be Filtered property to define which light color will drive the blending effect.

Thanks!