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);
}

 

posted @ 2021-01-18 16:21  newmiracle宇宙  阅读(560)  评论(0)    收藏  举报