[Bf-blender-cvs] [3fc7d51ed3d] master: Viewport: Fix stereoscopy volume "wires" not showing

Dalai Felinto noreply at git.blender.org
Wed Mar 6 14:59:43 CET 2019


Commit: 3fc7d51ed3d3e42a67a07a7be686907358fcd872
Author: Dalai Felinto
Date:   Wed Mar 6 10:07:51 2019 -0300
Branches: master
https://developer.blender.org/rB3fc7d51ed3d3e42a67a07a7be686907358fcd872

Viewport: Fix stereoscopy volume "wires" not showing

This is unreported. When using volume opacity 0.0, the wires were not visible
(nor were they in other cases, but this was the most obvious one).

The volume itself is still glitchy, and slightly worse than 2.79. I
still don't know how to fix this though. It seems a common problem
(see T62262).

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

M	source/blender/draw/modes/object_mode.c

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

diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 0fa4d328ebd..e5a98d4227b 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1790,7 +1790,7 @@ static void camera_stereo3d(
 		static float one = 1.0f;
 		float color_volume[3][4] = {{0.0f, 1.0f, 1.0f, v3d->stereo3d_volume_alpha},
 		                            {1.0f, 0.0f, 0.0f, v3d->stereo3d_volume_alpha},
-		                            {0.0f, 0.0f, 0.0f, 0.0f}};
+		                            {0.0f, 0.0f, 0.0f, 1.0f}};
 
 		for (int eye = 0; eye < 2; eye++) {
 			float winmat[4][4], viewinv[4][4], viewmat[4][4], persmat[4][4], persinv[4][4];
@@ -1803,7 +1803,9 @@ static void camera_stereo3d(
 			mul_m4_m4m4(persmat, winmat, viewmat);
 			invert_m4_m4(persinv, persmat);
 
-			DRW_shgroup_call_dynamic_add(sgl->camera_stereo_volume, color_volume[eye], &one, persinv);
+			if (v3d->stereo3d_volume_alpha > 0.0f) {
+				DRW_shgroup_call_dynamic_add(sgl->camera_stereo_volume, color_volume[eye], &one, persinv);
+			}
 			DRW_shgroup_call_dynamic_add(sgl->camera_stereo_volume_wires, color_volume[2], &one, persinv);
 		}
 	}



More information about the Bf-blender-cvs mailing list