Sign in to follow this  
glmisscelan

projective texturing for shadows

Recommended Posts

Im been looking this shadow method, it seems interesting but i have some questions. I have several models and a bsp map, each model has its own shadow texture. All the examples that i have seen use models without textures an only one shadow caster. First How can i render all the shadow textures at once, using multiple texture stages? Second, how can i render a shadowtexture on already textured object, two passes with some kind of blending? THanks in advanced.

Share this post


Link to post
Share on other sites
Quote:
Original post by glmisscelan
First How can i render all the shadow textures at once, using multiple texture stages?

Second, how can i render a shadowtexture on already textured object, two passes with some kind of blending?
Both issues are solved by simply uploading multiple texture matrices, one for each shadow cookie to be projected, and having your VS/PS happily mangle them. This means that if you're using TEXTURE_MATRIX you have to switch to another texcoord and upload another one (in a certain sense, we could say you have to use "TEXTURE_MATRIX0") and so go on for each stage.
Then the PS would just need to repeat the code with a few digits changed. If you're using FFP, it just takes to replicate texunit0' state to other ones... well, more or less.

Share this post


Link to post
Share on other sites

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