美文网首页
着色器图像处理(效果显示)

着色器图像处理(效果显示)

作者: 冰三尺 | 来源:发表于2019-12-08 22:42 被阅读0次
shader

对称


precision highp float;
varying lowp vec2 varyTextCoord;
uniform sampler2D texMap;
uniform sampler2D colorMap;
uniform float stepValue;

void main() {
    float uT = stepValue;
    vec2 st = varyTextCoord;
    vec3 color;
    
    if (st.x < 0.5) {
        st = vec2(st.x, st.y);
        vec3 thisrgb = texture2D(colorMap, vec2(1.0 - st.x, st.y)).rgb;;
        color = thisrgb;
    }else {
        st = vec2(st.x, st.y);
        vec3 thisrgb = texture2D(colorMap, vec2(st.x, st.y)).rgb;;
        color = thisrgb;
    }
    
    gl_FragColor = vec4(color, 1. );
}

对称

相关文章

网友评论

      本文标题:着色器图像处理(效果显示)

      本文链接:https://www.haomeiwen.com/subject/lodvgctx.html