For my opengl video player app, I am using surface texture bound to GL_TEXTURE_EXTERNAL_OES
In my fragment shader, I want luminance value to be taken for 3x3 block.
vec2 tex00 = vec2(vTextureCoord.x-xmargin, vTextureCoord.y-ymargin)
vec4 p00 = texture2D(sTexture, tex00)
... etc for 3x3
and then calculate luminance of each texel : ie: p00 by doing dot of p00.rgb with vec3 of (0.3,0.59,0.11).
Instead is it possible to directly use p00.y ? Will it give luminance value?