I noticed in light_quad.fp that the radial light intensity value, which should have been affecting only the alpha channel of the color, was in fact being multiplied with all components of the color. Because of this, when I tried to implement ambient lighting, this weird circular dark spot around the light would get created, since the ambient light was also being multiplied with the light's intensity.
After the fix, you can see that the radial falloff now works properly, the light becomes gradually less dense until it blends perfectly with the ambient light.
Before:
After:
I also took this opportunity to properly hookup the falloff property, it wasn't used before and it was hard-coded to 1.
Note that in the examples above I am not using this repo as an asset. Instead I have incorporated these ideas into my own rendering pipeline. In this sample there's probably no falloff issue, since you rely on Multiply blend modes to hide elements. But this issue does appear when you take the light as a render target, and multiply it with another render target on a quad.
Hey,
I noticed in
light_quad.fp
that the radial light intensity value, which should have been affecting only the alpha channel of the color, was in fact being multiplied with all components of the color. Because of this, when I tried to implement ambient lighting, this weird circular dark spot around the light would get created, since the ambient light was also being multiplied with the light's intensity.After the fix, you can see that the radial falloff now works properly, the light becomes gradually less dense until it blends perfectly with the ambient light.
Before:![image](https://user-images.githubusercontent.com/29335643/223854852-053fd9e5-f24c-407a-b765-2b389ce8494f.png)
After:![image](https://user-images.githubusercontent.com/29335643/223855038-069520d7-267f-473e-8419-9365766ed1a0.png)
I also took this opportunity to properly hookup the
falloff
property, it wasn't used before and it was hard-coded to1
.Note that in the examples above I am not using this repo as an asset. Instead I have incorporated these ideas into my own rendering pipeline. In this sample there's probably no falloff issue, since you rely on
Multiply
blend modes to hide elements. But this issue does appear when you take the light as a render target, and multiply it with another render target on a quad.