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=33202a2b5b7bcbaae8926e37e5828d55442a5d3b;hp=13be4df4cb3135ce9ab42dba2c1aa25973b0f7dd;hb=70468ae7ba6b75df1db1063e9b3fcf0313ffd787;hpb=0b1004e57c35369617cfd0327baf22e8e27a994a diff --git a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag index 13be4df..33202a2 100644 --- a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag @@ -241,18 +241,18 @@ mediump float calculateBlurOpacity() // solve (v.x - x)^2 + (v.y - x)^2 = (cr / cy * x)^2 #if IS_REQUIRED_ROUNDED_CORNER - // NOTE : lowspec HW cannot calculate here. need to reduce numeric error - mediump float A = (cr * cr - 2.0 * cy * cy); - mediump float B = cy * (v.x + v.y); - mediump float V = dot(v,v); - mediump float D = B * B + A * V; + // Note : lowspec HW cannot calculate here. need to reduce numeric error + highp float A = (cr * cr - 2.0 * cy * cy); + highp float B = cy * (v.x + v.y); + highp float V = dot(v,v); + highp float D = B * B + A * V; potential = V * (cr + cy) / (sqrt(D) + B); #else // We can simplify this value cause cy = 0.8 * blurRadius, cr = 1.2 * blurRadius // potential = 5.0*(sqrt(4.0*(v.x+v.y)^2 + dot(v,v)) - 2.0*(v.x+v.y)); // = 10.0*(v.x+v.y) * (sqrt(1.0 + (length(v) / (2.0*(v.x+v.y)))^2) - 1.0); // = 10.0*(v.x+v.y) * (sqrt(1.25 - x + x^2) - 1.0); - // ~= 10.0*(v.x+v.y) * (0.11803399 - 0.44721360x + 0.35777088x^2 - 0.14310x^3 + O(x^4)) (Taylor series) + // ~= 10.0*(v.x+v.y) * (0.11803399 - 0.44721360x + 0.35777088x^2 - 0.14310x^3 + O(x^5)) (Taylor series) // ~= -1.0557281 * (v.x + v.y) + 2.236068 * length(v) - ~~~ (here, x <= 0.5 * (1.0 - sqrt(0.5)) < 0.1464467) // Note : This simplify need cause we should use it on lowspec HW. mediump float x = 0.5 * (1.0 - length(v) / (v.x + v.y)); @@ -273,21 +273,26 @@ void main() if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y) { OUT_COLOR = targetColor; - return; } - PreprocessPotential(); + else + { + PreprocessPotential(); #endif #if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE - targetColor = convertBorderlineColor(targetColor); + targetColor = convertBorderlineColor(targetColor); #endif - OUT_COLOR = targetColor; + OUT_COLOR = targetColor; #if IS_REQUIRED_BLUR - mediump float opacity = calculateBlurOpacity(); - OUT_COLOR.a *= opacity; + mediump float opacity = calculateBlurOpacity(); + OUT_COLOR.a *= opacity; #elif IS_REQUIRED_ROUNDED_CORNER - mediump float opacity = calculateCornerOpacity(); - OUT_COLOR.a *= opacity; + mediump float opacity = calculateCornerOpacity(); + OUT_COLOR.a *= opacity; +#endif + +#if IS_REQUIRED_BLUR || IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE + } #endif }