cc3dsfs/shaders/bit_crusher_fragment_shader.2_to_x_1_7.frag
2024-12-03 06:38:33 +01:00

10 lines
317 B
GLSL

uniform sampler2D Texture0;
const float inner_divisor = x;
const float bit_crusher = 255.0 / inner_divisor;
const float normalizer = inner_divisor * (255.0 / (256.0 - inner_divisor)) / 255.0;
void main() {
gl_FragColor = clamp(floor(texture2D(Texture0, gl_TexCoord[0].xy) * bit_crusher) * normalizer, 0.0, 1.0);
}