[Bf-blender-cvs] [4933dd716c1] blender2.8: Gizmo: Fix artifacts when having large angles

Jacques Lucke noreply at git.blender.org
Thu Oct 4 17:53:49 CEST 2018


Commit: 4933dd716c10e899257ea025e9dadf4967e68671
Author: Jacques Lucke
Date:   Thu Oct 4 17:53:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4933dd716c10e899257ea025e9dadf4967e68671

Gizmo: Fix artifacts when having large angles

Reviewer: brecht

Differential Revision: https://developer.blender.org/D3765

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

M	source/blender/gpu/intern/gpu_immediate_util.c

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

diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c
index 93695e0fbab..d0f0c3aacce 100644
--- a/source/blender/gpu/intern/gpu_immediate_util.c
+++ b/source/blender/gpu/intern/gpu_immediate_util.c
@@ -230,6 +230,10 @@ static void imm_draw_disk_partial(
         GPUPrimType prim_type, uint pos, float x, float y,
         float rad_inner, float rad_outer, int nsegments, float start, float sweep)
 {
+	/* to avoid artifacts */
+	const float max_angle = 3 * 360;
+	CLAMP(sweep, -max_angle, max_angle);
+
 	/* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */
 	const float angle_start = -(DEG2RADF(start)) + (float)(M_PI / 2);
 	const float angle_end   = -(DEG2RADF(sweep) - angle_start);



More information about the Bf-blender-cvs mailing list