mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
62e9112133
All this comes from a time when I didn't use version.h so it's better to do it the same way as GZDoom to allow easy renaming of the engine.
21 lines
471 B
GLSL
21 lines
471 B
GLSL
#version 330
|
|
|
|
//s_texture points to an indexed color texture
|
|
uniform sampler2D s_texture;
|
|
//s_palette is the palette texture
|
|
uniform sampler2D s_palette;
|
|
|
|
in vec2 v_texCoord;
|
|
out vec4 FragColor;
|
|
|
|
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;
|
|
|
|
FragColor = color;
|
|
}
|