I’m currently working on some opengl 2D stuff. I have a spot light which reaches two faces with different width and height. somehow the light gradient on the faces depends on their size. how can I make the gradient be independant from the faces size?
Share
Without images its hard to say what your exact problem is but the most liekly issue is that the lighting is evaluated at the vertices and then interpolated across the triangles. Different sized tris will give different interpolations. This becomes more of a problem in the fall off at the edge of the range of a light.
If you want a more accurate lighting model then you will probably need to break out the fragment shaders and do per-pixel/fragment lighting instead.