Hello.
I was making a wave flag demo.
For lighting I made an ARB fragment program shader. For Phong simple lighting. not Phong bump mapping. just one texture only.
But there is a problem. A waving flag is a field/spring of polygons. and the polygons are facing one direction.lets say that the vertex normals of a flag is (-1,0,0). Everything is ok with the lighting as soon as the light is at the left of the flag (the vertex normals is facing the light).
If the light now goes at the right of the flag that the flag lighting goes black because the normals is not facing the light! this is correct for the most cases. but for a flag is not correct.
what i should to to fix it?
here is my vertex and fragment program code:
http://rafb.net/paste/results/dWCTyj78.html
thanks in advance