Replace FlashPaletteEffect with a post-processing shader.

This commit is contained in:
Paul Chote
2023-10-22 17:06:28 +01:00
committed by Gustas
parent 59d40c8b4e
commit a51a9700cf
15 changed files with 77 additions and 52 deletions

View File

@@ -0,0 +1,31 @@
#version {VERSION}
#ifdef GL_ES
precision mediump float;
#endif
uniform float Blend;
uniform vec3 Color;
uniform sampler2D WorldTexture;
#if __VERSION__ == 120
uniform vec2 WorldTextureSize;
#else
out vec4 fragColor;
#endif
void main()
{
#if __VERSION__ == 120
vec4 c = texture2D(WorldTexture, gl_FragCoord.xy / WorldTextureSize);
#else
vec4 c = texture(WorldTexture, gl_FragCoord.xy / textureSize(WorldTexture, 0));
#endif
c = vec4(Color, c.a) * Blend + c * (1.0 - Blend);
#if __VERSION__ == 120
gl_FragColor = c;
#else
fragColor = c;
#endif
}