Archived

This topic is now archived and is closed to further replies.

MeeZ

Lighting Problem

Recommended Posts

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

Share this post


Link to post
Share on other sites
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
}

Share this post


Link to post
Share on other sites
Palidine,

Thanks for your suggestion. Unfortunately however that doesn''t solve my problem. Could it have something to do with position of light, light type etc.. I''m pretty new to lighting. But thatnks for trying anyway!

Cheers,

MeeZ

Share this post


Link to post
Share on other sites