pixijs shader 设置透明度的方法

pixijs shader 设置透明度的方法

precision mediump float;

varying vec2 vTextureCoord;
varying vec4 vColor;

uniform sampler2D uSampler;
uniform sampler2D noise;
uniform float customUniform;

void main(void)
{
    vec2 r = vTextureCoord;
    
    vec4 tex = texture2D(uSampler,r);
    vec4 tex1 = texture2D(noise,r);
    float opcity=1.0;
    if(tex1.r==1.0 && tex1.g==1.0 && tex1.b==1.0){
       tex *= 0.0;
    }
    // vec4 fg = texture2D(uSampler, vTextureCoord);
  // fg.a = .0; // Why are elements still displayed
    gl_FragColor = tex;
    // gl_FragColor = vec4(1.0,0.3,0.3,0.0);
}


如果遇到什么不懂的地方直接关注公众号留言(本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。)
作者:newmiracle
出处:https://www.cnblogs.com/newmiracle/

 
原文地址:https://www.cnblogs.com/newmiracle/p/14293350.html