Bug fix, irc submitted:
3D Viewport render (internal) didn't render bump maps (it was black even).
This commit is contained in:
@@ -215,7 +215,7 @@ void ED_view3d_unproject(struct bglMats *mats, float out[3], const float x, cons
|
||||
bool ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d,
|
||||
float *r_clipsta, float *r_clipend, const bool use_ortho_factor);
|
||||
bool ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi,
|
||||
struct rctf *r_viewplane, float *r_clipsta, float *r_clipend);
|
||||
struct rctf *r_viewplane, float *r_clipsta, float *r_clipend, float *r_pixsize);
|
||||
void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar,
|
||||
struct View3D *v3d, struct RegionView3D *rv3d,
|
||||
struct rctf *r_viewborder, const bool no_shift);
|
||||
|
||||
@@ -760,12 +760,12 @@ static int render_view3d_disprect(Scene *scene, ARegion *ar, View3D *v3d, Region
|
||||
|
||||
/* returns true if OK */
|
||||
static bool render_view3d_get_rects(ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewplane, RenderEngine *engine,
|
||||
float *r_clipsta, float *r_clipend, bool *r_ortho)
|
||||
float *r_clipsta, float *r_clipend, float *r_pixsize, bool *r_ortho)
|
||||
{
|
||||
|
||||
if (ar->winx < 4 || ar->winy < 4) return false;
|
||||
|
||||
*r_ortho = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, viewplane, r_clipsta, r_clipend);
|
||||
*r_ortho = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, viewplane, r_clipsta, r_clipend, r_pixsize);
|
||||
|
||||
engine->resolution_x = ar->winx;
|
||||
engine->resolution_y = ar->winy;
|
||||
@@ -819,13 +819,13 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda
|
||||
RenderData rdata;
|
||||
rctf viewplane;
|
||||
rcti cliprct;
|
||||
float clipsta, clipend;
|
||||
float clipsta, clipend, pixsize;
|
||||
bool orth, restore = 0;
|
||||
char name[32];
|
||||
|
||||
G.is_break = FALSE;
|
||||
|
||||
if (false == render_view3d_get_rects(rp->ar, rp->v3d, rp->rv3d, &viewplane, rp->engine, &clipsta, &clipend, &orth))
|
||||
if (false == render_view3d_get_rects(rp->ar, rp->v3d, rp->rv3d, &viewplane, rp->engine, &clipsta, &clipend, &pixsize, &orth))
|
||||
return;
|
||||
|
||||
rp->stop = stop;
|
||||
@@ -875,6 +875,8 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda
|
||||
else
|
||||
RE_SetWindow(re, &viewplane, clipsta, clipend);
|
||||
|
||||
RE_SetPixelSize(re, pixsize);
|
||||
|
||||
/* database free can crash on a empty Render... */
|
||||
if (rp->keep_data == 0 && rstats->convertdone)
|
||||
RE_Database_Free(re);
|
||||
@@ -1002,7 +1004,7 @@ static int render_view3d_changed(RenderEngine *engine, const bContext *C)
|
||||
update |= PR_UPDATE_VIEW;
|
||||
}
|
||||
|
||||
render_view3d_get_rects(ar, v3d, rv3d, &viewplane, engine, &clipsta, &clipend, &orth);
|
||||
render_view3d_get_rects(ar, v3d, rv3d, &viewplane, engine, &clipsta, &clipend, NULL, &orth);
|
||||
RE_GetViewPlane(re, &viewplane1, &disprect1);
|
||||
|
||||
if (BLI_rctf_compare(&viewplane, &viewplane1, 0.00001f) == 0)
|
||||
|
||||
@@ -191,7 +191,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
|
||||
rctf viewplane;
|
||||
float clipsta, clipend;
|
||||
|
||||
int is_ortho = ED_view3d_viewplane_get(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend);
|
||||
int is_ortho = ED_view3d_viewplane_get(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL);
|
||||
if (is_ortho) orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
|
||||
else perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
|
||||
}
|
||||
|
||||
@@ -4935,7 +4935,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
|
||||
|
||||
BKE_paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT);
|
||||
|
||||
paint_cursor_start(C, sculpt_poll);
|
||||
paint_cursor_start(C, sculpt_mode_poll_view3d);
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
|
||||
|
||||
@@ -688,7 +688,7 @@ bool ED_view3d_clip_range_get(View3D *v3d, RegionView3D *rv3d, float *r_clipsta,
|
||||
|
||||
/* also exposed in previewrender.c */
|
||||
bool ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winx, int winy,
|
||||
rctf *r_viewplane, float *r_clipsta, float *r_clipend)
|
||||
rctf *r_viewplane, float *r_clipsta, float *r_clipend, float *r_pixsize)
|
||||
{
|
||||
CameraParams params;
|
||||
|
||||
@@ -699,6 +699,7 @@ bool ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winx, int winy
|
||||
if (r_viewplane) *r_viewplane = params.viewplane;
|
||||
if (r_clipsta) *r_clipsta = params.clipsta;
|
||||
if (r_clipend) *r_clipend = params.clipend;
|
||||
if (r_pixsize) *r_pixsize = params.viewdx;
|
||||
|
||||
return params.is_ortho;
|
||||
}
|
||||
@@ -713,7 +714,7 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect)
|
||||
float clipsta, clipend, x1, y1, x2, y2;
|
||||
int orth;
|
||||
|
||||
orth = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend);
|
||||
orth = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL);
|
||||
rv3d->is_persp = !orth;
|
||||
|
||||
#if 0
|
||||
|
||||
Reference in New Issue
Block a user