forked from bartvdbraak/blender
Fix #34700: orthographic camera DOF was still not working correct.
This commit is contained in:
parent
e6a16e585c
commit
4c8e70d049
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user