Sign in to follow this  

Light color and material properties

This topic is 4109 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
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

This topic is 4109 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this