Jump to content

View more

Image of the Day

The beast has a mighty searchlight of evil! #screenshotsaturday https://t.co/bzKepOojDL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

how to access depth values in pixel shader?

4: Adsense

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   

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 :)

#2 deftware   Prime Members   

1778
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.