Sign in to follow this  

shadow color

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

How do you determine what color a shadow should be based on diffuse and ambient lighting conditions? Because I know that the shadow color is not the darkest color in the scene. The back of a mountain could be darker than the actual shadow color. But since overall lighting is computed by diffuseColor + ambientColor, the darkest a color can be is ambientColor. But what about the shadow, is there a general way to decide this ?

Share this post


Link to post
Share on other sites
I don't fully understand the question.
The shadow has no color, but the geometry becomes colored if it is lit by a light source.
So rendering is often done in multiple passes. First you render with Ambient light, then you render the geometry that is not in the shadow with diffuse lighting.

So you are right, the color of the geometry in the shadow is the color it gets by ambient lighting, but what do you want to decide?

Constantin

Share this post


Link to post
Share on other sites
I'm sorry I was not specific. I'm writing a terrain shadow map generator. I need to know what color to make the shadows cast by the terrain.

Share this post


Link to post
Share on other sites
How do you generate your shadows? Stencil shadows or shadow maps?
This sounds stupid because you are making a shadow map generator :), but I mean what technique are you using for rendering the shadow?

Share this post


Link to post
Share on other sites
Shadows don't have a color. All they have is a lack of diffuse and specular light. In other words, a white object that is shadowed will have the color of the ambient light, and a black object that is shadowed will be black.

Share this post


Link to post
Share on other sites
I am pretty sure that you don't have to choose a 'shadow color' to get realistic results, because it would make no sense (as sniftel pointed out)...

I assume you generate a light map (1.0 if lit and 0.0 if in shadow).
If you do so you must add ambient light to pixels that are seen by the light source and you don't add anything if the pixel lays in the shadow.

Share this post


Link to post
Share on other sites

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