forked from bartvdbraak/blender
Merge branch 'blender-v3.0-release'
This commit is contained in:
commit
db450c9320
@ -699,8 +699,10 @@ ccl_device_forceinline bool integrate_volume_sample_light(
|
||||
float light_u, light_v;
|
||||
path_state_rng_2D(kg, rng_state, PRNG_LIGHT_U, &light_u, &light_v);
|
||||
|
||||
light_distribution_sample_from_volume_segment(
|
||||
kg, light_u, light_v, sd->time, sd->P, bounce, path_flag, ls);
|
||||
if (!light_distribution_sample_from_volume_segment(
|
||||
kg, light_u, light_v, sd->time, sd->P, bounce, path_flag, ls)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ls->shader & SHADER_EXCLUDE_SCATTER) {
|
||||
return false;
|
||||
|
@ -73,7 +73,7 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
|
||||
ls->P = zero_float3();
|
||||
ls->Ng = zero_float3();
|
||||
ls->D = zero_float3();
|
||||
ls->pdf = true;
|
||||
ls->pdf = 1.0f;
|
||||
ls->t = FLT_MAX;
|
||||
return true;
|
||||
}
|
||||
@ -131,7 +131,7 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
|
||||
float3 dir = make_float3(klight->spot.dir[0], klight->spot.dir[1], klight->spot.dir[2]);
|
||||
ls->eval_fac *= spot_light_attenuation(
|
||||
dir, klight->spot.spot_angle, klight->spot.spot_smooth, ls->Ng);
|
||||
if (ls->eval_fac == 0.0f) {
|
||||
if (!in_volume_segment && ls->eval_fac == 0.0f) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -170,7 +170,7 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
|
||||
float3 sample_axisu = axisu;
|
||||
float3 sample_axisv = axisv;
|
||||
|
||||
if (klight->area.tan_spread > 0.0f) {
|
||||
if (!in_volume_segment && klight->area.tan_spread > 0.0f) {
|
||||
if (!light_spread_clamp_area_light(
|
||||
P, Ng, &ls->P, &sample_axisu, &sample_axisv, klight->area.tan_spread)) {
|
||||
return false;
|
||||
@ -203,7 +203,7 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
|
||||
|
||||
ls->pdf *= kernel_data.integrator.pdf_lights;
|
||||
|
||||
return (ls->pdf > 0.0f);
|
||||
return in_volume_segment || (ls->pdf > 0.0f);
|
||||
}
|
||||
|
||||
ccl_device bool lights_intersect(KernelGlobals kg,
|
||||
|
Loading…
Reference in New Issue
Block a user