View Full Version : how to render a model independently from the light source

07-10-2007, 12:34 PM

I set up a tool that allows user to adjust the light amount from a light source. Any models' colors will turn darker or lighter if the light amount is changed. But for a particular model, I want it to be independent from the light source. No matter how dark the environment is, I always want the model to show its full, true colors as if it gains full light. What should I do when rendering this model? Your help is much appreciated.


07-10-2007, 01:53 PM
You might disable lighting (glDisable( GL_LIGHTING))when you draw that model or you can use texture environment (glTexEnv) which does not use vertex color (e.g. GL_REPLACE) when you draw that model.

07-10-2007, 02:21 PM
Or just change the intensity of the light source to full before drawing this particular model, and changing it back afterwards...

Depends on what effect you actually want (100% color intensity everywhere, or just 100% light intensity).

07-10-2007, 02:48 PM
You might also have the object contain the light-parameters that it "needs", allowing you to easily keep track of different light settings for different objects.

Another option is to have a list of lights and each object have a pointer into this list (makes it easier if several objects use identical lighting params).