Simplify post-processing shaders.
This commit is contained in:
@@ -9,7 +9,7 @@ out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c = texture(WorldTexture, gl_FragCoord.xy / textureSize(WorldTexture, 0));
|
||||
vec4 c = texelFetch(WorldTexture, ivec2(gl_FragCoord.xy), 0);
|
||||
float lum = 0.5 * (min(c.r, min(c.g, c.b)) + max(c.r, max(c.g, c.b)));
|
||||
fragColor = vec4(lum, lum, lum, c.a) * Blend + c * (1.0 - Blend);
|
||||
fragColor = mix(c, vec4(lum, lum, lum, c.a), Blend);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c = texture(WorldTexture, gl_FragCoord.xy / textureSize(WorldTexture, 0));
|
||||
fragColor = vec4(Color, c.a) * Blend + c * (1.0 - Blend);
|
||||
vec4 c = texelFetch(WorldTexture, ivec2(gl_FragCoord.xy), 0);
|
||||
fragColor = mix(c, vec4(Color, c.a), Blend);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ vec4 ColorForEffect(float effect, vec4 c)
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c = texture(WorldTexture, gl_FragCoord.xy / vec2(textureSize(WorldTexture, 0)));
|
||||
fragColor = ColorForEffect(From, c) * Blend + ColorForEffect(To, c) * (1.0 - Blend);
|
||||
vec4 c = texelFetch(WorldTexture, ivec2(gl_FragCoord.xy), 0);
|
||||
fragColor = mix(ColorForEffect(To, c), ColorForEffect(From, c), Blend);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c = texture(WorldTexture, gl_FragCoord.xy / textureSize(WorldTexture, 0));
|
||||
fragColor = vec4(min(c.r * Tint.r, 1.0), min(c.g * Tint.g, 1.0), min(c.b * Tint.b, 1.0), c.a);
|
||||
vec4 c = texelFetch(WorldTexture, ivec2(gl_FragCoord.xy), 0);
|
||||
fragColor = vec4(Tint, c.a) * c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user