[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49579] branches/soc-2011-tomato/intern/ cycles/render: Tomato Cycles: fix for vector pass gives wrong result in some circumstances

Sergey Sharybin sergey.vfx at gmail.com
Sun Aug 5 19:24:11 CEST 2012


Revision: 49579
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49579
Author:   nazgul
Date:     2012-08-05 17:24:10 +0000 (Sun, 05 Aug 2012)
Log Message:
-----------
Tomato Cycles: fix for vector pass gives wrong result in some circumstances

Issue was caused by wrong camera motion stored in device in cases
when first render layer does not have vector pass enabled.

Solved by forcing device camera update in cases when scene's motion
changed since previous device camera update.

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/cycles/render/camera.cpp
    branches/soc-2011-tomato/intern/cycles/render/camera.h

Modified: branches/soc-2011-tomato/intern/cycles/render/camera.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/camera.cpp	2012-08-05 15:04:10 UTC (rev 49578)
+++ branches/soc-2011-tomato/intern/cycles/render/camera.cpp	2012-08-05 17:24:10 UTC (rev 49579)
@@ -75,6 +75,7 @@
 
 	need_update = true;
 	need_device_update = true;
+	previous_motion = -1;
 }
 
 Camera::~Camera()
@@ -140,8 +141,19 @@
 
 void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
 {
+	Scene::MotionType need_motion = scene->need_motion();
+
 	update();
 
+	if (previous_motion != need_motion) {
+		/* scene's motion model could have been changed since
+		 * previous device camera update
+		 * this could happen for example in case when one render
+		 * layer has got motion pass and another not
+		 */
+		need_device_update = true;
+	}
+
 	if(!need_device_update)
 		return;
 	
@@ -159,7 +171,6 @@
 	kcam->worldtocamera = transform_inverse(cameratoworld);
 
 	/* camera motion */
-	Scene::MotionType need_motion = scene->need_motion();
 	kcam->have_motion = 0;
 
 	if(need_motion == Scene::MOTION_PASS) {
@@ -226,6 +237,7 @@
 	kcam->cliplength = (farclip == FLT_MAX)? FLT_MAX: farclip - nearclip;
 
 	need_device_update = false;
+	previous_motion = need_motion;
 }
 
 void Camera::device_free(Device *device, DeviceScene *dscene)

Modified: branches/soc-2011-tomato/intern/cycles/render/camera.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/camera.h	2012-08-05 15:04:10 UTC (rev 49578)
+++ branches/soc-2011-tomato/intern/cycles/render/camera.h	2012-08-05 17:24:10 UTC (rev 49579)
@@ -91,6 +91,7 @@
 	/* update */
 	bool need_update;
 	bool need_device_update;
+	int previous_motion;
 
 	/* functions */
 	Camera();




More information about the Bf-blender-cvs mailing list