how to access depth values in pixel shader?
Members - Reputation: 240
Posted 01 June 2014 - 01:09 PM
Prime Members - Reputation: 1213
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.