Right now I’m trying to implement a forward renderer in my engine (the other being deferred).
Since I’ve pretty much always worked with shaders and lighting systems done by me I’m not very good at standard lights.
First of all I’m not sure how to set up the attenuation.
I put the constant attenuation to 0 and the linear one to 1/lightRange. This seems to be okay but if my object is very close to the light the backfacing triangles still seem to get iluminated and I see no difference between one face and another.
This has nothing to do with normals since if the light is further away or the range is smaller it shows up correctly (at least I think correctly).
Do you think my implementation of the attenuation is good?