diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index fd7f205214e..0f95107c018 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1736,11 +1736,13 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr) } /* environment lighting */ - if (!(mat->scene->gm.flag & GAME_GLSL_NO_ENV_LIGHTING) && (world->mode & WO_ENV_LIGHT) && (mat->scene->r.mode & R_SHADOW) && - !BKE_scene_use_new_shading_nodes(mat->scene)) + if (!(mat->scene->gm.flag & GAME_GLSL_NO_ENV_LIGHTING) && + (world->mode & WO_ENV_LIGHT) && + (mat->scene->r.mode & R_SHADOW) && + !BKE_scene_use_new_shading_nodes(mat->scene)) { if ((world->ao_env_energy != 0.0f) && (GPU_link_changed(shi->amb) || ma->amb != 0.0f) && - (GPU_link_changed(shi->refl) || ma->ref != 0.0f)) + (GPU_link_changed(shi->refl) || ma->ref != 0.0f)) { if (world->aocolor != WO_AOPLAIN) { if (!(is_zero_v3(&world->horr) & is_zero_v3(&world->zenr))) @@ -1749,8 +1751,10 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr) GPU_link(mat, "math_multiply", shi->amb, shi->refl, &f); GPU_link(mat, "math_multiply", f, GPU_uniform(&world->ao_env_energy), &f); GPU_link(mat, "shade_mul_value", f, shi->rgb, &fcol); - GPU_link(mat, "env_apply", shr->combined, GPU_dynamic_uniform(GPUWorld.horicol, GPU_DYNAMIC_HORIZON_COLOR, NULL), - GPU_dynamic_uniform(GPUWorld.zencol, GPU_DYNAMIC_ZENITH_COLOR, NULL), fcol, GPU_builtin(GPU_VIEW_MATRIX), shi->vn, &shr->combined); + GPU_link(mat, "env_apply", shr->combined, + GPU_dynamic_uniform(GPUWorld.horicol, GPU_DYNAMIC_HORIZON_COLOR, NULL), + GPU_dynamic_uniform(GPUWorld.zencol, GPU_DYNAMIC_ZENITH_COLOR, NULL), fcol, + GPU_builtin(GPU_VIEW_MATRIX), shi->vn, &shr->combined); } } else { @@ -2585,7 +2589,7 @@ int GPU_lamp_shadow_bind_code(GPULamp *lamp) float *GPU_lamp_dynpersmat(GPULamp *lamp) { - return (float*)lamp->dynpersmat; + return &lamp->dynpersmat[0][0]; } int GPU_lamp_shadow_layer(GPULamp *lamp) |