what's the counterpart for gl_TexCoord in OpenGL ES 2.0
-
12-12-2019 - |
Question
I have a OpenGL shader which uses gl_TexCoord like the following does. But in OpenGL ES, gl_TexCoord is not supported. I wonder what can I do to refactor the code to get it work 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));
}
...
}
Solution
There isn't one. You do it manually with a user-defined varying
passed from your vertex shader. That's all it ever was anyway; a per-vertex output that your fragment shader took.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow