- moved documentation out of the Source folder and added surface shader sources.

This commit is contained in:
Christoph Oelckers 2019-10-05 13:17:26 +02:00
parent b83349fe6b
commit 0ee80628a2
8 changed files with 92 additions and 71 deletions

View file

@ -0,0 +1,20 @@
#version 110
//s_texture points to an indexed color texture
uniform sampler2D s_texture;
//s_palette is the palette texture
uniform sampler2D s_palette;
varying vec2 v_texCoord;
const float c_paletteScale = 255.0/256.0;
const float c_paletteOffset = 0.5/256.0;
void main()
{
vec4 color = texture2D(s_texture, v_texCoord.xy);
color.r = c_paletteOffset + c_paletteScale*color.r;
color.rgb = texture2D(s_palette, color.rg).rgb;
gl_FragColor = color;
}

View file

@ -0,0 +1 @@
#version 110 attribute vec4 i_vertPos; attribute vec2 i_texCoord; varying vec2 v_texCoord; void main() { gl_Position = i_vertPos; v_texCoord = i_texCoord; }