glonkers/examples/texture.glsl
2026-03-15 14:49:19 +01:00

13 lines
547 B
GLSL

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord / iResolution.xy;
uv = vec2(uv.x, 1.0 - uv.y);
// mixes two textures
//fragColor = mix(texture(iChannel0, uv), texture(iChannel1, uv), 0.2);
vec2 tex_uv = vec2(fragCoord.x, 1.0 - fragCoord.y);
// test resolutions
//fragColor = texture(iChannel0, tex_uv / iChannelResolution[0].xy);
// combine them!
fragColor = mix(texture(iChannel0, tex_uv / iChannelResolution[0].xy), texture(iChannel1, tex_uv / iChannelResolution[1].xy), 0.2);
}