Fix #144918: World volume with zero density not rendering correctly

OneAPI has some problem with `exp(-0 * FLT_MAX)`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144979
This commit is contained in:
Weizhen Huang
2025-08-28 10:41:33 +02:00
committed by Weizhen Huang
parent 3bbce15497
commit f77881a795

View File

@@ -596,7 +596,8 @@ ccl_device Spectrum volume_transmittance(KernelGlobals kg,
sd->P = ray->P + ray->D * shade_t;
tau_k += volume_shader_eval_extinction<shadow>(kg, state, sd, path_flag);
}
return exp(-tau_k * step_size);
/* OneAPI has some problem with exp(-0 * FLT_MAX). */
return is_zero(tau_k) ? one_spectrum() : exp(-tau_k * step_size);
}
/* Estimations of optical thickness. */