0
Not a bug

Lerp Causing Scene Lighting Errors

Steve Zapata 10 years ago updated by Freya Holmér (Developer) 10 years ago 4
Creating a custom shader using one Directional light and one Point Light in scene. When Using a Lerp Function on output, Point Light shading on object is broken (hard edges). When not using Lerp function, Point Light Shading is fine. Image 261
Bad Lerp Lighting causes Square "cookie" effect from Point light
Image 262
w/o Lerp, lighting behaves normally. 

Answer

Answer
Not a bug
Alright, glad it worked out :)
Update: The problem presents itself when any of the lighting/shadowing components are combined through an Add, Multiply, or Lerp. This problem appears to be more about the way the lighting components are combined than anything else. Still, it's behavior feels like a bug. Custom lighting only appears to work appropriately when recreating the Blinn-phong shader model. This obviously defeats the point of custom lighting by forces us to fight against the Blinn-Phong model. 

edt: Clarity
Under review
It's a common mistake in custom lighting, so, here's a little explanation:

The custom lighting input is done per light source. Each additional light source is rendered additively on top of the first.
If you don't include light attenuation at all times, you'll see a sharp edge, because the light will be fully visible/colored, until it's culled away. In your case, you've got two colors, and none of them have attenuation applied.

This wouldn't be the case with deferred, but, deferred also has the downside of not being able to have unique lighting per-shader, which forward has. If you want a custom deferred lighting pass, you'll have to edit that shader on your own, if you want to treat all lights at the same time.

I presume you want to "color" shadows and the lights in a specific way, which is hard, given the nature of forward rendering.
Thank you for the help, that solved it! 
Answer
Not a bug
Alright, glad it worked out :)