Skip to content

Instantly share code, notes, and snippets.

@slimsag
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slimsag/bb7712bf68027e7ea350 to your computer and use it in GitHub Desktop.
Save slimsag/bb7712bf68027e7ea350 to your computer and use it in GitHub Desktop.
#version 120
varying vec2 tc0;
uniform sampler2D Texture0;
uniform vec4 palette[64];
void main() {
vec4 t = texture2D(Texture0, tc0);
int i = int(t.b * 15.0) * 16 + int(t.a * 15.0);
i = i - ((i / 64) * 64);
gl_FragColor = palette[i];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment