Sign in to follow this  
post

Render Target Accumulate help

Recommended Posts

post    122
Hi, Can anyone help me with the following issue: My vertex and pixel shader must be executed several times to obtain some results. The result is rendered into render target surface. Is there a possibility in dx 9 to set render target to accumulate results? What I mean is, I want to set the render target surface with some partial-results to the next passes and tell dx to accumulate it with next results (at the end I will have my final data in render target surface). Is it possible without using third texture where I would store partial results? Thanks

Share this post


Link to post
Share on other sites
S1CA    1418
If each pass is a separate operation with no dependency on the previous operation, and you can accumulate each pass with simple operations such as addition or multiplication, then then frame buffer blending should suffice(D3DRS_SRCBLEND, D3DRS_DESTBLEND, D3DRS_ALPHABLENDENABLE).

If your pixel shader has a dependency on a the results of a previous pass, then unfortunately a render texture cannot be used as a source in an operation where it is also the active render target. The best thing to do in this situation is have *two* accumulation render targets and double buffer between them so that one is used as the source to the pass, and the other is used as the destination, then flip them round after each pass.

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