summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/shaders/surfaceShadowFlat.frag
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@theqtcompany.com>2014-10-22 11:00:25 +0300
committerMika Salmela <mika.salmela@theqtcompany.com>2014-10-22 11:04:40 +0300
commit4f9b9e875ce831cdad3c4f303132a6860cf879f8 (patch)
tree4b10560c36c4df7163bec4683113ad46f66652aa /src/datavisualization/engine/shaders/surfaceShadowFlat.frag
parent6be168da13a8d66f4b22e3e39ebdd72c657d0ebe (diff)
Surface shadow improvement
Not allowing bias go below 0.001 prevents the shadow acne. Faulty formula for lighning direction. Task-number: QTRD-3382 Change-Id: Ided8bf423a961744ace8bef32ae18d6fa2c443ef Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'src/datavisualization/engine/shaders/surfaceShadowFlat.frag')
-rw-r--r--src/datavisualization/engine/shaders/surfaceShadowFlat.frag4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/datavisualization/engine/shaders/surfaceShadowFlat.frag b/src/datavisualization/engine/shaders/surfaceShadowFlat.frag
index 4b0dfae0..7eaba7f5 100644
--- a/src/datavisualization/engine/shaders/surfaceShadowFlat.frag
+++ b/src/datavisualization/engine/shaders/surfaceShadowFlat.frag
@@ -2,7 +2,7 @@
#extension GL_EXT_gpu_shader4 : require
-varying highp vec3 coords_mdl;
+varying highp vec2 coords_mdl;
varying highp vec3 position_wrld;
flat varying highp vec3 normal_cmr;
varying highp vec3 eyeDirection_cmr;
@@ -51,7 +51,7 @@ void main() {
highp float cosAlpha = clamp(dot(E, R), 0.0, 1.0);
highp float bias = 0.005 * tan(acos(cosTheta));
- bias = clamp(bias, 0.0, 0.01);
+ bias = clamp(bias, 0.001, 0.01);
vec4 shadCoords = shadowCoord;
shadCoords.z -= bias;