Jump to content
  • Advertisement
Sign in to follow this  
highvolt_herb

Light color and material properties

This topic is 4444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!