diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-11 13:23:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-11 13:23:31 +0300 |
commit | 758b20b8ca824f29696d8c009c43be14a0c18669 (patch) | |
tree | 2ac000e7de64e9890cc7261acd3f66da69cf1864 /intern/cycles/kernel/kernel_camera.h | |
parent | 086de5b5e30cde598a133419e1e8952980c9a4e7 (diff) |
Cycles: One more optimization fix, derivatives used to be calculated without aperture
At this point it's totally unclear why we're ignoring aperture and and rolling shutter
now for derivatives calculation but do not ignore direction change caused by stereo.
Diffstat (limited to 'intern/cycles/kernel/kernel_camera.h')
-rw-r--r-- | intern/cycles/kernel/kernel_camera.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index b61ca1df51f..6b8f18e3a21 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -115,18 +115,20 @@ ccl_device void camera_sample_perspective(KernelGlobals *kg, float raster_x, flo /* ray differential */ ray->dP = differential3_zero(); + tD = transform_direction(&cameratoworld, Pcamera); float3 Pdiff = spherical_stereo_position(kg, tD, Pcamera); + float3 Ddiff = normalize(spherical_stereo_direction(kg, tD, Pcamera, Pdiff)); tP = transform_perspective(&rastertocamera, make_float3(raster_x + 1.0f, raster_y, 0.0f)); tD = transform_direction(&cameratoworld, tP); Pcamera = spherical_stereo_position(kg, tD, tP); - ray->dD.dx = normalize(spherical_stereo_direction(kg, tD, tP, Pcamera)) - ray->D; + ray->dD.dx = normalize(spherical_stereo_direction(kg, tD, tP, Pcamera)) - Ddiff; ray->dP.dx = Pcamera - Pdiff; tP = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y + 1.0f, 0.0f)); tD = transform_direction(&cameratoworld, tP); Pcamera = spherical_stereo_position(kg, tD, tP); - ray->dD.dy = normalize(spherical_stereo_direction(kg, tD, tP, Pcamera)) - ray->D; + ray->dD.dy = normalize(spherical_stereo_direction(kg, tD, tP, Pcamera)) - Ddiff; /* dP.dy is zero, since the omnidirectional panorama only shift the eyes horizontally */ #endif |