DirectX11 Multi Pass Rendering, Render to texture question.

Started by
3 comments, last by Eduards Brown 8 years, 4 months ago

Hi,

I am working on a coursework for my University, and some of the effects in that require multi pass rendering.

I understand what it is and I've mostly implemented it.

But I don't understand how can I combine 2 textures into one properly.

I mean ShaderResourceView that I get from RenderTargetView is just a texture in the end, so I did blending on them, it works if I clear my background to white. But if I clear my background to anything else, it does not look right.

My question is, is there a better way to reuse the ShaderResourceView.

My ideal situation would be:

(Pass 1)Render the Transparent Cube to texture --> (Pass 2)Do some effect (Edge Detection for example) --> (Pass 3)Pass that ShaderResourceView from Pass 2 and then draw the textured cube --> (Pass 4) render to back buffer and call swap buffer

Any suggestions or ideas are welcome.

[attachment=29928:d3d11_1.png]

The Blending:

[attachment=29930:d3d11_3.png] + [attachment=29931:d3d11_4.png] = [attachment=29929:d3d11_2.png]

If it comes down to me having white background and blending the way I do now, that is fine, I guess I will just do the environment mapping at the very end.

Advertisement

Blending is quite flexible, but if none of the combinations achieves what you want, blend manually: Use those two source textures as input and combine them anyway you want with self-rolled pixel shader. Note that now you need a third texture/render-target for this since read-write to the same resource is not allowed.

Blending is quite flexible, but if none of the combinations achieves what you want, blend manually: Use those two source textures as input and combine them anyway you want with self-rolled pixel shader. Note that now you need a third texture/render-target for this since read-write to the same resource is not allowed.

So there is no other way to go about this?

About what exactly ? How do you want to blend ? Simple average of the two textures ? Additive ? Alpha-blended ?

I solved it thanks, it was mainly due to me doing multi pass rendering weirdly.

This topic is closed to new replies.

Advertisement