diff options
-rw-r--r-- | intern/cycles/kernel/kernel_camera.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index 800daf40887..fe31419b11e 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -100,7 +100,6 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa Transform rastertocamera = kernel_data.cam.rastertocamera; float3 Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); - ray->P = Pcamera; ray->D = make_float3(0.0f, 0.0f, 1.0f); /* modify ray for depth of field */ @@ -116,11 +115,12 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa /* update ray for effect of lens */ float3 lensuvw = make_float3(lensuv.x, lensuv.y, 0.0f); - - ray->P += lensuvw; + ray->P = Pcamera + lensuvw; ray->D = normalize(Pfocus - lensuvw); } - + else { + ray->P = Pcamera; + } /* transform ray from camera to world */ Transform cameratoworld = kernel_data.cam.cameratoworld; |