Files
Cluster/clusterApp/Res/shader/prog_texture_complex.fp
2026-04-17 18:49:03 +08:00

21 lines
603 B
GLSL

precision mediump float;
uniform vec4 u_v4_clr;
//uniform sampler2D u_sam_tex;
uniform sampler2D u_sam_tex_mask;
uniform float u_flt_inv_alpha;
//varying vec2 v_v2_txc;
varying vec2 v_v2_txc_mask;
varying float v_flt_alpha;
void main()
{
if(v_v2_txc_mask.x < 0.0)discard;
if(v_v2_txc_mask.x > 1.0)discard;
if(v_v2_txc_mask.y < 0.0)discard;
if(v_v2_txc_mask.y > 1.0)discard;
float alpha = texture2D(u_sam_tex_mask, v_v2_txc_mask).a;
//gl_FragColor = texture2D(u_sam_tex, v_v2_txc);
gl_FragColor = u_v4_clr;//vec4(0.1, 0.3, 0.9, 1.0);
gl_FragColor.a *= alpha*v_flt_alpha*(1.0-u_flt_inv_alpha);
}