[Bf-blender-cvs] [fa09b900c2f] master: Fix T74625 GPencil: Airbrush doesn't paint anything

Clément Foucault noreply at git.blender.org
Tue Mar 10 18:11:29 CET 2020


Commit: fa09b900c2fe087bc2e0aae4ca5ef88c51686e80
Author: Clément Foucault
Date:   Tue Mar 10 18:11:20 2020 +0100
Branches: master
https://developer.blender.org/rBfa09b900c2fe087bc2e0aae4ca5ef88c51686e80

Fix T74625 GPencil: Airbrush doesn't paint anything

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

M	source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl

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

diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
index cba5a1f80af..93c9fdcecb3 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -442,7 +442,7 @@ void stroke_vertex()
 
     /* Rotation: Encoded as Cos + Sin sign. */
     float uv_rot = decode_uvrot(uvrot1);
-    float rot_sin = sqrt(1.0 - uv_rot * uv_rot) * sign(uv_rot);
+    float rot_sin = sqrt(max(0.0, 1.0 - uv_rot * uv_rot)) * sign(uv_rot);
     float rot_cos = abs(uv_rot);
     x_axis = mat2(rot_cos, -rot_sin, rot_sin, rot_cos) * x_axis;



More information about the Bf-blender-cvs mailing list