Repository navigation
Conversation
|
I would just have a WARN_PRINT_ONCE and then disable SSAO/SSIL when the viewport is less than 32 pixels in either dimension. It will be much simpler |
Disabling SSAO/SSIL is reasonable, however having a WARN_PRINT_ONCE would be unnecessary noise (there would be no good way to prevent that warning, if you were using a low-res SubViewport inside a game with SSAO/SSIL). I will say that the Compatibility renderer supports SSAO with any resolution (SSIL is not supported at all), so currently Compatibility is more effective for this feature. I will say I tested this pull request with SSAO, and it works perfectly. SSIL seems to be questionable at some intensities but arguably still better than nothing. |
What problem(s) does this PR solve?
Additional information
SSAO and SSIL appear to always create exactly 5 mipmaps, which is not possible when the resolution is less than 32x32. This fix makes them reduce the number of mipmaps if the resolution is less than 32x32.
This PR seems to fix my Mirror3D addon:
ssao-ssil-small-viewport-test.zip
Although SSIL may need to be double-checked, because at high intensities, it looks overly bright when under 32x32. But this only happens in the editor, not in game. No idea what the reason could be.
No AI used (except to discover that
log2is the correct function to use).I also tested the
limit_mipmapsfunction to ensure it works for all values. Test it yourself:See more
Alternative fix
I also tried fixing it by disabling SSAO and SSIL if the resolution is under 32x32. This seems to work fine as well:
Replace:
With:
Replace:
p_render_data->scene_data->emissive_exposure_normalization = -1.0;With: