I already have a good lighting shader that uses a diffuse map, normal map, specular map and glossyness map. The problem is that I don’t know how to do the falloff. I have seen a few samples but they all rely on the info provided by the GL lights which I can’t use. All I have is the light position and the radius of the light and I would like to make it falloff like a pointlight.
Another problem is that I don’t know how to make it falloff in such way that there the falloff is smooth all the way to the end without making it obvious that the light shading stops at the end of the radius (unless the user specifies a really high intensity value).
I still have problems with the shape of the pointlight, it isn’t perfectly rounded, it depends on the triangulation of the mesh, what can I do to fix that?
Originally posted by Baggio: I still have problems with the shape of the pointlight, it isn’t perfectly rounded, it depends on the triangulation of the mesh, what can I do to fix that?
do the attenuation calculation in the fragment program and not the vertex program
Originally posted by zed: [quote]Originally posted by Baggio: I still have problems with the shape of the pointlight, it isn’t perfectly rounded, it depends on the triangulation of the mesh, what can I do to fix that?
do the attenuation calculation in the fragment program and not the vertex program[/QUOTE]How can I do that?