OpenGL and infinite light position?
Is it possible to shade the polygons so every polygon would be rendered with the same light angle, no matter which their position is relative to the light?
I need to move my sun light, but the map is exteremely large, and i dont开发者_JAVA技巧 want the light looks any different in any other location, should be symmetric everywhere.
A Directional Light (versus Point or Spot) "casts rays" in parallel, effectively simulating a light source from an infinite distance.
To set this directional, you set the w component of the light's x,y,z,w position to 0.
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
精彩评论