From 206565d9650eeffc86b4223a75203a29bc94cce7 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sun, 8 Dec 2013 08:01:20 +0100 Subject: Fix shaders on some GPUs --- client/shaders/leaves_shader/opengl_fragment.glsl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'client/shaders/leaves_shader') diff --git a/client/shaders/leaves_shader/opengl_fragment.glsl b/client/shaders/leaves_shader/opengl_fragment.glsl index 127b32d51..00b6884ab 100644 --- a/client/shaders/leaves_shader/opengl_fragment.glsl +++ b/client/shaders/leaves_shader/opengl_fragment.glsl @@ -18,12 +18,13 @@ const float e = 2.718281828459; void main (void) { - float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; - float enable_bumpmapping = enableBumpmapping; - vec3 color; vec2 uv = gl_TexCoord[0].st; +#ifdef NORMALS + float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r; + float enable_bumpmapping = enableBumpmapping; + if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) { vec3 base = texture2D(baseTexture, uv).rgb; vec3 vVec = normalize(eyeVec); @@ -36,6 +37,9 @@ void main (void) } else { color = texture2D(baseTexture, uv).rgb; } +#else + color = texture2D(baseTexture, uv).rgb; +#endif float alpha = texture2D(baseTexture, uv).a; vec4 col = vec4(color.r, color.g, color.b, alpha); -- cgit v1.2.3