diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-29 18:28:36 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-29 18:30:24 +0300 |
commit | ceb03a4d323ebe40e9d3bd3107ea1e7ffb22c02b (patch) | |
tree | 0157848cf172a61ce9905845a460f0799f5022d6 /intern/cycles | |
parent | 1d154fe27173ba849d7b3211ae91b47bf248ada0 (diff) |
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.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index da9e0141e76..4886735a18f 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); } |