Cycles: fix AO pass not rendering with AO enabled for world, and make mask
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 28 Feb 2012 19:43:33 +0000 (19:43 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 28 Feb 2012 19:43:33 +0000 (19:43 +0000)
layers work more like blender internal.

intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_shader.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/render/background.cpp
intern/cycles/render/film.cpp
intern/cycles/render/scene.cpp

index faf057e13cc63eaaf94d16c0ea91c30eabba9992..9eb8f251ebbf2dec415d219ac6bcaca7101788d5 100644 (file)
@@ -179,6 +179,7 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
         col.prop(scene, "layers", text="Scene")
         col.label(text="Material:")
         col.prop(rl, "material_override", text="")
+        col.prop(rl, "use_zmask");
 
         col = split.column()
         col.prop(rl, "layers", text="Layer")
index a88bcaf3ace1b46c1d9f059956a960eead9449e9..415a043cf78aa1a424965328d6d58bc7897a6aee 100644 (file)
@@ -700,14 +700,12 @@ void BlenderSync::sync_world()
                if(b_world) {
                        BL::WorldLighting b_light = b_world.light_settings();
 
-                       if(b_light.use_ambient_occlusion()) {
+                       if(b_light.use_ambient_occlusion())
                                background->ao_factor = b_light.ao_factor();
-                               background->ao_distance = b_light.distance();
-                       }
-                       else {
+                       else
                                background->ao_factor = 0.0f;
-                               background->ao_distance = 0.0f;
-                       }
+
+                       background->ao_distance = b_light.distance();
                }
 
                shader->set_graph(graph);
index 901b1a09f9729bba69f627fb5c67d44b4e003f82..45ed7adcfdc8460e3020be05628eb06a357a511a 100644 (file)
@@ -204,7 +204,8 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
                                render_layer.name = b_rlay->name();
                                render_layer.scene_layer = get_layer(b_scene.layers());
                                render_layer.layer = get_layer(b_rlay->layers());
-                               render_layer.holdout_layer = get_layer(b_rlay->layers_zmask());
+                               render_layer.holdout_layer = (b_rlay->use_zmask())? ~get_layer(b_rlay->layers_zmask()): 0;
+                               render_layer.layer |= render_layer.holdout_layer;
                                render_layer.material_override = b_rlay->material_override();
                        }
 
index c5b003fe6c586b259548cbfeb9849dd8ccdb8431..919bd83f1957f504a61668fcd213aac94eee5cbb 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "background.h"
 #include "device.h"
+#include "integrator.h"
 #include "graph.h"
 #include "nodes.h"
 #include "scene.h"
@@ -74,6 +75,7 @@ bool Background::modified(const Background& background)
 
 void Background::tag_update(Scene *scene)
 {
+       scene->integrator->tag_update(scene);
        need_update = true;
 }
 
index daadb6c04c8de21b60724a231c54277a10209c3a..3fb1e385adcc15d4180d2a3693ea7e20242f268a 100644 (file)
@@ -19,6 +19,7 @@
 #include "camera.h"
 #include "device.h"
 #include "film.h"
+#include "integrator.h"
 #include "scene.h"
 
 #include "util_algorithm.h"
@@ -255,6 +256,7 @@ bool Film::modified(const Film& film)
 
 void Film::tag_update(Scene *scene)
 {
+       scene->integrator->tag_update(scene);
        need_update = true;
 }
 
index 0b2e2b8a9b6afb3fc68b3238b19ba065066a5d73..079f2744e730d621218e6acba0eefb08c2ac9e5f 100644 (file)
@@ -152,13 +152,13 @@ void Scene::device_update(Device *device_, Progress& progress)
 
        if(progress.get_cancel()) return;
 
-       progress.set_status("Updating Integrator");
-       integrator->device_update(device, &dscene);
+       progress.set_status("Updating Film");
+       film->device_update(device, &dscene);
 
        if(progress.get_cancel()) return;
 
-       progress.set_status("Updating Film");
-       film->device_update(device, &dscene);
+       progress.set_status("Updating Integrator");
+       integrator->device_update(device, &dscene);
 
        if(progress.get_cancel()) return;