As I starting OpenGL, I found an interesting question that is , in OpenGL, when setting GL_POSITION propertity of a glLight, use 0.0f as the last element means the light is a directional light, and the direction of the light is the propertity value, and use 1.0f means the light is a point light, with the position being the propertity value.
It’s strange. When I modify the last element of light position propertity from 1.0f down to 0.0f, from the shadow of the light , it seems the light is moving from the specified position to infinite far. Perhaps it’s the effect of projection. I conducted the ShadowMatrix by myself, but when I tried to conduct how the light effect is computed, I failed. I don’t know how to get an uniform formula independent of the light.
So, I need some help on how light is computed in OpenGL. If anyone want my conduction of ShadowMatrix, email me, I will send you the doc file. It is very amazing that the computation of shadow matrix is independent of the last element of the light position.