From b4d607f2eab8eee9c873b838c7f939ddaef6833b Mon Sep 17 00:00:00 2001 From: Andrew Poor Date: Tue, 30 Aug 2016 14:30:05 +0100 Subject: [PATCH] Alpha values handled correctly in Primitive Visual. Change-Id: I6df7b84245343a05f5dd6e0afbb061661134295a --- dali-toolkit/internal/visuals/primitive/primitive-visual.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index c85a7a0..fa40339 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -74,7 +74,7 @@ const float DEFAULT_SCALE_HEIGHT = 3.0; ///< For all conics const float DEFAULT_SCALE_RADIUS = 1.0; ///< For cylinders const float DEFAULT_BEVEL_PERCENTAGE = 0.0; ///< For bevelled cubes const float DEFAULT_BEVEL_SMOOTHNESS = 0.0; ///< For bevelled cubes -const Vector4 DEFAULT_COLOR = Vector4( 0.5, 0.5, 0.5, 0.0 ); ///< Grey, for all. +const Vector4 DEFAULT_COLOR = Vector4( 0.5, 0.5, 0.5, 1.0 ); ///< Grey, for all. //Property limits const int MIN_SLICES = 3; ///< Minimum number of slices for spheres and conics @@ -96,7 +96,7 @@ const char * const BEVELLED_CUBE_LABEL( "BEVELLED_CUBE" ); //Shader properties const char * const OBJECT_MATRIX_UNIFORM_NAME( "uObjectMatrix" ); -const char * const COLOR_UNIFORM_NAME( "uColor" ); +const char * const COLOR_UNIFORM_NAME( "mixColor" ); const char * const OBJECT_DIMENSIONS_UNIFORM_NAME( "uObjectDimensions" ); const char * const STAGE_OFFSET_UNIFORM_NAME( "uStageOffset" ); @@ -151,10 +151,12 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( precision mediump float;\n varying mediump vec3 vIllumination;\n uniform lowp vec4 uColor;\n + uniform lowp vec4 mixColor;\n void main()\n {\n - gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a );\n + vec4 baseColor = mixColor * uColor;\n + gl_FragColor = vec4( vIllumination.rgb * baseColor.rgb, baseColor.a );\n }\n ); -- 2.7.4