From c2c2513ca81ea0db5a9ccdd99339a9b0ca77bd88 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Thu, 7 Oct 2021 19:16:37 +0900 Subject: [PATCH] Resolve visual defect when BorderlineWidth=0.0f Normally, Set borderlineWidth=0.0f directly doesn't make visual defect. But when we animate the borderlineWidth, we can se borderlineColor near 0.5pixel! This visual defect occured cause we did hand-made anti-alias. Now, we just multiply the borderline's with into the borderline's opacity. This mechanisme is comes from what we draw borderline when borderlineWidth is less then 1 pixel. Change-Id: Ic8ef7b451d66ef0a625ad9c8392824d1f6cc6d9a Signed-off-by: Eunki, Hong --- dali-toolkit/internal/graphics/shaders/color-visual-shader.frag | 3 +++ dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag | 3 +++ dali-toolkit/internal/graphics/shaders/image-visual-shader.frag | 3 +++ 3 files changed, 9 insertions(+) diff --git a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag index ca94a2e..13be4df 100644 --- a/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/color-visual-shader.frag @@ -122,6 +122,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor) { // potential is inside borderline range. borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential); + + // Muliply borderlineWidth to resolve very thin borderline + borderlineOpacity *= min(1.0, borderlineWidth); } lowp vec3 borderlineColorRGB = borderlineColor.rgb * uActorColor.rgb; diff --git a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag index 892035e..80090f8 100644 --- a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag @@ -121,6 +121,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor) { // potential is inside borderline range. borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential); + + // Muliply borderlineWidth to resolve very thin borderline + borderlineOpacity *= min(1.0, borderlineWidth); } lowp vec3 borderlineColorRGB = borderlineColor.rgb * uActorColor.rgb; diff --git a/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag index fe6469b..37f080f 100644 --- a/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag +++ b/dali-toolkit/internal/graphics/shaders/image-visual-shader.frag @@ -143,6 +143,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor) { // potential is inside borderline range. borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential); + + // Muliply borderlineWidth to resolve very thin borderline + borderlineOpacity *= min(1.0, borderlineWidth); } lowp vec3 borderlineColorRGB = borderlineColor.rgb * uActorColor.rgb; -- 2.7.4