From c9ba92c4ad0b010d6d36890c3b1ddfb2e773560f Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Mon, 7 Jul 2014 16:17:51 +0200 Subject: Faces shading fixes --- client/shaders/nodes_shader/opengl_vertex.glsl | 14 -------------- client/shaders/water_surface_shader/opengl_vertex.glsl | 14 -------------- 2 files changed, 28 deletions(-) (limited to 'client/shaders') diff --git a/client/shaders/nodes_shader/opengl_vertex.glsl b/client/shaders/nodes_shader/opengl_vertex.glsl index 88e489e6c..03b682d1b 100644 --- a/client/shaders/nodes_shader/opengl_vertex.glsl +++ b/client/shaders/nodes_shader/opengl_vertex.glsl @@ -63,35 +63,28 @@ void main(void) vec3 normal, tangent, binormal; normal = normalize(gl_NormalMatrix * gl_Normal); - float tileContrast = 1.0; if (gl_Normal.x > 0.5) { // 1.0, 0.0, 0.0 - tileContrast = 0.8; tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, -1.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } else if (gl_Normal.x < -0.5) { // -1.0, 0.0, 0.0 - tileContrast = 0.8; tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } else if (gl_Normal.y > 0.5) { // 0.0, 1.0, 0.0 - tileContrast = 1.2; tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); } else if (gl_Normal.y < -0.5) { // 0.0, -1.0, 0.0 - tileContrast = 0.3; tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); } else if (gl_Normal.z > 0.5) { // 0.0, 0.0, 1.0 - tileContrast = 0.5; tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } else if (gl_Normal.z < -0.5) { // 0.0, 0.0, -1.0 - tileContrast = 0.5; tangent = normalize(gl_NormalMatrix * vec3(-1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } @@ -129,13 +122,6 @@ void main(void) color.g = rg; color.b = b; -#if !(MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) - // Make sides and bottom darker than the top - color = color * color; // SRGB -> Linear - color *= tileContrast; - color = sqrt(color); // Linear -> SRGB -#endif - color.a = gl_Color.a; gl_FrontColor = gl_BackColor = clamp(color,0.0,1.0); } diff --git a/client/shaders/water_surface_shader/opengl_vertex.glsl b/client/shaders/water_surface_shader/opengl_vertex.glsl index 88e489e6c..03b682d1b 100644 --- a/client/shaders/water_surface_shader/opengl_vertex.glsl +++ b/client/shaders/water_surface_shader/opengl_vertex.glsl @@ -63,35 +63,28 @@ void main(void) vec3 normal, tangent, binormal; normal = normalize(gl_NormalMatrix * gl_Normal); - float tileContrast = 1.0; if (gl_Normal.x > 0.5) { // 1.0, 0.0, 0.0 - tileContrast = 0.8; tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, -1.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } else if (gl_Normal.x < -0.5) { // -1.0, 0.0, 0.0 - tileContrast = 0.8; tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } else if (gl_Normal.y > 0.5) { // 0.0, 1.0, 0.0 - tileContrast = 1.2; tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); } else if (gl_Normal.y < -0.5) { // 0.0, -1.0, 0.0 - tileContrast = 0.3; tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0)); } else if (gl_Normal.z > 0.5) { // 0.0, 0.0, 1.0 - tileContrast = 0.5; tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } else if (gl_Normal.z < -0.5) { // 0.0, 0.0, -1.0 - tileContrast = 0.5; tangent = normalize(gl_NormalMatrix * vec3(-1.0, 0.0, 0.0)); binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0)); } @@ -129,13 +122,6 @@ void main(void) color.g = rg; color.b = b; -#if !(MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) - // Make sides and bottom darker than the top - color = color * color; // SRGB -> Linear - color *= tileContrast; - color = sqrt(color); // Linear -> SRGB -#endif - color.a = gl_Color.a; gl_FrontColor = gl_BackColor = clamp(color,0.0,1.0); } -- cgit v1.2.3