Fixup for multi-view single eye viewport issues

In d2f1f80a6f I was always calling view3d_main_regio_setup_view with
NULL matrices, which is not always correct.
This commit is contained in:
Dalai Felinto 2017-05-10 13:13:55 +02:00
parent d2f1f80a6f
commit 195d0fbae3
Notes: blender-bot 2023-02-14 06:45:16 +01:00
Referenced by commit b5a976ec19, Fix GPencil depth checks
Referenced by commit 4badf67739, Fix T51629: Select w/ object lock fails
Referenced by issue #52180, New changes in Bevel modifier messed up particles hair distributions
2 changed files with 9 additions and 6 deletions

View File

@ -356,7 +356,9 @@ void ED_view3d_draw_offscreen(
float winmat[4][4], bool do_bgpic, bool do_sky, bool is_persp, const char *viewname,
struct GPUFX *fx, struct GPUFXSettings *fx_settings,
struct GPUOffScreen *ofs);
void ED_view3d_draw_setup_view(struct wmWindow *win, struct Scene *scene, struct ARegion *ar, struct View3D *v3d);
void ED_view3d_draw_setup_view(
struct wmWindow *win, struct Scene *scene, struct ARegion *ar, struct View3D *v3d,
float viewmat[4][4], float winmat[4][4]);
struct ImBuf *ED_view3d_draw_offscreen_imbuf(
struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey,

View File

@ -2370,9 +2370,10 @@ float view3d_depth_near(ViewDepths *d)
void ED_view3d_draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d)
{
short zbuf = v3d->zbuf;
RegionView3D *rv3d = ar->regiondata;
/* Setup view matrix. */
ED_view3d_draw_setup_view(NULL, scene, ar, v3d);
ED_view3d_draw_setup_view(NULL, scene, ar, v3d, rv3d->winmat, rv3d->viewmat);
glClear(GL_DEPTH_BUFFER_BIT);
@ -2483,7 +2484,7 @@ void ED_view3d_draw_depth(Scene *scene, ARegion *ar, View3D *v3d, bool alphaover
U.obcenter_dia = 0;
/* Setup view matrix. */
ED_view3d_draw_setup_view(NULL, scene, ar, v3d);
ED_view3d_draw_setup_view(NULL, scene, ar, v3d, rv3d->viewmat, rv3d->winmat);
glClear(GL_DEPTH_BUFFER_BIT);
@ -3254,7 +3255,7 @@ void ED_view3d_draw_offscreen(
/**
* Set the correct matrices
*/
void ED_view3d_draw_setup_view(wmWindow *win, Scene *scene, ARegion *ar, View3D *v3d)
void ED_view3d_draw_setup_view(wmWindow *win, Scene *scene, ARegion *ar, View3D *v3d, float viewmat[4][4], float winmat[4][4])
{
RegionView3D *rv3d = ar->regiondata;
@ -3263,7 +3264,7 @@ void ED_view3d_draw_setup_view(wmWindow *win, Scene *scene, ARegion *ar, View3D
view3d_stereo3d_setup(scene, v3d, ar);
}
else {
view3d_main_region_setup_view(scene, v3d, ar, NULL, NULL);
view3d_main_region_setup_view(scene, v3d, ar, viewmat, winmat);
}
}
@ -3845,7 +3846,7 @@ static void view3d_main_region_draw_objects(const bContext *C, Scene *scene, Vie
}
/* Setup the view matrix. */
ED_view3d_draw_setup_view(CTX_wm_window(C), scene, ar, v3d);
ED_view3d_draw_setup_view(CTX_wm_window(C), scene, ar, v3d, NULL, NULL);
rv3d->rflag &= ~RV3D_IS_GAME_ENGINE;
#ifdef WITH_GAMEENGINE