diff options
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 e26addd19e4..694ef8bd01d 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -53,7 +53,7 @@ __device void camera_sample_perspective(KernelGlobals *kg, float raster_x, float /* compute point on plane of focus */ float ft = kernel_data.cam.focaldistance/ray->D.z; - float3 Pfocus = ray->P + ray->D*ft; + float3 Pfocus = ray->D*ft; /* update ray for effect of lens */ ray->P = make_float3(lensuv.x, lensuv.y, 0.0f); @@ -112,11 +112,13 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa /* compute point on plane of focus */ float ft = kernel_data.cam.focaldistance/ray->D.z; - float3 Pfocus = ray->P + ray->D*ft; + float3 Pfocus = ray->D*ft; /* update ray for effect of lens */ ray->P = make_float3(lensuv.x, lensuv.y, 0.0f); ray->D = normalize(Pfocus - ray->P); + + ray->P += Pcamera; } /* transform ray from camera to world */ |