Jump to content
  • Advertisement

Archived

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

MeeZ

Lighting Problem

This topic is 5538 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!