Fix #34700: orthographic camera DOF was still not working correct.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 3 Apr 2013 17:32:30 +0000 (17:32 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 3 Apr 2013 17:32:30 +0000 (17:32 +0000)
intern/cycles/kernel/kernel_camera.h

index e26addd19e450296389aa61295d90397b5669aa5..694ef8bd01d842fc14f6bea425e4e21b2d3d52e3 100644 (file)
@@ -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 */