1.代码
void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
// 定义贴图坐标
vec2 uv = fragCoord / iResolution.xy;
mat3 m = mat3(1.0,0.0,0.0,
0.0,1.0,1.0,
0.0,0.0,1.0);
vec3 uv2 = vec3(uv,1.0);
vec3 uv3 = uv2 * m;
vec3 c = texture(iChannel0, uv3.xy).rgb;
fragColor = vec4(vec3(c), 1.0);
}
正常的图:
错切矩阵
mat3 m = mat3(1.0,0.0,0.0,
-0.3,1.0,1.0,
0.0,0.0,1.0);
效果: