Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/draw/engines/eevee/eevee_effects.c9
-rw-r--r--source/blender/draw/intern/draw_manager_data.c7
2 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c
index cddef0c77d6..8e670da2ab7 100644
--- a/source/blender/draw/engines/eevee/eevee_effects.c
+++ b/source/blender/draw/engines/eevee/eevee_effects.c
@@ -352,12 +352,15 @@ void EEVEE_effects_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
DRW_shgroup_uniform_int_copy(grp, "size", 8);
DRW_shgroup_call(grp, quad, NULL);
- float mat[4][4];
- unit_m4(mat);
+ float viewmat[4][4], winmat[4][4];
+ unit_m4(viewmat);
+ unit_m4(winmat);
+ /* Winmat must be negative. */
+ swap_v3_v3(winmat[0], winmat[1]);
/* Using default view bypasses the culling. */
const DRWView *default_view = DRW_view_default_get();
- effects->checker_view = DRW_view_create_sub(default_view, mat, mat);
+ effects->checker_view = DRW_view_create_sub(default_view, viewmat, winmat);
}
}
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 5674ebd3a60..24f2670dd2d 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -1292,8 +1292,11 @@ static void draw_view_matrix_state_update(DRWViewUboStorage *storage,
const float winmat[4][4])
{
/* If only one the matrices is negative, then the
- * polygon winding changes and we don't want that. */
- BLI_assert(is_negative_m4(viewmat) != is_negative_m4(winmat));
+ * polygon winding changes and we don't want that.
+ * By convention, the winmat is negative because
+ * looking through the -Z axis. So this inverse the
+ * changes the test for the winmat. */
+ BLI_assert(is_negative_m4(viewmat) == !is_negative_m4(winmat));
copy_m4_m4(storage->viewmat, viewmat);
invert_m4_m4(storage->viewinv, storage->viewmat);