[Bf-blender-cvs] [85221f6fa73] blender2.8: Fix Eevee shadows not working in certain cases, after recent WM changes.

Brecht Van Lommel noreply at git.blender.org
Mon Apr 30 13:52:45 CEST 2018


Commit: 85221f6fa738cfdf23695b3927b718bbc348ec09
Author: Brecht Van Lommel
Date:   Mon Apr 30 13:49:07 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB85221f6fa738cfdf23695b3927b718bbc348ec09

Fix Eevee shadows not working in certain cases, after recent WM changes.

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

M	source/blender/windowmanager/intern/wm_draw.c

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

diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 685e6f7e216..55e7ce4a1d8 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -363,14 +363,14 @@ static void wm_draw_region_bind(ARegion *ar, int view)
 	}
 	else {
 		GPU_offscreen_bind(ar->draw_buffer->offscreen[view], false);
+
+		/* For now scissor is expected by region drawing, we could disable it
+		 * and do the enable/disable in the specific cases that setup scissor. */
+		glEnable(GL_SCISSOR_TEST);
+		glScissor(0, 0, ar->winx, ar->winy);
 	}
 
 	ar->draw_buffer->bound_view = view;
-
-	/* For now scissor is expected by region drawing, we could disable it
-	 * and do the enable/disable in the specific cases that setup scissor. */
-	glEnable(GL_SCISSOR_TEST);
-	glScissor(0, 0, ar->winx, ar->winy);
 }
 
 static void wm_draw_region_unbind(ARegion *ar, int view)
@@ -379,14 +379,13 @@ static void wm_draw_region_unbind(ARegion *ar, int view)
 		return;
 	}
 
-	glDisable(GL_SCISSOR_TEST);
-
 	ar->draw_buffer->bound_view = -1;
 
 	if (ar->draw_buffer->viewport[view]) {
 		GPU_viewport_unbind(ar->draw_buffer->viewport[view]);
 	}
 	else {
+		glDisable(GL_SCISSOR_TEST);
 		GPU_offscreen_unbind(ar->draw_buffer->offscreen[view], false);
 	}
 }



More information about the Bf-blender-cvs mailing list