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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-25 22:07:44 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-25 22:46:23 +0300
commit171c4e982f7b6c93b534a48cfe8aba73dec78030 (patch)
tree5be791cde024a371a3131880b4ba4ceee55e4604 /intern/cycles/blender
parent8988f383c1fb690bde976cc6de4438b327186203 (diff)
Cycles: use AO factor to let user adjust intensity of AO bounces.
We are already using the AO distance, so might as well offer this extra control over the intensity. Useful when an interior scene is supposed to be significantly darker than the background shader.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r--intern/cycles/blender/blender_shader.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index bdbab1006c0..cd6c9f319db 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -1289,11 +1289,8 @@ void BlenderSync::sync_world(bool update_all)
/* AO */
BL::WorldLighting b_light = b_world.light_settings();
- if(b_light.use_ambient_occlusion())
- background->ao_factor = b_light.ao_factor();
- else
- background->ao_factor = 0.0f;
-
+ background->use_ao = b_light.use_ambient_occlusion();
+ background->ao_factor = b_light.ao_factor();
background->ao_distance = b_light.distance();
/* visibility */
@@ -1309,6 +1306,7 @@ void BlenderSync::sync_world(bool update_all)
background->visibility = visibility;
}
else {
+ background->use_ao = false;
background->ao_factor = 0.0f;
background->ao_distance = FLT_MAX;
}
@@ -1330,7 +1328,7 @@ void BlenderSync::sync_world(bool update_all)
background->transparent = b_scene.render().alpha_mode() == BL::RenderSettings::alpha_mode_TRANSPARENT;
background->use_shader = render_layer.use_background_shader;
- background->use_ao = render_layer.use_background_ao;
+ background->use_ao = background->use_ao && render_layer.use_background_ao;
if(background->modified(prevbackground))
background->tag_update(scene);