mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-21 18:11:11 +00:00
Fix MSAA stripes (#9247)
This only works when shaders are enabled. The centroid varying avoids that the textures (which repeat themselves out of bounds) are sampled out of bounds in MSAA. If MSAA (called FSAA in minetest) is disabled, the centroid keyword does nothing.
This commit is contained in:
parent
ecd4f45318
commit
e73c5d4585
5 changed files with 13 additions and 10 deletions
|
@ -16,7 +16,7 @@ varying vec3 vPosition;
|
|||
// precision must be considered).
|
||||
varying vec3 worldPosition;
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
centroid varying mediump vec2 varTexCoord;
|
||||
varying vec3 eyeVec;
|
||||
|
||||
const float fogStart = FOG_START;
|
||||
|
@ -46,7 +46,7 @@ vec4 applyToneMapping(vec4 color)
|
|||
const float gamma = 1.6;
|
||||
const float exposureBias = 5.5;
|
||||
color.rgb = uncharted2Tonemap(exposureBias * color.rgb);
|
||||
// Precalculated white_scale from
|
||||
// Precalculated white_scale from
|
||||
//vec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W));
|
||||
vec3 whiteScale = vec3(1.036015346);
|
||||
color.rgb *= whiteScale;
|
||||
|
@ -72,7 +72,7 @@ void main(void)
|
|||
color = base.rgb;
|
||||
|
||||
vec4 col = vec4(color.rgb * varColor.rgb, 1.0);
|
||||
|
||||
|
||||
#ifdef ENABLE_TONE_MAPPING
|
||||
col = applyToneMapping(col);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue