Created
July 6, 2025 20:20
-
-
Save Bigfoot71/d0c67340d72f33316bb61c38a5bd111f to your computer and use it in GitHub Desktop.
debanding used in bit-crush demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #version 330 core | |
| noperspective in vec2 vTexCoord; | |
| uniform sampler2D uTexColor; | |
| out vec4 FragColor; | |
| float GradientNoise(in vec2 fragCoord) | |
| { | |
| // from: https://www.shadertoy.com/view/lfyBWK | |
| return fract(52.9829189 * fract(dot(fragCoord, vec2(0.06711056, 0.00583715)))); | |
| } | |
| void main() | |
| { | |
| vec3 color = texture(uTexColor, vTexCoord).rgb; | |
| const float DITHER_AMOUNT = 1.0 / 255.0; | |
| color += DITHER_AMOUNT * GradientNoise(gl_FragCoord.xy); | |
| FragColor = vec4(color, 1.0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment