Files
Cluster/insDavi2.0/Res/shader/prog_texture_with_mask.fp

14 lines
386 B
Plaintext
Raw Normal View History

2026-04-17 18:22:45 +08:00
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;
void main()
{
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.a *= alpha*(1.0-u_flt_inv_alpha);
}