Jump to content

  • Log In with Google      Sign In   
  • Create Account

how to access depth values in pixel shader?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 fread   Members   -  Reputation: 240

Like
0Likes
Like

Posted 01 June 2014 - 01:09 PM

hello guys, I have drawn my scene to FBO and now I'm doing simple two pass blur (Horizontal And Vertical). Now I want to do the depth blur effect, but I do need a depth values in fragment shader. How can I access them? I am sending my screen texture (from FBO) to shader, is it possible with depth as well? I'll be thankfull for any tips :)

Sponsor:

#2 radioteeth   Prime Members   -  Reputation: 1136

Like
2Likes
Like

Posted 01 June 2014 - 04:06 PM

yes, just set up a texture using the depth attachment point in your framebuffer and it will have the depth rendered to it, then you can pass that texture into your fragment shader along with your existing texture.

 

Mind you that you are probably already using a renderbuffer with the depth attachment point, and that can be removed entirely and replaced with the depth texture you create instead, just pay attention to documentation about the format of your texture to make sure its compatible.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS