Restructured shaderlib by moving functions and renaming files
This commit is contained in:
parent
c70eaed0c4
commit
40374bd849
10 changed files with 53 additions and 49 deletions
|
@ -1,14 +0,0 @@
|
|||
|
||||
// pixelate by lowering uv resolution
|
||||
vec4 pixelate(sampler2D tex, vec2 uv, float resolution_x) {
|
||||
vec2 texture_size = vec2(textureSize(tex, 0));
|
||||
vec2 ratio;
|
||||
if (texture_size.x > texture_size.y) {
|
||||
ratio = vec2(texture_size.x / texture_size.y, 1.0);
|
||||
}
|
||||
else {
|
||||
ratio = vec2(1.0, texture_size.y / texture_size.x);
|
||||
}
|
||||
vec2 r = ratio * resolution_x;
|
||||
return texture(tex, trunc(uv * r) / r);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue