Jump to content
  • Advertisement
Sign in to follow this  
sepul

Shadow Mapping question ...

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

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 ?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites
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...?




Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!