Jump to content
  • Advertisement
Sign in to follow this  
GoodFun

Processing data from the render target in the same shader in DX10

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

Heya, is there a way to read data from a render target from the previous shader pass in DX10? I am creating an image of data in my first pass and plan to modify certain pixels based on their surounding pixels in a second pass, anyone got a good idea how to do that with as little as possible overhead? Thanks Marcel

Share this post


Link to post
Share on other sites
Advertisement
No it's not possible directly (..yet ?).

The only way to read some surface in a pixel shader is through a texture and you cannot attach a texture that is also bound as a render target (in some older APIs you could technically attach a texture that was written as a rendertarget but unless your method of rendering was compatible with the way the hardware worked you could probably end up with weird/funky artifacts and certainly not what you had expected).

What you can do is render to your rendertarget A in your first pass. Bind a second rendertarget B in your second pass and attach A as a texture. Then do whatever operation you need to do by overwriting B. (it's called ping-ponging usually because you have two targets that can be used alternatively).

That's the method with least overhead you can think of today and it's used extensively by games for postprocessing effects, etc.

LeGreg

Share this post


Link to post
Share on other sites
cool, thanks... that kinda was what I was expecting, just wanted to make sure I'm not missing something...

Thanks for your help
Marcel

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!