global lighting

Started by
1 comment, last by Dark_Streak 21 years, 10 months ago
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
Advertisement
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.
Thanks man.

This topic is closed to new replies.

Advertisement