Hi,
Well, that’s the problem…:
No matter how I configure the lights and all the other parameters, that I get half of the world without diffuse light.
Anyway, more exactly:
I have a world with only a floor ( just a plane made of some hundreds of triangles ) and a Skybox, both with modelated textures, normals and the materials (ambient, diffuse, specular) set to { 1.0f, 1.0f, 1.0f, 1.0f }.
I import them from a .obj and then I calculate the normals, so I now they exist, and they are normalized, but i have no idea about the facing of the polygons. However, I have set everything posible to GL_FRONT_AND_BACK, and I called
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
during init, so it may not be a problem.
And then it comes:
No matter if it’s a fixed or viewpoint light, with wide or narrow cutoff, the color…
If it is a directional light, nothing gets hit by its diffuse component.
And if it’s positional, only a half of the world gets illuminated by the diffuse light.
The strange thing is that it depends on the position of the camera, and that the floor and the skybox do the exactly the opposite, but allways along the X axis.
So, if I set a pure diffuse light, from where I am I see only the Z positive side of the Sky box and the Z negative part of the floor.
Any idea?
I do not post the code cause I think there’s not much more from what I told, but if you think it’s necessary, ask for it.