Problem with multiple point light and lerp.

Node-based Shader Editor

Problem with multiple point light and lerp.

Postby Crocomodo » Sat Feb 16, 2019 9:36 am

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.
Crocomodo
 
Posts: 3
Joined: Sat Feb 16, 2019 9:20 am

Re: Problem with multiple point light and lerp.

Postby Amplify_Borba » Mon Feb 18, 2019 2:57 pm

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Problem with multiple point light and lerp.

Postby Crocomodo » Tue Feb 19, 2019 1:44 am

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:
Crocomodo
 
Posts: 3
Joined: Sat Feb 16, 2019 9:20 am

Re: Problem with multiple point light and lerp.

Postby Amplify_Borba » Tue Feb 19, 2019 2:25 pm

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.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Problem with multiple point light and lerp.

Postby Crocomodo » Wed Feb 20, 2019 2:04 pm

That...actually solved the problem. Thank you for your help!!Image
Crocomodo
 
Posts: 3
Joined: Sat Feb 16, 2019 9:20 am

Re: Problem with multiple point light and lerp.

Postby Amplify_Borba » Wed Feb 20, 2019 2:10 pm

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.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 3 guests