Lighting Problem
Hi There,
I am currently working on my first game, a tetris clone, and I am trying to implement lighting. I have Outlined Fonts for displaynig scores etc... And for when I enable lighting the faces of the text appear lit, and those faces not in line with the light source appear shaded. This is fine. This is the effect I want for the CUBES I have on my screen for the tetris pieces etc...
When I draw each face of a cube, I add glNormal3f(x, y, z) prior to drawing the vertices of the QUADS. But I do not get the lighting effect that I get with the text. Each face of the cubes appear to be as bright as the next, they are constantly bright, there is no shading at all. Why is this?
Can anyone out there help me out. This is really bugging me!
Hope you can help. Thanks for your time.
Cheers,
MeeZ
you probably have a misplaced call to either glEnable(GL_LIGHTING) or glDisable(GL_LIGHTING). make your calls as such:
gameLoop { glEnable(GL_LIGHTING); //render your cubes and whatnot glDisable(GL_LIGHTING); //render your text}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement