What is the analogue of gl_TexCoord in OpenGL ES 2.0

I have an OpenGL shader that uses gl_TexCoord, as shown below. But in OpenGL ES, gl_TexCoord is not supported. I wonder what I can do to refactor the code so that it works on OpenGL ES.

void main() { //scene depth calculation float depth = linearize(texture2D(inputImageTexture2,gl_TexCoord[0].xy).x); if (depthblur) { depth = linearize(bdepth(gl_TexCoord[0].xy)); } ... } 
+6
source share
1 answer

Not. You do this manually with custom varying passed from your vertex shader. All this has ever been; output to the top that your fragment shader did.

+6
source

Source: https://habr.com/ru/post/921434/


All Articles