From 3fc7d51ed3d3e42a67a07a7be686907358fcd872 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 6 Mar 2019 10:07:51 -0300 Subject: [PATCH] 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). --- source/blender/draw/modes/object_mode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } }