platformer icon indicating copy to clipboard operation
platformer copied to clipboard

Maybe change Tile layer shader from index to xy

Open justgook opened this issue 5 years ago • 0 comments

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
}```

justgook avatar Jul 03 '19 00:07 justgook