0
No es un bug
Lerp Causing Scene Lighting Errors
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.
Bad Lerp Lighting causes Square "cookie" effect from Point light
w/o Lerp, lighting behaves normally.
Bad Lerp Lighting causes Square "cookie" effect from Point light
w/o Lerp, lighting behaves normally.
Respuesta
0
Respuesta
No es un bug
Freya Holmér (Developer) hace 10 años
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
edt: Clarity
En revisión
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.
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.
Servicio de atención al cliente por UserEcho