SangeFault/assets/minecraft/shaders/program/bits.fsh
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 a50683c84e Updated to 1.18.1 Vanilla Assets
basically starting over... this is gonna be fun!
2022-01-20 17:44:06 +01:00

29 lines
686 B
GLSL

#version 150
uniform sampler2D DiffuseSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
uniform float Resolution;
uniform float Saturation;
uniform float MosaicSize;
out vec4 fragColor;
void main() {
vec2 mosaicInSize = InSize / MosaicSize;
vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize;
vec4 baseTexel = texture(DiffuseSampler, texCoord - fractPix);
vec3 fractTexel = baseTexel.rgb - fract(baseTexel.rgb * Resolution) / Resolution;
float luma = dot(fractTexel, vec3(0.3, 0.59, 0.11));
vec3 chroma = (fractTexel - luma) * Saturation;
baseTexel.rgb = luma + chroma;
baseTexel.a = 1.0;
fragColor = baseTexel;
}