diff --git a/client/shaders/extract_bloom/opengl_fragment.glsl b/client/shaders/extract_bloom/opengl_fragment.glsl index 281884cee..997b6ba2d 100644 --- a/client/shaders/extract_bloom/opengl_fragment.glsl +++ b/client/shaders/extract_bloom/opengl_fragment.glsl @@ -23,7 +23,12 @@ void main(void) vec2 uv = varTexCoord.st; vec3 color = texture2D(rendered, uv).rgb; // translate to linear colorspace (approximate) +#ifdef GL_ES + // clamp color to [0,1] range in lieu of centroids color = pow(clamp(color, 0.0, 1.0), vec3(2.2)); +#else + color = pow(color, vec3(2.2)); +#endif color *= exposureParams.compensationFactor * bloomStrength; diff --git a/client/shaders/nodes_shader/opengl_fragment.glsl b/client/shaders/nodes_shader/opengl_fragment.glsl index 639b658a5..537f8b4a7 100644 --- a/client/shaders/nodes_shader/opengl_fragment.glsl +++ b/client/shaders/nodes_shader/opengl_fragment.glsl @@ -39,14 +39,16 @@ varying vec3 vPosition; // cameraOffset + worldPosition (for large coordinates the limits of float // precision must be considered). varying vec3 worldPosition; -varying lowp vec4 varColor; #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 varying highp vec3 eyeVec; -varying float nightRatio; #ifdef ENABLE_DYNAMIC_SHADOWS #if (defined(ENABLE_WATER_REFLECTIONS) && MATERIAL_WAVING_LIQUID && ENABLE_WAVING_WATER) diff --git a/client/shaders/nodes_shader/opengl_vertex.glsl b/client/shaders/nodes_shader/opengl_vertex.glsl index 15a39565c..0f508dc6a 100644 --- a/client/shaders/nodes_shader/opengl_vertex.glsl +++ b/client/shaders/nodes_shader/opengl_vertex.glsl @@ -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;