X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fgraphics%2Fshaders%2Fcolor-visual-shader.frag;h=cf1eb08d8465b648d95ed7061473f3223baea69e;hp=74e8f581662bd673fb03fd316ca8f9ca2ec7e6ea;hb=48220839bdcedaca9d53cbd15aab66353187c14b;hpb=fa3f750c6878eb126034d7958458dc3a1f67924f diff --git a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag index 74e8f58..cf1eb08 100644 --- a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag @@ -23,6 +23,7 @@ uniform lowp vec3 mixColor; uniform mediump float borderlineWidth; uniform mediump float borderlineOffset; uniform lowp vec4 borderlineColor; +uniform lowp vec4 uActorColor; #endif #if IS_REQUIRED_BLUR uniform mediump float blurRadius; @@ -123,6 +124,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor) borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential); } + lowp vec3 BorderlineColorRGB = borderlineColor.rgb * uActorColor.rgb; + lowp float BorderlineColorAlpha = borderlineColor.a * uActorColor.a; + //calculate inside of borderline when outilneColor.a < 1.0 if(borderlineColor.a < 1.0) { @@ -132,17 +136,18 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor) if(potential > MaxTexturelinePotential) { // potential is out of texture range. use borderline color instead of texture - textureColor = vec4(borderlineColor.xyz, 0.0); + textureColor = vec4(BorderlineColorRGB, 0.0); } else if(potential > MinTexturelinePotential) { // potential is in texture range - textureColor = mix(textureColor, vec4(borderlineColor.xyz, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential)); + textureColor = mix(textureColor, vec4(BorderlineColorRGB, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential)); } + // TODO : need to fix here when uColor.a = 0.0 and uActorColor.a != 0 borderlineOpacity *= borderlineColor.a; - return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity); + return mix(textureColor, vec4(BorderlineColorRGB, 1.0), borderlineOpacity); } - return mix(textureColor, borderlineColor, borderlineOpacity); + return mix(textureColor, vec4(BorderlineColorRGB, BorderlineColorAlpha), borderlineOpacity); } #endif @@ -239,13 +244,13 @@ mediump float calculateBlurOpacity() void main() { - lowp vec4 targetColor = vec4(mixColor, 1.0); + lowp vec4 targetColor = vec4(mixColor, 1.0) * uColor; #if IS_REQUIRED_BLUR || IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE // skip most potential calculate for performance if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y) { - OUT_COLOR = targetColor * uColor; + OUT_COLOR = targetColor; return; } PreprocessPotential(); @@ -254,7 +259,7 @@ void main() #if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE targetColor = convertBorderlineColor(targetColor); #endif - OUT_COLOR = targetColor * uColor; + OUT_COLOR = targetColor; #if IS_REQUIRED_BLUR mediump float opacity = calculateBlurOpacity();