So I have a shader that I always use in my own engines that I can use a sample texture to apply transitions and I made a super simple version of it for construct to get used to constructs plugin system and for some reason I just can't get it to work.
The concept is super simple, pass a cutoff float to the shader and compare the r value of the pixel in a ramp/gradient image and if the cutoff value is lower than the r value of that coordinate, make the color black, if not, make it transparent. But for some reason it is always transparent. I don't know if I'm missing something or what. Any help or information would be greatly appreciated. Here is the code:
/////////////////////////////////////////////////////////
// Transition effect
varying mediump vec2 vTex;
uniform lowp sampler2D samplerFront;
uniform lowp float cutOff;
void main(void)
{
lowp float pixel = texture2D(samplerFront, vTex).r;
lowp vec4 outColor = vec4(0, 0, 0, 0);
if(pixel < cutOff) outColor = vec4(1, 1, 1, 1);
gl_FragColor = outColor;
}