diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-12-12 14:00:10 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-12-12 14:00:10 +0100 |
commit | 7250cf2c1c29b685b8ac3552c296f11c8178b0a0 (patch) | |
tree | 8a36316aaa95e5355f35229f816b52db0fd7eac0 /client/shaders/nodes_shader | |
parent | f783f59392f5e86c5645195521b2fa008ffe4fe7 (diff) | |
parent | af073438fd70833955a30bcbe1c22e6f344ec41c (diff) | |
download | dragonfireclient-7250cf2c1c29b685b8ac3552c296f11c8178b0a0.tar.xz |
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'client/shaders/nodes_shader')
-rw-r--r-- | client/shaders/nodes_shader/opengl_fragment.glsl | 6 | ||||
-rw-r--r-- | client/shaders/nodes_shader/opengl_vertex.glsl | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/client/shaders/nodes_shader/opengl_fragment.glsl b/client/shaders/nodes_shader/opengl_fragment.glsl index 82c87073a..b0f6d45d0 100644 --- a/client/shaders/nodes_shader/opengl_fragment.glsl +++ b/client/shaders/nodes_shader/opengl_fragment.glsl @@ -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 diff --git a/client/shaders/nodes_shader/opengl_vertex.glsl b/client/shaders/nodes_shader/opengl_vertex.glsl index cb344f6e6..5742ec1d3 100644 --- a/client/shaders/nodes_shader/opengl_vertex.glsl +++ b/client/shaders/nodes_shader/opengl_vertex.glsl @@ -16,7 +16,10 @@ varying vec3 vPosition; // precision must be considered). varying vec3 worldPosition; varying lowp vec4 varColor; -varying mediump vec2 varTexCoord; +// 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-neighbour textures and MSAA. +centroid varying mediump vec2 varTexCoord; varying vec3 eyeVec; // Color of the light emitted by the light sources. @@ -142,7 +145,7 @@ void main(void) vec4 color; // The alpha gives the ratio of sunlight in the incoming light. float nightRatio = 1.0 - inVertexColor.a; - color.rgb = inVertexColor.rgb * (inVertexColor.a * dayLight.rgb + + color.rgb = inVertexColor.rgb * (inVertexColor.a * dayLight.rgb + nightRatio * artificialLight.rgb) * 2.0; color.a = 1.0; |