[Bf-blender-cvs] [c20caec7f0b] master: Fix T70381: Motion Paths off by one

Sybren A. Stüvel noreply at git.blender.org
Thu Feb 27 17:48:32 CET 2020


Commit: c20caec7f0b39b7d15bd600880ea9534c31f6732
Author: Sybren A. Stüvel
Date:   Thu Feb 27 17:41:28 2020 +0100
Branches: master
https://developer.blender.org/rBc20caec7f0b39b7d15bd600880ea9534c31f6732

Fix T70381: Motion Paths off by one

The apparent off-by-one error was caused by a few factors:

- The 'blend base' colour was green for the two frames directly
  surrounding the current frame, but black for the current frame itself.
- For the frames before the current one, the 'blend base' was mixed with
  black, making the green stand out clearly, but fading to black again
  for the current frame. This looks like an off-by-one, even though it
  was just bad mixing.
- For the frames after the current one, the 'blend base' was mixed with
  cyan, which already has a strong green component, so mixing it there
  was much less visible, making the entire thing look like an off-by-one
  error where it actually wasn't.

I have simplified the code, so now it only chooses green as the 'blend
base' for the current frame, and simplified the mixing for the current
frame.

===================================================================

M	source/blender/draw/engines/overlay/shaders/motion_path_line_vert.glsl

===================================================================

diff --git a/source/blender/draw/engines/overlay/shaders/motion_path_line_vert.glsl b/source/blender/draw/engines/overlay/shaders/motion_path_line_vert.glsl
index 6d7f673731e..7486f287a79 100644
--- a/source/blender/draw/engines/overlay/shaders/motion_path_line_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/motion_path_line_vert.glsl
@@ -32,7 +32,7 @@ void main()
 
   float intensity; /* how faint */
 
-  vec3 blend_base = (abs(frame - frameCurrent) == 1) ?
+  vec3 blend_base = (abs(frame - frameCurrent) == 0) ?
                         colorCurrentFrame.rgb :
                         colorBackground.rgb; /* "bleed" cframe color to ease color blending */
   bool use_custom_color = customColor.x >= 0.0;
@@ -78,13 +78,12 @@ void main()
     else {
       /* green - on frameCurrent */
       if (selected) {
-        intensity = 0.5f;
+        intensity = 0.92f;
       }
       else {
-        intensity = 0.99f;
+        intensity = 0.75f;
       }
-      finalColor_geom.rgb = clamp(
-          mix(colorCurrentFrame.rgb, colorBackground.rgb, intensity) - 0.1, 0.0, 0.1);
+      finalColor_geom.rgb = mix(colorBackground.rgb, blend_base, intensity);
     }
   }



More information about the Bf-blender-cvs mailing list