diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 09:06:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 10:03:28 +0300 |
commit | c7fecab2efd3b28a18b56dbd321616728d8b7cce (patch) | |
tree | 0169ab63925ce3d6730f519a4a54822e7f77c652 /source/blender/gpu/intern | |
parent | ef11113399e3273ee647b3710b346356a2b5f8f0 (diff) |
Object Mode: Use eval_ctx mode for drawing, paint & modifiers
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index f9cf3235ac1..301527d8fc5 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1460,6 +1460,7 @@ static struct GPUMaterialState { Material *gmatbuf_fixed[FIXEDMAT]; Material *gboundmat; Object *gob; + short gob_object_mode; DupliObject *dob; Scene *gscene; int glay; @@ -1554,7 +1555,7 @@ void GPU_end_dupli_object(void) void GPU_begin_object_materials( View3D *v3d, RegionView3D *rv3d, Scene *scene, ViewLayer *view_layer, Object *ob, - bool glsl, bool *do_alpha_after) + bool glsl, const short object_mode, bool *do_alpha_after) { Material *ma; GPUMaterial *gpumat; @@ -1592,7 +1593,7 @@ void GPU_begin_object_materials( #ifdef WITH_GAMEENGINE if (rv3d->rflag & RV3D_IS_GAME_ENGINE) { - ob = BKE_object_lod_matob_get(ob, view_layer); + ob = BKE_object_lod_matob_get(ob, view_layer, object_mode); } #else UNUSED_VARS(view_layer); @@ -1616,6 +1617,7 @@ void GPU_begin_object_materials( GMS.two_sided_lighting = (((Mesh *)ob->data)->flag & ME_TWOSIDED) != 0; GMS.gob = ob; + GMS.gob_object_mode = object_mode; GMS.gscene = scene; GMS.is_opensubdiv = use_opensubdiv; GMS.totmat = use_matcap ? 1 : ob->totcol + 1; /* materials start from 1, default material is 0 */ @@ -1834,7 +1836,7 @@ int GPU_object_material_bind(int nr, void *attribs) } GPU_material_bind( - gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT), + gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob_object_mode & OB_MODE_TEXTURE_PAINT), GMS.gviewmat, GMS.gviewinv, GMS.gviewcamtexcofac); auto_bump_scale = GMS.gob->derivedFinal != NULL ? GMS.gob->derivedFinal->auto_bump_scale : 1.0f; |