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@pandora.be>2012-02-28 20:45:08 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-02-28 20:45:08 +0400
commit22abc63f676dc7681ee8f734cbc96a7279172d24 (patch)
tree8f945d2a9db54869802aa5eb24c975488c99edd1 /intern/cycles/blender/blender_shader.cpp
parent6cb896ff0a7d24be3ff500585642ae5d61a5b788 (diff)
Cycles: ambient occlusion support, with AO factor and distance, and a render pass.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/World#Ambient_Occlusion http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes#Lighting_Passes
Diffstat (limited to 'intern/cycles/blender/blender_shader.cpp')
-rw-r--r--intern/cycles/blender/blender_shader.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 5310e35dc25..a88bcaf3ace 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -696,6 +696,20 @@ void BlenderSync::sync_world()
graph->connect(closure->output("Background"), out->input("Surface"));
}
+ /* AO */
+ if(b_world) {
+ BL::WorldLighting b_light = b_world.light_settings();
+
+ if(b_light.use_ambient_occlusion()) {
+ background->ao_factor = b_light.ao_factor();
+ background->ao_distance = b_light.distance();
+ }
+ else {
+ background->ao_factor = 0.0f;
+ background->ao_distance = 0.0f;
+ }
+ }
+
shader->set_graph(graph);
shader->tag_update(scene);
}