mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-14 22:43:53 +01:00
13 lines
512 B
GLSL
13 lines
512 B
GLSL
uniform int sampleMode;
|
|
|
|
vec4 sampleTexture( sampler2D texture, vec2 pos) {
|
|
if(pos.x >= 0. && pos.y >= 0. && pos.x <= 1. && pos.y <= 1.)
|
|
return texture2D(texture, pos);
|
|
|
|
if(sampleMode <= 1) return vec4(0.);
|
|
else if(sampleMode == 2) return texture2D(texture, clamp(pos, 0., 1.));
|
|
else if(sampleMode == 3) return texture2D(texture, fract(pos));
|
|
else if(sampleMode == 4) return vec4(vec3(0.), 1.);
|
|
|
|
return vec4(0.);
|
|
} |