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:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-11-27 16:08:35 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-11-27 16:08:35 +0300
commit408515810e99d40a6dd53c3d50f1e4be7eb52c87 (patch)
tree0aaf16e6011b472bb3b12d92c996268b58ec3080 /source/blender/editors/space_view3d/view3d_draw.c
parent3bd6c8bfa256793170a21130d398c16da1192473 (diff)
parent9b42b3e11462e96bf24970971ab181122c6b33df (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 4bc4c373df4..8024a733f40 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1611,7 +1611,6 @@ static void view3d_draw_grease_pencil(const bContext *UNUSED(C))
/* TODO viewport */
}
-
/**
* Viewport Name
*/
@@ -2084,13 +2083,15 @@ void ED_view3d_draw_offscreen(
ImBuf *ED_view3d_draw_offscreen_imbuf(
const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer,
View3D *v3d, ARegion *ar, int sizex, int sizey,
- unsigned int flag, bool draw_background,
- int alpha_mode, int samples, bool full_samples, const char *viewname,
+ unsigned int flag, unsigned int draw_flags,
+ int alpha_mode, int samples, const char *viewname,
/* output vars */
GPUFX *fx, GPUOffScreen *ofs, char err_out[256])
{
RegionView3D *rv3d = ar->regiondata;
const bool draw_sky = (alpha_mode == R_ADDSKY);
+ const bool draw_background = (draw_flags & V3D_OFSDRAW_USE_BACKGROUND);
+ const bool use_full_sample = (draw_flags & V3D_OFSDRAW_USE_FULL_SAMPLE);
/* view state */
GPUFXSettings fx_settings = v3d->fx_settings;
@@ -2106,7 +2107,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
if (own_ofs) {
/* bind */
- ofs = GPU_offscreen_create(sizex, sizey, full_samples ? 0 : samples, err_out);
+ ofs = GPU_offscreen_create(sizex, sizey, use_full_sample ? 0 : samples, err_out);
if (ofs == NULL) {
return NULL;
}
@@ -2151,7 +2152,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
}
}
- if ((samples && full_samples) == 0) {
+ if ((samples && use_full_sample) == 0) {
/* Single-pass render, common case */
ED_view3d_draw_offscreen(
eval_ctx, scene, view_layer, v3d, ar, sizex, sizey, NULL, winmat,
@@ -2250,8 +2251,8 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(
const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer,
Object *camera, int width, int height,
- unsigned int flag, int drawtype, bool use_solid_tex, bool use_gpencil, bool draw_background,
- int alpha_mode, int samples, bool full_samples, const char *viewname,
+ unsigned int flag, unsigned int draw_flags, int drawtype,
+ int alpha_mode, int samples, const char *viewname,
GPUFX *fx, GPUOffScreen *ofs, char err_out[256])
{
View3D v3d = {NULL};
@@ -2268,14 +2269,21 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(
v3d.drawtype = drawtype;
v3d.flag2 = V3D_RENDER_OVERRIDE;
- if (use_gpencil)
+ if (draw_flags & V3D_OFSDRAW_USE_GPENCIL) {
v3d.flag2 |= V3D_SHOW_GPENCIL;
-
- if (use_solid_tex)
+ }
+ if (draw_flags & V3D_OFSDRAW_USE_SOLID_TEX) {
v3d.flag2 |= V3D_SOLID_TEX;
-
- if (draw_background)
+ }
+ if (draw_flags & V3D_OFSDRAW_USE_BACKGROUND) {
v3d.flag3 |= V3D_SHOW_WORLD;
+ }
+ if (draw_flags & V3D_OFSDRAW_USE_CAMERA_DOF) {
+ if (camera->type == OB_CAMERA) {
+ v3d.fx_settings.dof = &((Camera *)camera->data)->gpu_dof;
+ v3d.fx_settings.fx_flag |= GPU_FX_FLAG_DOF;
+ }
+ }
rv3d.persp = RV3D_CAMOB;
@@ -2304,8 +2312,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(
return ED_view3d_draw_offscreen_imbuf(
eval_ctx, scene, view_layer, &v3d, &ar, width, height, flag,
- draw_background, alpha_mode, samples, full_samples, viewname,
- fx, ofs, err_out);
+ draw_flags, alpha_mode, samples, viewname, fx, ofs, err_out);
}
/** \} */