[Bf-blender-cvs] [ceb03a4] master: Cycles: Fix wrong projection coordinates for points behind the camera

Sergey Sharybin noreply at git.blender.org
Fri Jul 29 17:30:40 CEST 2016


Commit: ceb03a4d323ebe40e9d3bd3107ea1e7ffb22c02b
Author: Sergey Sharybin
Date:   Fri Jul 29 17:28:36 2016 +0200
Branches: master
https://developer.blender.org/rBceb03a4d323ebe40e9d3bd3107ea1e7ffb22c02b

Cycles: Fix wrong projection coordinates for points behind the camera

Points behind camera will be flipped on projection, but that did not
happen.

This solves second issue reported at T48848.

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

M	intern/cycles/blender/blender_object.cpp

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

diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index da9e014..4886735 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -259,11 +259,14 @@ static bool object_boundbox_clip(Scene *scene,
 		                       dot(worldtondc.y, b),
 		                       dot(worldtondc.z, b),
 		                       dot(worldtondc.w, b));
+		p = float4_to_float3(c / c.w);
+		if(c.z < 0.0f) {
+			p.x = 1.0f - p.x;
+			p.y = 1.0f - p.y;
+		}
 		if(c.z >= -margin) {
 			all_behind = false;
 		}
-		c /= c.w;
-		p = float4_to_float3(c);
 		bb_min = min(bb_min, p);
 		bb_max = max(bb_max, p);
 	}




More information about the Bf-blender-cvs mailing list