Implement occlusion "soft-culling" to reduce LOD of occluded meshes rather than skipping drawing entirely #76297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Occlusion "soft-culling" has less noticeable artifacts (LOD popping) than standard "hard-culling" (disappearing/flickering meshes):
soft_cull.mp4
This opens the door for more aggressive occlusion settings, and allows meshes that wouldn't normally be considered candidates for acting as occluders (trees/vegetation, vents, rough/dirty windows, smoke and other particles, etc) to be made feasible for that purpose.
This puts a greater reliance on depth testing to prevent overshading (Hierarchical Z makes this very cheap for low polycounts) and HLOD/visibility ranges to reduce draw calls.
Adds three new project settings:
rendering/occlusion_culling/soft_cull_lod_bias
LOD bias multiplier for occluded objects. 0 disables soft-culling (reverts to standard hard-culling)
comparison.mp4
Left:
soft_cull_lod_bias
= 0 (hard-culling)Right:
soft_cull_lod_bias
= 0.05rendering/occlusion_culling/bounds_scale
Scale factor for occludee bounding boxes. Allows objects to be culled before they're fully occluded. Changing this is not recommended when hard-culling is active.
bounds_scale.mp4
Left:
bounds_scale
= 0.6Right:
bounds_scale
= 0.1 (extreme value for demonstration purpose)rendering/mesh_lod/lod_change/shadow_lod_bias
LOD bias multiplier for shadow passes. This had to be separated out from the normal LOD bias to avoid shadow popping artifacts, so it was easier to just include it in this PR.
Depends on #74118, marked as draft until that one is merged
Fixes #53288
Fixes #63771
Fixes godotengine/godot-proposals#2600