This might be easy but I am totally beginner in shaders.
In Three.js - Aframe : See my codepen: https://codepen.io/jimver04/pen/XWgEvEo
I want to replace the texture color of a plane only for the texture pixels that have green above a certain threshold (chroma key green with transparent pixels). Why I am getting black values ??? Bottom left box and upper right panel
void main () {
float thres = 0.9;
if (gl_FragColor.y > thres){
gl_FragColor = vec4(gl_FragColor.x,
gl_FragColor.y,
gl_FragColor.z,
0);
} else {
gl_FragColor = vec4(gl_FragColor.x,
gl_FragColor.y,
gl_FragColor.z,
1);
}
}

