小编Ale*_*and的帖子

WebGL片段着色器不透明度

好吧,首先,我是GLSL着色器的新手,我正试图绕着下面的着色器

#ifdef GL_ES
    //precision mediump float;
    precision highp float;
    #endif

    uniform vec2 uTimes;

    varying vec2 texCoord;
    varying vec2 screenCoord;

    void main(void) {
        vec3 col;
        float c;
        vec2 tmpv = texCoord * vec2(0.8, 1.0) - vec2(0.95, 1.0);
        c = exp(-pow(length(tmpv) * 1.8, 2.0));
        col = mix(vec3(0.02, 0.0, 0.03), vec3(0.96, 0.98, 1.0) * 1.5, c);
        gl_FragColor = vec4(col * 0.5, 0);
    }
Run Code Online (Sandbox Code Playgroud)

到目前为止,我知道它给了我一个径向梯度(也许).我真正想知道的是如何使它完全透明.我想我需要一个vec4,对吧?

javascript shader glsl webgl

2
推荐指数
1
解决办法
3868
查看次数

标签 统计

glsl ×1

javascript ×1

shader ×1

webgl ×1