1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Fix MSAA and bloom flashing artifacts (#15610)

* Mark varColor and nightratio as centroids
* Leave old workaround in place for GLES
This commit is contained in:
lhofhansl 2025-01-01 14:18:05 -08:00 committed by GitHub
parent f54d209bc8
commit 2db4ad8c77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 4 deletions

View file

@ -14,14 +14,17 @@ varying vec3 vPosition;
// cameraOffset + worldPosition (for large coordinates the limits of float
// precision must be considered).
varying vec3 worldPosition;
varying lowp vec4 varColor;
// The centroid keyword ensures that after interpolation the texture coordinates
// lie within the same bounds when MSAA is en- and disabled.
// This fixes the stripes problem with nearest-neighbor textures and MSAA.
#ifdef GL_ES
varying lowp vec4 varColor;
varying mediump vec2 varTexCoord;
varying float nightRatio;
#else
centroid varying lowp vec4 varColor;
centroid varying vec2 varTexCoord;
centroid varying float nightRatio;
#endif
#ifdef ENABLE_DYNAMIC_SHADOWS
// shadow uniforms
@ -44,7 +47,6 @@ centroid varying vec2 varTexCoord;
varying float area_enable_parallax;
varying highp vec3 eyeVec;
varying float nightRatio;
// Color of the light emitted by the light sources.
const vec3 artificialLight = vec3(1.04, 1.04, 1.04);
const float e = 2.718281828459;