Sign in to follow this  

per object chadow maps.

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

Hello. Can some one explain me some details about per-object shadow map rendering? As I understand this technique is being used by Unreal2 engine as well as in the new HL2 engine (play CS:Source beta) where all actors cast shadows on the ground and other static geometry (no self shadowing). As far as I understand this simple technique - first I need to render each object to a buffer texture (models without textures - only black shapes), and then project these newly generated shadow textures on the geometry (terrain or whaterever shadow reciever I need..). Is this correct? If it is - then how is this projection rendering done on a large level geometry? For example if I have a big terrain?? I hope you understand my question?

Share this post


Link to post
Share on other sites
Yep, basically your logic is correct. You render your object to the shadow texture, then you project that texture from the lightsource back onto the level geometry (be it indoor, outdoor, terrain etc. - it doesn't matter). If you are using proper shadow maps, you do a depth comparison to fnd out what is/isn't in shadow. However, if you're just projecting a blakc texture back onto the scene you'll have to be more careful not to project it back onto the object that was the caster, or it will look silly.

Here is a link to an nVidia paper that should help you out.

Hope that helps, ask away if you have any more questions ;)

-Mezz

Share this post


Link to post
Share on other sites
thanks for answer.
But how do I render these (per object) projections?
My idea was:
0. Render everything without shadows.
1. define a projection frustum for each shadow.
2. For each shadow - find level geometry (and other objects) that fits in that frustum and render that chunk of geometry with shadow texture projected on it.

is it correct??

Share this post


Link to post
Share on other sites
just a small modification to your technique:
1-Render Every thing without shadows with ambient lighting only.
2-(For each light source)
{ define a projection frustum for each shadow;
For each shadow - find level geometry (and other objects) that fits in that frustum.
Render the pixels of each object that are not in shadow using diffuse and specular lighting and add it to the Scene rendered wiht ambient lighting in step 1(additive blending).
}

This can give you better lighting with varying shadow intensty and give a better looking lighting, as the shadowed pixels of each object will have only ambient lighting component instead of rendering a solid black texture over the shadowed pixels.
Also it will save you some pixels that you will not calculate specular and diffuse components for them.This can increase your fill rate.

Share this post


Link to post
Share on other sites
Yes, that's pretty much correct, as I said, remember that if you aren't using proper depth shadow maps, you will need to make sure you don't project the shadow back onto the caster when you draw them onto the scene!

-Mezz

Share this post


Link to post
Share on other sites

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