Hello people.
I am trying to implement Caustics…
I have a level and i want to render all of it with caustics (dont ask why all of it! )
I am doing something like this:
light_manager->DisableOGLLighting();
CRENDERER->ResetTextureUnits();
CRENDERER->ActiveTextureUnit(0);
CRENDERER->EnableTextureType(TEX2D);
glBindTexture(GL_TEXTURE_2D, caustic);
GLfloat sPlane[4] = { 1.0, 0.0, 0.0, 0.0 };
GLfloat tPlane[4] = { 0.0, 1.0, 0.0, 0.0 };
GLfloat rPlane[4] = { 0.0, 0.0, 1.0, 0.0 };
GLfloat qPlane[4] = { 0.0, 0.0, 0.0, 1.0 };
glTexGenfv(GL_S, GL_OBJECT_PLANE, sPlane);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tPlane);
glTexGenfv(GL_R, GL_OBJECT_PLANE, rPlane);
glTexGenfv(GL_Q, GL_OBJECT_PLANE, qPlane);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);
glEnable(GL_TEXTURE_GEN_Q);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
draw(SIMPLE_PASS);
The function draw(SIMPLE_PASS) draw the Level Polygons setting for all the vertices of the same triange the same planar normal. It does not set any texture coordinate or something other.
But the results are not correct. What i am doing wrong?
PS:I dont use any shader.
PS2: keep in mind that instead of this line glBindTexture(GL_TEXTURE_2D, caustic);
i will traverse through a number of textures
Thank you.