X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fgraphics%2Fshaders%2Fgradient-visual-shader.frag;h=cb72c6778f7758010d42a56d21a497842c54b9b7;hb=refs%2Fchanges%2F02%2F263702%2F1;hp=9c897b4dcd34f0d4974aedf19224aac869d71b6f;hpb=862dfd28532f834238394c7ec0a15069c9bd2188;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag index 9c897b4..cb72c67 100644 --- a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag @@ -128,19 +128,21 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor) mediump float tCornerRadius = -gCenterPosition; mediump float MaxTexturelinePotential = tCornerRadius + gPotentialRange; mediump float MinTexturelinePotential = tCornerRadius - gPotentialRange; + lowp vec3 BorderlineColorRGB = borderlineColor.xyz * borderlineColor.a; 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)); } borderlineOpacity *= borderlineColor.a; + return mix(textureColor, vec4(BorderlineColorRGB, 1.0), borderlineOpacity); } - return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity); + return mix(textureColor, borderlineColor, borderlineOpacity); } #endif @@ -169,16 +171,16 @@ mediump float calculateCornerOpacity() void main() { #if RADIAL - lowp vec4 textureColor = TEXTURE(sTexture, vec2(length(vTexCoord), 0.5)) * vec4(mixColor, 1.0) * uColor; + lowp vec4 textureColor = TEXTURE(sTexture, vec2(length(vTexCoord), 0.5)) * vec4(mixColor, 1.0); #else - lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0) * uColor; + lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0); #endif #if 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 = textureColor; + OUT_COLOR = textureColor * uColor; return; } PreprocessPotential(); @@ -187,7 +189,7 @@ void main() #if IS_REQUIRED_BORDERLINE textureColor = convertBorderlineColor(textureColor); #endif - OUT_COLOR = textureColor; + OUT_COLOR = textureColor * uColor; #if IS_REQUIRED_ROUNDED_CORNER mediump float opacity = calculateCornerOpacity();