How can i emulate legacy opengls texenv gl_replace mode using es 2? Basically, if the texture fragments alpha is 0, i want to use the primitives color. But otherwise not affect the fragments color. Im new to glsl and could use the help.
Im on android and ive already got textures working with transparency. And i want to use just one shader program. What ive got: gl_FragColor=texture2D(u_TextureUnit,v_TextureCoords); And id like to add a color to the primitive that only shows up where the texture is transparent