View Full Version : Shadow Maps
nigebabe
05-28-2008, 03:34 AM
I am currently messing about with Area lights and radiosity and am getting some great renders but of course, they are taking time! I therefore read up about using a shadow map via the spotlight as an alternative and it too is giving some nice results. However, what I cannot seem to do is lighten the shadow map. I have played with shadow map size, fuzziness, shadow colour (made it as light as possible) and shadow map angle and always the colour of the shadow is a dark black. I have seen pictures in Lightwave books where the shadow map is a definite light grey and mimics an area light radiosity render nicely.
How can I lighten the shadow map?
Nige
Ztreem
05-28-2008, 03:48 AM
Set shadow color to a light grey and the shadow will be lighter. Be sure you're altering the right light if you have several lights.
nigebabe
05-28-2008, 04:18 AM
Ztreem,
Yes, I had already tried this and it seemed to make no difference at all. I'll try again.....
Non-radiosity lights (such as spotlights) can only add non-bouncing light to a scene - if there's a shadow being cast by that light and no other lights, the shadows will always be black (or whatever ambient colour you have set).
To make the shadows lighter, try adding other fill lights in there to lighten the dark areas - maybe add a distant light with no shadows (turn it down low though - 5-10%)
nigebabe
06-02-2008, 12:28 PM
Thanks Dsol. However, even though I change the shadow ambient colour to a light grey, this change does not seem to take and it remains black in the render.
WShawn
06-02-2008, 12:37 PM
Hi:
I think what dsol is saying is that if you're only using one light with a shadow map, the shadow will be 100% opaque (ie: black) no matter how you set the color of the map. So what you have to do is decrease the intensity of the light casting the shadow to, say 20% and add another light that is not casting a shadow to make up for the lack of illumination. Your shadow will thus appear lighter because another light is filling it.
Shawn Marshall
Marshall Arts Motion Graphics.
Giacomo99
06-02-2008, 12:58 PM
Or, to clarify what WShawn said: clone the shadow-mapped light (so the clone is in the same place as the original) and turn shadows off for the clone. Then adjust the intensity of both lights so they add up to the intensity of the original. The relative darkness of the shadow will be controlled by the proportion of intensities of shadow-casting to non-shadow-casting lights.
Yep, that's exactly what I meant - though you described it much better than I did :) You could also fill it out by upping the ambient light (not to be confused with ambient occlusion or anything else with "ambient" in the title), though the second (or multiple) light approach will give you much more naturalistic looking results. Ambient light in a scene is a very old-school fudge from the days of yore when having more than one light in a scene meant prohibitive rendering times. I tend to use large rigs of shadow mapped spots to light my scenes and have ambient intensity set to zero. If there's any pitch dark areas, then just chuck in another spot - or a point with falloff.
Ztreem
06-02-2008, 01:56 PM
Non-radiosity lights (such as spotlights) can only add non-bouncing light to a scene - if there's a shadow being cast by that light and no other lights, the shadows will always be black (or whatever ambient colour you have set).
No, not true. Not for me any way. If you change the shadow color to a light grey the shadow will be lighter as well, it's like a shadow opacity setting.
WShawn
06-02-2008, 03:46 PM
No, not true. Not for me any way. If you change the shadow color to a light grey the shadow will be lighter as well, it's like a shadow opacity setting.
You're right. I always thought that shadow map shadows were 100% opaque unless you had another (non-shadow casting) light filling them in, so that if you had the shadow set to grey it would project a grey shadow onto a blue or yellow object or whatever. But I just played around with it, using a spotlight with a shadow map to cast a shadow from a ball onto a flat blue surface, and the shadow keeps its blue tint when set to 50% grey or even nearly white.
That doesn't help the first poster, but this feature is new to me. Has it always been that way?
Shawn Marshall
Marshall Arts Motion Graphics
Ztreem
06-02-2008, 04:06 PM
That doesn't help the first poster, but this feature is new to me. Has it always been that way?
Why doesn't it help him, wasn't that was he/she was asking for? to lighten up the shadowmap?
It's always been that way, as long as I can remember.
Here's some pic to show the effect
WShawn
06-02-2008, 04:12 PM
Why doesn't it help him, wasn't that was he/she was asking for? to lighten up the shadowmap?
In nigebabe's first and subsequent posts he said that changing the color of the shadow map wasn't lightening the opacity of the shadow for him, so something else might be going on.
Shawn Marshall
Marshall Arts Motion Graphics
Ztreem
06-02-2008, 04:18 PM
Then maybe it's a bug, user error or it's not the shadowmap that is the problem. I'm just saying that this is the way to lighten a shadow and it works.
Danner
10-13-2011, 08:26 AM
Shadow maps have another peculiarity, they don't work well with transparent objects. They shadow will be solid.
Shadow maps have another peculiarity, they don't work well with transparent objects. They shadow will be solid.
Yep, shadow maps are calculated from geometry only. They work with clip maps, but don't support greyscale values. Think of them as a projected binary stencil, mapping out where the shadow is (like a z-buffer for shadows, viewed from the viewpoint of the light). They're fast to calculate, which is why most games engines use them for shadow effects.
Then maybe it's a bug, user error or it's not the shadowmap that is the problem. I'm just saying that this is the way to lighten a shadow and it works.
I didn't know this either - and it's good to know!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.