mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-27 07:26:33 +01:00
13 lines
512 B
Text
13 lines
512 B
Text
|
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.);
|
||
|
}
|