You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Half is a 16-bit floating number on some platforms (see Unity docs). The smallest "normal" number for a 16-bit float is 0.000061035, so 1e-5, or 0.00001 is either denormalized or flushed to zero, depending on the shader compiler, potentially resulting in nan values for fragments with calculated brightness of 0.
I can confirm this happens on Nintendo Switch, probably some mobile platforms too. The areas with nan values in the prefilter texture will get passed down in the downsample/upsample passes and result in black rectangles in the final renderbuffer.
Changing this value from 1e-5 to 6.2e-5 resolves the issue.
The text was updated successfully, but these errors were encountered:
oncer
changed the title
Potential underflow (denormalized number flush to zero) in Bloom shader
Potential divide by zero in Bloom shader
Oct 31, 2019
Thanks for pointing it out. I think this has been fixed in the post-processing stack. I'm not using this effect (KinoBloom) any more, but I'll fix it if there is any chance to update this for some reason.
If you look inside Assets/Kino/Bloom/Shader/Bloom.cginc in the prefilter part:
Half is a 16-bit floating number on some platforms (see Unity docs). The smallest "normal" number for a 16-bit float is 0.000061035, so 1e-5, or 0.00001 is either denormalized or flushed to zero, depending on the shader compiler, potentially resulting in nan values for fragments with calculated brightness of 0.
I can confirm this happens on Nintendo Switch, probably some mobile platforms too. The areas with nan values in the prefilter texture will get passed down in the downsample/upsample passes and result in black rectangles in the final renderbuffer.
Changing this value from 1e-5 to 6.2e-5 resolves the issue.
The text was updated successfully, but these errors were encountered: