Fix #138188: camera_shader_random_sample returns zero if DOF is off

This commit is contained in:
Lukas Stockner
2025-06-19 20:02:19 +02:00
parent a051f87fee
commit 8f00a00283

View File

@@ -28,8 +28,10 @@ ccl_device_inline Spectrum integrate_camera_sample(KernelGlobals kg,
path_rng_2D(kg, rng_pixel, sample, PRNG_FILTER);
/* Motion blur (time) and depth of field (lens) sampling. (time, lens_x, lens_y) */
const float3 rand_time_lens = (kernel_data.cam.shuttertime != -1.0f ||
kernel_data.cam.aperturesize > 0.0f) ?
const bool use_motionblur = kernel_data.cam.shuttertime != -1.0f;
const bool use_dof = kernel_data.cam.aperturesize > 0.0f;
const bool use_custom_cam = kernel_data.cam.type == CAMERA_CUSTOM;
const float3 rand_time_lens = (use_motionblur || use_dof || use_custom_cam) ?
path_rng_3D(kg, rng_pixel, sample, PRNG_LENS_TIME) :
zero_float3();