From 2b19a3ae8b8c34ea674058c7b82de44397e29df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 24 Apr 2014 07:37:58 +0300 Subject: Color problem fixed Task-number: QTRD-3001 Changed all colors to QVector4Ds to avoid mixups with vec4 and vec3 colors in shaders. Change-Id: I8b44b4d711befca900dd35b3386881f7c31d7dd5 Change-Id: I8b44b4d711befca900dd35b3386881f7c31d7dd5 Reviewed-by: Mika Salmela --- src/datavisualization/engine/shaders/surfaceShadowFlat.frag | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/datavisualization/engine/shaders/surfaceShadowFlat.frag') diff --git a/src/datavisualization/engine/shaders/surfaceShadowFlat.frag b/src/datavisualization/engine/shaders/surfaceShadowFlat.frag index 9b9305ab..0613a40c 100644 --- a/src/datavisualization/engine/shaders/surfaceShadowFlat.frag +++ b/src/datavisualization/engine/shaders/surfaceShadowFlat.frag @@ -15,7 +15,7 @@ uniform highp vec3 lightPosition_wrld; uniform highp float lightStrength; uniform highp float ambientStrength; uniform highp float shadowQuality; -uniform highp vec3 lightColor; +uniform highp vec4 lightColor; highp vec2 poissonDisk[16] = vec2[16](vec2(-0.94201624, -0.39906216), vec2(0.94558609, -0.76890725), @@ -37,8 +37,8 @@ highp vec2 poissonDisk[16] = vec2[16](vec2(-0.94201624, -0.39906216), void main() { highp vec2 gradientUV = vec2(0.0, (coords_mdl.y + 1.0) / 2.0); highp vec3 materialDiffuseColor = texture2D(textureSampler, gradientUV).xyz; - highp vec3 materialAmbientColor = lightColor * ambientStrength * materialDiffuseColor; - highp vec3 materialSpecularColor = lightColor; + highp vec3 materialAmbientColor = lightColor.rgb * ambientStrength * materialDiffuseColor; + highp vec3 materialSpecularColor = lightColor.rgb; highp vec3 n = normalize(normal_cmr); highp vec3 l = normalize(lightDirection_cmr); -- cgit v1.2.3