Page 1 of 1

Problem with multiple point light and lerp.

PostPosted: Sat Feb 16, 2019 9:36 am
by Crocomodo
Image

When using 2 point lights with lerp, it produces clipped artifact. Please help me clarify what's happening here and how to fix it. It bugged my mind for 2 days straight.

Re: Problem with multiple point light and lerp.

PostPosted: Mon Feb 18, 2019 2:57 pm
by Amplify_Borba
Hello, thank you for getting in touch and for your support!

The issue seems to be on the interpolator / Alpha value for the Lerp node, which is expected to be ranged between 0 and 1, so you'll need to add a Saturate node right before the Alpha input port.

Please let me know if this helps, thanks!

Re: Problem with multiple point light and lerp.

PostPosted: Tue Feb 19, 2019 1:44 am
by Crocomodo
Got the same result with saturate. I think it has to do with something about how unity internally render each point light into texture first but I don't have detailed information about that topic. It's weird enough with how you have to multiply world space light pos which outputs 1 in this case, to get the correct color from lerp(it should do nothing because Amultiply by 1 should equal A).
here is gif of shader behavior. Image
At first I think it's because i multiply last node with world space light pos, anything that is not in light range will be output black. so I tried plugging out light pos
Image and got this.Image
As you can see, the band is still there. the band is also also screen dependent too.
Image
I lose. :lol: :lol: :lol:

Re: Problem with multiple point light and lerp.

PostPosted: Tue Feb 19, 2019 2:25 pm
by Amplify_Borba
You might have to further adjust your nodes depending on the effect you're going for, after some testing it seems that adding the Light Attenuation data to the final multiplication rather than within the interpolation setup fixes this behaviour.

Re: Problem with multiple point light and lerp.

PostPosted: Wed Feb 20, 2019 2:04 pm
by Crocomodo
That...actually solved the problem. Thank you for your help!!Image

Re: Problem with multiple point light and lerp.

PostPosted: Wed Feb 20, 2019 2:10 pm
by Amplify_Borba
No problem, glad I was able to help!

Please let us know if you have any further questions, and if you have the chance we would also appreciate that you consider reviewing ASE in the Asset Store and sharing your experience with the Unity community, as feedback is extremely valuable to us.