Shadow Mapping question ...

Started by
7 comments, last by SiliconMunky 18 years, 7 months ago
I'm currently starting to learn shadow mapping, as far as I know, shadow mapping is totally image space method, so I have to render the whole scene depth buffer from light's point of view, and create shadows from that. but what if I'm mixing dynamic shadows with static lightmaps ? the walls and static objects have lightmaps, so I don't need dynamic shadows for them, and moving objects have dynamic shadows, does shadow mapping technique work on these cases ? can I generate shadows only for specific objects in the scene ?

dark-hammer engine - http://www.hmrengine.com

Advertisement
of course. only render the objects that are supposed to cast shadows to the light's depth-buffer
The dynamic shadow casters are the objects you render into the shadow map.

The dynamic shadow receivers are the objects that you texture with the shadow map.

It's perfectly possible to modulate a static shadow map (light map) with a dynamic depth buffer shadow map, and have characters cast shadows on floors etc. However, the static shadows, baked into the lightmap, won't be cast onto the characters in such a case.
enum Bool { True, False, FileNotFound };
fyi quake2, if I'm correctly informed, would read off the lightmap of the polygon the character was standing on or over (and for lava/lights would do something different), anyway, would read the lightmap texel value (rgb) and apply an ambient term to the character, as well as apply dynamic lighting.

<rant>
A thought: if one were to use vertex spherical harmonics for lighting one could conceivibly lerp the surrounding vertex's SH and apply that to the character for rather convincing lighting (although if one used vertex lighting all bets are off for detailed shadows.) Perhaps an SH + shadowmaps solution would be cool
</rant>

-Michael g.
Quote:Original post by Thr33d
fyi quake2, if I'm correctly informed, would read off the lightmap of the polygon the character was standing on or over (and for lava/lights would do something different), anyway, would read the lightmap texel value (rgb) and apply an ambient term to the character, as well as apply dynamic lighting.


I know Quake 3 did something similar; it defined a grid of ambient light values that filled all space; your character was lit by the near point(s) with vertex lighting.
thanks for the answers guys, I've just started to study this method, and I will post future problems in this thread

and about that quake3/2 idea, that was a great idea, but how can you get a texel of a polygon by (x,y,z) value ?

dark-hammer engine - http://www.hmrengine.com

Quote:Original post by hplus0603
...
It's perfectly possible to modulate a static shadow map (light map) with a dynamic depth buffer shadow map, and have characters cast shadows on floors etc. However, the static shadows, baked into the lightmap, won't be cast onto the characters in such a case.


Just a question:
Wouldn't it be possible to store the static shadow map and then simply add it to the dynamic shadow map when rendered, that way objects should be shadowed too, right...?




"Game Maker For Life, probably never professional thou." =)
Quote:Original post by sepul
thanks for the answers guys, I've just started to study this method, and I will post future problems in this thread

and about that quake3/2 idea, that was a great idea, but how can you get a texel of a polygon by (x,y,z) value ?

You have to calculate collision detection to walk around, so you know what polygon (hopefully triangle?) the player is standing on. Read back the UV coords for the verticies. Interpolate between the verts the same way the video card does. (right here it gets a little hazy. I remember bayencentric (sp?) coordinates being popular with triangle and intersections, etc. Don't know if you'll need that or, heck, it's just a linear calculation, you can probably just linearly interpolate between the 3 points. Guess trial and error /or/ reading the docs would help on this one.)


Quote:Original post by TerranFury
I know Quake 3 did something similar; it defined a grid of ambient light values that filled all space; your character was lit by the near point(s) with vertex lighting.


I recall reading something about that before, and for some reason was mixing it up with an ATI paper where they did just that, but with a regular grid (and later, and OCTREE partitioned "grid") of SH points representing the light. It sounded very computationally expensive though, so I couldn't imagine Q3 using SH interpolation.
I wouldn't doubt they use a grid of ambient light values though, and probably define a number (6 or 8?) of lights (in a "spherical" manner) "around" the player, these lights trilinearly interpolating between ambient light values. (That way it behaves as ambient light, the "distance" to light remaining constant, so it doesn't glow around the player as he nears the light points.)

Q3's source has been released IIRC so if you (or I) were *really* interested I suppose we could find out exactly what they did.

-Michael g.

(edit: hmm, it doesn't seem to like my blatent typo thanks SiliconMonkey)

[Edited by - Thr33d on September 14, 2005 12:05:07 PM]
Original post by Thr33d

Quote:Original post by TerranFury
I know Quake 3 did something similar; it defined a grid of ambient light values that filled all space; your character was lit by the near point(s) with vertex lighting.
[/qoute]


try /quote instead of /qoute. maybe it doesn't like the typo.

Edit: now my whole post is buggered, lol

This topic is closed to new replies.

Advertisement