platformer
platformer copied to clipboard
Maybe change Tile layer shader from index to xy
And 255*255 is kind of enough for single tile set (if not it can use to other channels)
//Fragment shader
#version 110
uniform sampler2D ColorTable; //256 x 1 pixels
uniform sampler2D MyIndexTexture;
varying vec2 TexCoord0;
void main()
{
//What color do we want to index?
vec4 myindex = texture2D(MyIndexTexture, TexCoord0);
//Do a dependency texture read
vec4 texel = texture2D(ColorTable, myindex.xy);
gl_FragColor = texel; //Output the color
}```