Render Target Accumulate help

Started by
0 comments, last by S1CA 18 years, 6 months ago
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
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.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement