Can fragment shader in OpenGL ES 2.0 change the Z value (depth) of a pixel?
How is this achieved in OpenGL ES 2.0?
No -- gl_FragDepth
(which is part of the desktop version of GLSL) is not present in OpenGL ES.
You can, however, check for the existence of GL_EXT_frag_depth
. If it's available, then you can write the depth to gl_FragDepthEXT
.
The extension paper gives more details about how to enable the extension and such.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With