Fix #112802: EEVEE-Next: Invalid weight when mixing closures
This was caused by a weight of 0 leading to `x = 0 / 0` which resulted in NaNs and missing closure data. Pull Request: https://projects.blender.org/blender/blender/pulls/112855
This commit is contained in:
parent
6b53fd5cf6
commit
f2fb74d30c
|
@ -32,6 +32,9 @@ float g_volume_absorption_rand;
|
|||
*/
|
||||
bool closure_select(float weight, inout float total_weight, inout float r)
|
||||
{
|
||||
if (weight < 1e-5) {
|
||||
return false;
|
||||
}
|
||||
total_weight += weight;
|
||||
float x = weight / total_weight;
|
||||
bool chosen = (r < x);
|
||||
|
|
Loading…
Reference in New Issue