[Bf-blender-cvs] [0a60c7d] master: Cycles: Fix missing camera-in-volume update when using certain render layers configurations

Sergey Sharybin noreply at git.blender.org
Thu May 14 16:09:02 CEST 2015


Commit: 0a60c7d8eebeda18a66229cf5f4de0f37d2522d2
Author: Sergey Sharybin
Date:   Thu May 14 19:08:13 2015 +0500
Branches: master
https://developer.blender.org/rB0a60c7d8eebeda18a66229cf5f4de0f37d2522d2

Cycles: Fix missing camera-in-volume update when using certain render layers configurations

===================================================================

M	intern/cycles/render/camera.cpp
M	intern/cycles/render/camera.h
M	intern/cycles/render/object.cpp
M	intern/cycles/render/shader.cpp

===================================================================

diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp
index 8a4eaf6..8950522 100644
--- a/intern/cycles/render/camera.cpp
+++ b/intern/cycles/render/camera.cpp
@@ -80,6 +80,7 @@ Camera::Camera()
 
 	need_update = true;
 	need_device_update = true;
+	need_flags_update = true;
 	previous_need_motion = -1;
 }
 
@@ -171,6 +172,7 @@ void Camera::update()
 
 	need_update = false;
 	need_device_update = true;
+	need_flags_update = true;
 }
 
 void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
@@ -288,7 +290,7 @@ void Camera::device_update_volume(Device * /*device*/,
                                   DeviceScene *dscene,
                                   Scene *scene)
 {
-	if(!need_device_update) {
+	if(!need_device_update && !need_flags_update) {
 		return;
 	}
 	KernelCamera *kcam = &dscene->data.cam;
@@ -304,6 +306,7 @@ void Camera::device_update_volume(Device * /*device*/,
 		}
 	}
 	need_device_update = false;
+	need_flags_update = false;
 }
 
 void Camera::device_free(Device * /*device*/, DeviceScene * /*dscene*/)
diff --git a/intern/cycles/render/camera.h b/intern/cycles/render/camera.h
index 00387bc..3efbe90 100644
--- a/intern/cycles/render/camera.h
+++ b/intern/cycles/render/camera.h
@@ -105,6 +105,7 @@ public:
 	/* update */
 	bool need_update;
 	bool need_device_update;
+	bool need_flags_update;
 	int previous_need_motion;
 
 	/* functions */
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index 6650b42..da9bc23 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include "camera.h"
 #include "device.h"
 #include "light.h"
 #include "mesh.h"
@@ -192,6 +193,7 @@ void Object::tag_update(Scene *scene)
 		}
 	}
 
+	scene->camera->need_flags_update = true;
 	scene->curve_system_manager->need_update = true;
 	scene->mesh_manager->need_update = true;
 	scene->object_manager->need_update = true;
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index 2eaba3f..6672793 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -15,6 +15,7 @@
  */
 
 #include "background.h"
+#include "camera.h"
 #include "device.h"
 #include "graph.h"
 #include "light.h"




More information about the Bf-blender-cvs mailing list