Sign in to follow this  
Mercenarey

Shader: Multipass texturing and shadowmaps

Recommended Posts

After I have made multipass texturing (more precisely, it is for terrain "splatting"), I have no idea what the pixel color at a certain location is - I only know what it is at the last pass. This is due to the alpha-component, that lets earlier passes "shine through". Is there any way that I can know what the "total" color is at a certain location? I need to know this, so I can mix the shadow with the right (total) color. I thought of maybe rendering the entire scene to a texture first, to store the colors there, but that seems a bit cumbersome... Is this how it is normally done, or is there an easier solution? [Edited by - Mercenarey on December 4, 2005 9:48:07 PM]

Share this post


Link to post
Share on other sites
I just thought of one thing:
I could just put an alpha value on the shadowmap itself. Gonna experiment with that, hehe.

It would be nice, however, to hear of other possibilities.

Share this post


Link to post
Share on other sites
I actually just implemented something along these same lines for a shadow map shader. I create an 'illumination' buffer that shows how illuminated each pixel in the current scene is. This is used to combine all light input into a single buffer, including the effects of shadows.

Once all lights have been combined, then I use that buffer to modulate the normally shaded scene. I still have some work to do, but it seems to be working out fairly well.

So in your scenario, you would splat as normal, but each splat would be modulated by the illumination buffer.

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