Jump to content
  • Advertisement
Sign in to follow this  
Eduards Brown

DirectX11 Multi Pass Rendering, Render to texture question.

This topic is 1008 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,

 

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

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!