Archived

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

Dark_Streak

global lighting

Recommended Posts

Dark_Streak    122
Hello, I have a simple question to do with global lighting. I have a large scene consisting of a building and a stretch of terrain. I want to apply a global light to the scene, so that the terrain and building can be seen in a certain amount of light. I am using the following commands to create the global light: GLfloat lmodel_ambient[] = { 1.2f, 1.2f, 1.2f, 0.8f }; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); However, I am not sure how this works. Will this light be related to every light (LIGHT0, LIGHT1 etc.) that I create and enable. For example, I dont see any light unless I at least enable LIGHT0, even though I have not specified that the global light is associated with LIGHT0. Say I enable LIGHT1 aswell as LIGHT0, will this mean that the global light will now be doubled in the scene, because I have two lights enabled? Thanks for your time

Share this post


Link to post
Share on other sites
CheeseGrater    122
Careful. This is a ''Global Ambient light.'' ''Global lighting'' can mean something very different (like Radiosity, for example)

The global ambient lighting should only be applied once. Of course, other lights that you define could have an ambient component specifically associated... that would combined additively to the global ambient lighting.

Share this post


Link to post
Share on other sites