PDA

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



jyoung77
07-10-2007, 11:34 AM
Hi,

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.

Tony

Komat
07-10-2007, 12: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.

Overmind
07-10-2007, 01: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).

thinks
07-10-2007, 01: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).