Created
April 18, 2024 00:26
-
-
Save insom/d221dcb299028d9fa3aeb5b7121991ad to your computer and use it in GitHub Desktop.
A shader to make the world use 216 web-safe colours.
This file contains 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 | |
in vec2 texcoord; | |
uniform sampler2D tex; | |
uniform float opacity; | |
vec4 default_post_processing(vec4 c); | |
vec4 window_shader() { | |
vec2 texsize = textureSize(tex, 0); | |
vec4 color = texture2D(tex, texcoord / texsize, 0); | |
color.r *= 6; | |
color.r = round(color.r); | |
color.r /= 6; | |
color.g *= 6; | |
color.g = round(color.g); | |
color.g /= 6; | |
color.b *= 6; | |
color.b = round(color.b); | |
color.b /= 6; | |
return default_post_processing(color); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment