Light color and material properties

Started by
1 comment, last by highvolt_herb 17 years, 7 months ago
Hi, maybe this is a completely dumb question, but I wonder, why for example in Direct3D, a light source has ambient, diffuse and specular as separate color values. I would expect a light source to have one single colour value and the ambient, diffuse and specular terms to be a property of the material. How could a red light cause green specular reflections on a surface? And having green reflections as well, this would be a yellow light. I come accoss this question, because I want to change my code to do lighting completely in shaders and bypassing fixed function pipeline completely and now starting to rethink everything again. Thanks for any ideas on that, Herb
Advertisement
This is one of the situations where the real-world analogy breaks down a little. Indeed, a true light source won't have different colours for the various lighting models, but considering that the whole system is simplified in the first place it allows us to achieve effects that would otherwise require a more complicated model.

Having radically different colours from a single light source is quite rare in realistic rendering. It is more commonly used for wild effects in alien scenes.

However, making only slight modifications can be quite effective. If you want a hazy atmosphere in a scene, you could set the specular colour to have the same hue and saturation as the diffuse, but make it darker. This will dim out specular highlights and soften the scene. Conversely, ramping up the brightness of the specular colour (particularly under a HDR model) can produce a harsh, clinical feel, without having to change any of the models.

Of course, there are many other uses.

Regards
Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
Admiral, thanks for your reply. I will consider what you said in my design.
Herb

This topic is closed to new replies.

Advertisement