Jump to content
  • Advertisement
Sign in to follow this  

Problem using multiple render targets for deferred shading

This topic is 3402 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´m doing deferred shading for the first time and I´m having a problem with using multiple render targets and cannot figure out the cause. I´m rendering the depth to a R32F texture which I set as render target 0. To render targets 1 and 2 I set other textures to which I render color, normals etc. Now, everything I render to render targets 1 and 2 works as it should. I can render each of those channels seperately to the screen to view them. But the depth texture is always gray, looks like value 0.5f; Even when I hardcode the value in the pixel shader to other values, like 0.0f or 1.0f, then it still comes out gray. After trying many things without any success, I tried using render target 3 for the depth instead of 0, also changed the pixel shader for that so that it writes to COLOR3, and now it works. But I still cannot figure out why, and I´m stuck with rendering dummy data to render target 0 because you cannot use render targets 1, 2, and 3 without using render target 0. I ran out of ideas and have no more clue as to where in my code I should look for the fault. Does anyone have any idea why render target 0 might behave differently than other render targets. Does render target 0 have different set of rules? Or are there render states that must be set per render target? Peter

Share this post


Link to post
Share on other sites
Advertisement
Maybe if you set color as RT0, normals as RT1 and depth as RT2?

Share this post


Link to post
Share on other sites
Well my scene always looks fully white. If you read the tutorial on ziggyware about deferred shading (http://www.ziggyware.com/readarticle.php?article_id=155) i think they mention the same.

maybe you can post some pictures somewhere so we can see what you mean?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!