-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan: Raster occlusion margin is too big on baked occluders #63771
Comments
Occludees use their AABB for frustum and occlusion culling (regardless if they have an OccluderInstance3D child), so sphere-like objects will have a lot of wasted space by design. This is especially the case when working with off-grid angles (45° rotation). I suppose we could allow Extra Cull Margin to be set to negative values to counter this, but you could end up with false negatives if you push it too far. |
Hmm, so in the video and image above, if I mentally draw a cube around the bg rocks, there's still an excessive margin around the aabb. |
You can visualize the AABB by selecting one of the rocks at a time in the editor. (Note that this doesn't take Extra Cull Margin into account.) |
This may be due to DirectionalLight3D shadow rendering causing the AABBs to be extended (to prevent occludees' shadows from disappearing when they shouldn't). To disable the preview sun in the editor, try adding a DirectionalLight3D node then hiding it. |
Good idea. I tried it, but the light made no difference to the effective culling margin. In the MRP there's no ground, so limited shadow use anyway. |
Godot version
v4.0.alpha.custom_build.d29e95687
System information
Win 10/64 NVIDIA GeForce GTX 1060/PCIe/SSE2
Issue description
Simple scene w/ baked occluders
The background meshes do not occlude properly. Here you can see even at the start of the video the back ones should be hidden as soon as they are fully occluded, such as the left one as it begins. However, I have to move the camera until it is nearly inside the front object before the back ones turn off. But once you do go inside, the back objects turn on. So the camera is a few centimeters from the object before they turn off.
testocclusion.mp4
Here I made the front object 10x the size and pulled it back so the objects didn't overlap. Now the left back object is on, even though it's fully occluded. This is the border. If I move the camera just a hair right, the left object will turn off.
Steps to reproduce
Look at the MRP in overdraw mode.
Minimal reproduction project
test_occbake.zip
The text was updated successfully, but these errors were encountered: