aboutsummaryrefslogtreecommitdiff
path: root/client/shaders/alpha_shader
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2013-12-08 08:01:20 +0100
committerNovatux <nathanael.courant@laposte.net>2013-12-08 08:01:20 +0100
commit206565d9650eeffc86b4223a75203a29bc94cce7 (patch)
treeaf7f15cd0718cf53e18b90805989b97497ba710e /client/shaders/alpha_shader
parent3cc45fd8adf4213bfd979273a094b33fecb6c7db (diff)
downloadminetest-206565d9650eeffc86b4223a75203a29bc94cce7.tar.gz
minetest-206565d9650eeffc86b4223a75203a29bc94cce7.tar.bz2
minetest-206565d9650eeffc86b4223a75203a29bc94cce7.zip
Fix shaders on some GPUs
Diffstat (limited to 'client/shaders/alpha_shader')
-rw-r--r--client/shaders/alpha_shader/opengl_fragment.glsl11
1 files changed, 8 insertions, 3 deletions
diff --git a/client/shaders/alpha_shader/opengl_fragment.glsl b/client/shaders/alpha_shader/opengl_fragment.glsl
index e72c1b9a6..3c0f35eae 100644
--- a/client/shaders/alpha_shader/opengl_fragment.glsl
+++ b/client/shaders/alpha_shader/opengl_fragment.glsl
@@ -21,14 +21,16 @@ 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 height;
vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y);
+ float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;
+ float enable_bumpmapping = enableBumpmapping;
+
if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) {
float map_height = texture2D(normalTexture, uv).a;
if (map_height < 1.0){
@@ -49,6 +51,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);