diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-07-02 21:36:45 +0200 |
---|---|---|
committer | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-07-02 21:36:45 +0200 |
commit | 8a85e5e58decf77df27d114574026ff8032b8a45 (patch) | |
tree | b2cabead53ee5bed8e157e309e3d63f447338495 /client/shaders/nodes_shader/opengl_vertex.glsl | |
parent | 75d2cfef5cedd47dd0141953f61ae6ba5b0c8ded (diff) | |
download | minetest-8a85e5e58decf77df27d114574026ff8032b8a45.tar.gz minetest-8a85e5e58decf77df27d114574026ff8032b8a45.tar.bz2 minetest-8a85e5e58decf77df27d114574026ff8032b8a45.zip |
Shaders fixes and cleanup relief mapping code.
Diffstat (limited to 'client/shaders/nodes_shader/opengl_vertex.glsl')
-rw-r--r-- | client/shaders/nodes_shader/opengl_vertex.glsl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/shaders/nodes_shader/opengl_vertex.glsl b/client/shaders/nodes_shader/opengl_vertex.glsl index 5c4d46be6..9f8210d12 100644 --- a/client/shaders/nodes_shader/opengl_vertex.glsl +++ b/client/shaders/nodes_shader/opengl_vertex.glsl @@ -41,7 +41,7 @@ void main(void) //Allow parallax/relief mapping only for certain kind of nodes
//Variable is also used to control area of the effect -#if ((DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) && GENERATE_NORMALMAPS) +#if (DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) area_enable_parallax = 1.0; #else area_enable_parallax = 0.0; @@ -94,7 +94,7 @@ void main(void) // Don't generate heightmaps when too far from the eye float dist = distance (vec3(0.0, 0.0 ,0.0), vPosition); - if (dist > 100.0) { + if (dist > 120.0) { area_enable_parallax = 0.0; } @@ -103,7 +103,7 @@ void main(void) vec3 normal, tangent, binormal;
normal = normalize(gl_NormalMatrix * gl_Normal);
tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz); - binormal = normalize(gl_NormalMatrix * -gl_MultiTexCoord2.xyz); + binormal = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz); vec3 v; @@ -111,13 +111,13 @@ void main(void) v.x = dot(lightVec, tangent); v.y = dot(lightVec, binormal); v.z = dot(lightVec, normal); - tsLightVec = v; + tsLightVec = normalize (v); eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz; v.x = dot(eyeVec, tangent); v.y = dot(eyeVec, binormal); v.z = dot(eyeVec, normal); - tsEyeVec = v; + tsEyeVec = normalize (v); vec4 color;
float day = gl_Color.r;
|