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:
authorIRIE Shinsuke <irieshinsuke@yahoo.co.jp>2014-05-29 09:53:33 +0400
committerIRIE Shinsuke <irieshinsuke@yahoo.co.jp>2014-05-30 03:22:44 +0400
commit54e054cce4b013bc70df56059bf0fcd4bfee9827 (patch)
tree41f5de11763ed0de0e54a5c190b5fe404865d0e1 /source/blender/gpu/intern/gpu_draw.c
parent53424ec0ff664829ff4973a013f605d342838d21 (diff)
Followup to rB1973b17fce65, partially bring back GLSL lamp's previous behavior.
Using layer visibility in active render layer makes more accurate preview but can cause problems in some cases: https://developer.blender.org/rB1973b17fce65a4dfececb45b19abec37898c1ab5#comment-1 GLSL lamps now ignore layer visibility if lock_camera_and_layers is OFF or game engine is running. The material lamp group still works unconditionally though.
Diffstat (limited to 'source/blender/gpu/intern/gpu_draw.c')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 1051ce590f4..68b8492926b 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1375,6 +1375,7 @@ static struct GPUMaterialState {
Object *gob;
Scene *gscene;
int glay;
+ bool gscenelock;
float (*gviewmat)[4];
float (*gviewinv)[4];
@@ -1463,6 +1464,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
GMS.gscene = scene;
GMS.totmat = use_matcap ? 1 : ob->totcol + 1; /* materials start from 1, default material is 0 */
GMS.glay= (v3d->localvd)? v3d->localvd->lay: v3d->lay; /* keep lamps visible in local view */
+ GMS.gscenelock = (v3d->scenelock != 0);
GMS.gviewmat= rv3d->viewmat;
GMS.gviewinv= rv3d->viewinv;
@@ -1623,7 +1625,7 @@ int GPU_enable_material(int nr, void *attribs)
gpumat = GPU_material_from_blender(GMS.gscene, mat);
GPU_material_vertex_attributes(gpumat, gattribs);
- GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT), GMS.gviewmat, GMS.gviewinv);
+ GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT), GMS.gviewmat, GMS.gviewinv, GMS.gscenelock);
auto_bump_scale = GMS.gob->derivedFinal != NULL ? GMS.gob->derivedFinal->auto_bump_scale : 1.0f;
GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gob->col, auto_bump_scale);