shadow color

Started by
4 comments, last by conman 18 years, 9 months ago
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 ?
Author Freeworld3Dhttp://www.freeworld3d.org
Advertisement
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
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.
Author Freeworld3Dhttp://www.freeworld3d.org
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?
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.
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.

This topic is closed to new replies.

Advertisement