diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-19 17:28:28 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-19 17:28:28 +0300 |
commit | 694806a9cfbfef8a8f4cfa0ab7d37a448d0f1bb3 (patch) | |
tree | 1f755edc579624b185b7075d617fb4039c92c06a /intern/cycles/render/camera.cpp | |
parent | 7fd4c440ec2207eb80be13bf14eefa940e39d43e (diff) |
Cycles: Correction to camera in volume detection after clipping commit
The check should also become aware of the fact were using clipping plane
instead of clipping sphere now.
Diffstat (limited to 'intern/cycles/render/camera.cpp')
-rw-r--r-- | intern/cycles/render/camera.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index 5b0d51e60c2..7be3949d138 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -346,6 +346,7 @@ float3 Camera::transform_raster_to_world(float raster_x, float raster_y) if(type == CAMERA_PERSPECTIVE) { D = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); + float3 Pclip = normalize(D); P = make_float3(0.0f, 0.0f, 0.0f); /* TODO(sergey): Aperture support? */ P = transform_point(&cameratoworld, P); @@ -354,7 +355,7 @@ float3 Camera::transform_raster_to_world(float raster_x, float raster_y) * be mistakes in here, currently leading to wrong camera-in-volume * detection. */ - P += nearclip * D; + P += nearclip * D / Pclip.z; } else if (type == CAMERA_ORTHOGRAPHIC) { D = make_float3(0.0f, 0.0f, 1.0f); |