Fix #36053: slow GPU render with panorama camera + depth of field.

This commit is contained in:
Brecht Van Lommel 2013-07-10 17:25:52 +00:00
parent 990cad983b
commit 3a89f98a24

@ -166,6 +166,12 @@ __device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float ra
ray->D = panorama_to_direction(kg, Pcamera.x, Pcamera.y);
/* indicates ray should not receive any light, outside of the lens */
if(is_zero(ray->D)) {
ray->t = 0.0f;
return;
}
/* modify ray for depth of field */
float aperturesize = kernel_data.cam.aperturesize;
@ -186,12 +192,6 @@ __device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float ra
ray->D = normalize(Pfocus - ray->P);
}
/* indicates ray should not receive any light, outside of the lens */
if(is_zero(ray->D)) {
ray->t = 0.0f;
return;
}
/* transform ray from camera to world */
Transform cameratoworld = kernel_data.cam.cameratoworld;