Resolve visual defect when BorderlineWidth=0.0f 38/265038/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 7 Oct 2021 10:16:37 +0000 (19:16 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Thu, 7 Oct 2021 10:16:37 +0000 (19:16 +0900)
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 <eunkiki.hong@samsung.com>
dali-toolkit/internal/graphics/shaders/color-visual-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag
dali-toolkit/internal/graphics/shaders/image-visual-shader.frag

index ca94a2e..13be4df 100644 (file)
@@ -122,6 +122,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
   {
     // potential is inside borderline range.
     borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential);
   {
     // 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;
   }
 
   lowp vec3  borderlineColorRGB   = borderlineColor.rgb * uActorColor.rgb;
index 892035e..80090f8 100644 (file)
@@ -121,6 +121,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
   {
     // potential is inside borderline range.
     borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential);
   {
     // 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;
   }
 
   lowp vec3  borderlineColorRGB   = borderlineColor.rgb * uActorColor.rgb;
index fe6469b..37f080f 100644 (file)
@@ -143,6 +143,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
   {
     // potential is inside borderline range.
     borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential);
   {
     // 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;
   }
 
   lowp vec3  borderlineColorRGB   = borderlineColor.rgb * uActorColor.rgb;