I have my own model ( with its own model matrices…)Now the problem is …
I am using the function…
ApplyLightPosition(float *pArrPos)
{
…
DumpArrayLogf("ApplyLightPosition
", pArrPos ,4); // My own debug function
// position being set separately
glLightfv(glLightId , GL_POSITION, pArrPos);
…
}
I am using directional light , so pArrPos[3] = 0;
My test cases / approaches are as follow…
-
My display on some machines is flattened… If I change the pArrPos[3] = 1. I can see a lightened display , But I want to keep directional lightening.
-
Then I tried offscreen rendering , the display is flattened consistently… I checked my matrices, they are correct…
-
I tried some experimenting like making some change in pArrPos[0]( like I subtracted some random value from it , like 10 ). I could see the model rendered.
I imagine a situation such taht the light is being moved away to infinity by OpenGl…This may be wrong…
I am still a begineer at OpenGl… need help … thanks in advance…