着色器图像处理(效果显示)
2019-12-08 本文已影响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. );
}
对称