From 53efe2ef4272c4ea8c347059e096f1ebd210d9a2 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Sun, 21 Jun 2015 00:11:09 +0200 Subject: Remove textures vertical offset. Fix for area enabling parallax. --- client/shaders/nodes_shader/opengl_fragment.glsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/shaders/nodes_shader/opengl_fragment.glsl') diff --git a/client/shaders/nodes_shader/opengl_fragment.glsl b/client/shaders/nodes_shader/opengl_fragment.glsl index 066e49658..0e84eacf9 100644 --- a/client/shaders/nodes_shader/opengl_fragment.glsl +++ b/client/shaders/nodes_shader/opengl_fragment.glsl @@ -8,7 +8,7 @@ uniform vec3 eyePosition; varying vec3 vPosition; varying vec3 worldPosition; -varying float generate_heightmaps; +varying float area_enable_parallax; varying vec3 eyeVec; varying vec3 tsEyeVec; @@ -95,7 +95,7 @@ void main (void) vec3 eyeRay = normalize(tsEyeVec); #if PARALLAX_OCCLUSION_MODE == 0 // Parallax occlusion with slope information - if (normalTexturePresent) { + if (normalTexturePresent && area_enable_parallax > 0.0) { const float scale = PARALLAX_OCCLUSION_SCALE / PARALLAX_OCCLUSION_ITERATIONS; const float bias = PARALLAX_OCCLUSION_BIAS / PARALLAX_OCCLUSION_ITERATIONS; for(int i = 0; i < PARALLAX_OCCLUSION_ITERATIONS; i++) { @@ -106,12 +106,12 @@ void main (void) #endif #if PARALLAX_OCCLUSION_MODE == 1 // Relief mapping - if (normalTexturePresent) { + if (normalTexturePresent && area_enable_parallax > 0.0) { vec2 ds = eyeRay.xy * PARALLAX_OCCLUSION_SCALE; float dist = find_intersection(uv, ds); uv += dist * ds; #endif - } else if (generate_heightmaps > 0.0) { + } else if (area_enable_parallax > 0.0) { vec2 ds = eyeRay.xy * PARALLAX_OCCLUSION_SCALE; float dist = find_intersectionRGB(uv, ds); uv += dist * ds; -- cgit v1.2.3