Sign in to follow this  

multi pass rendering problem

Recommended Posts

HI i wanted to implement a shadow mapping shader with lighting unfortunately because im using PS_2.0 I hadnt have enough instruction slots(my lighting almost takes it all). now i want to seperate lighting and shadowing in two passes. Is this possible??? if its possile what are PS and VS arguments for the second pass. how should i pass lighting color to the second pass to use it for shadowing??? Is there an alternative solution for my problem???

Share this post

Link to post
Share on other sites
yes, it's possible, you shouldn't also change too many things... (i suppose :D )
Here's how i did: i have a shader for per-pixel lighting (bump mapping, specular and other stuff) and another shader that applies the shadowmap on the scene.

In the technique i use the shadowmap functions as first pass, then process the lighting using alpha blending this way:
AlphaBlendEnable = True;
SrcBlend = DESTCOLOR ;
DestBlend = zero;

hope it helps :)

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