Fix T39114: cycles lamp ray visibility not working.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 12 Mar 2014 17:20:42 +0000 (18:20 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 12 Mar 2014 17:21:23 +0000 (18:21 +0100)
Thanks to Thomas for finding the cause.

intern/cycles/render/scene.cpp

index 71f5a9dafed7a4454558847c71e3babbbc045d86..daf22d90978c3b94adfec95c57a3e0532f015639 100644 (file)
@@ -137,6 +137,8 @@ void Scene::device_update(Device *device_, Progress& progress)
         * - Camera may be used for adapative subdivison.
         * - Displacement shader must have all shader data available.
         * - Light manager needs lookup tables and final mesh data to compute emission CDF.
+        * - Film needs light manager to run for use_light_visibility
+        * - Lookup tables are done a second time to handle film tables
         */
        
        image_manager->set_pack_images(device->info.pack_images);
@@ -171,11 +173,6 @@ void Scene::device_update(Device *device_, Progress& progress)
 
        if(progress.get_cancel()) return;
 
-       progress.set_status("Updating Film");
-       film->device_update(device, &dscene, this);
-
-       if(progress.get_cancel()) return;
-
        progress.set_status("Updating Lookup Tables");
        lookup_tables->device_update(device, &dscene);
 
@@ -196,11 +193,21 @@ void Scene::device_update(Device *device_, Progress& progress)
 
        if(progress.get_cancel()) return;
 
+       progress.set_status("Updating Film");
+       film->device_update(device, &dscene, this);
+
+       if(progress.get_cancel()) return;
+
        progress.set_status("Updating Integrator");
        integrator->device_update(device, &dscene, this);
 
        if(progress.get_cancel()) return;
 
+       progress.set_status("Updating Lookup Tables");
+       lookup_tables->device_update(device, &dscene);
+
+       if(progress.get_cancel()) return;
+
        progress.set_status("Updating Device", "Writing constant memory");
        device->const_copy_to("__data", &dscene.data, sizeof(dscene.data));
 }