Jump to content
  • Advertisement
Sign in to follow this  
post

Render Target Accumulate help

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!