diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2015-08-07 19:41:16 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2015-08-07 21:04:12 +0300 |
commit | 58133d4ab27ed4e96bacbd4196311f9893530984 (patch) | |
tree | 03d8f2119823ee05d44a563bd69356528444a986 /intern/cycles/kernel | |
parent | 96f20c34a216215a6f4b94e1886485a0d72a4205 (diff) |
Fix T45721: Panoramic render in Cycles camera : depth of field issue with bump maps - patch by Brecht Van Lommel
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_camera.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index 67651f96544..8d439ceb0d7 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -267,11 +267,14 @@ ccl_device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float /* ray differential */ ray->dP = differential3_zero(); + Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); + float3 Ddiff = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))); + Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x + 1.0f, raster_y, 0.0f)); - ray->dD.dx = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))) - ray->D; + ray->dD.dx = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))) - Ddiff; Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y + 1.0f, 0.0f)); - ray->dD.dy = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))) - ray->D; + ray->dD.dy = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))) - Ddiff; #endif } |