-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
[3.4 beta 5] Occluders are confusing and view occlusion doesn't seem to work #52981
Comments
Using the 3D viewport's Perspective menu, use the Overdraw or Wireframe debug draw mode to see whether occlusion is actually hiding things. Remember that an object is only occluded if it's fully occluded by a single sphere. #52347 will make geometry occluders more versatile by allowing arbitrary polygons to act as occluders, on top of adding baking.
This is a 4.76 mspf reduction in rendering time, which is pretty large 🙂 Remember that FPS is not a good way to measure performance differences, since it's not linear. mspf (milliseconds per frame) are almost always a better measurement. This is why competent rendering engineers mention performance figures as mspf rather than FPS. |
I still have to do some docs for the occluder spheres. We probably need some screenshots / scene info / min reprod scene to give more info. It could be that being inside the occluder sphere is turning off the occlusion - they aren't really intended for you to be viewing from inside them. Occluders only work at the level of object AABBs. If the AABBs of your objects are big in relation to the size of the occluder spheres, they are unlikely to be occluded. Also bear in mind that occluder spheres aren't intended to eventually be used alone. They are a tool in the arsenal for occlusion culling that work in some situations (there will be other geometric occluders hopefully soon, e.g. baked meshes and antiportals). As such they are unlikely to give you huge increases in performance except in specific cases. |
It's likely the "fully occluded by single sphere" requirement (which doesn't seem to be in the docs anywhere, neither in-editor docs nor web docs) - buildings are large, that's why I put two spheres each. I saw the PR that adds baking, but I think it's overcomplicating things a little. A boxshape similar to the physics box shape would serve in most situations, after all. |
I'm actually thinking of trying an SDF ray marching metaballs type approach to see if it can help deal with the problem of overlap. Or rather it should work, it's just a case of finding how expensive it is. Just haven't got round to it yet (a lot of things in progress!).
We should be able to add some other simple occluder shapes. The reason for the baked occluder meshes (which is pretty time consuming to develop) is that a lot of vocal users want a system where they don't have to do anything manually (even if not as effective as a manual system). In retrospect I should have probably added some more primitives first for 3.4 rather than worked on the meshes, but I didn't know in advance how time consuming it was going to be, sorry about that! 😀 |
I tried looking at the scene in wireframe and overdraw, and stuff doesn't seem to be disappearing even when I position the camera so that e.g. the next road is behind a single building. Can at least the box shape get added for 3.4, that way I'll know if it's me setting things up badly or something legitimately not working? |
Yep, that's the project! But each of the buildings is a separate mesh currently (they aren't merged to the road) and those should be culled. Currently working on a rooms and portals setup, but just to reiterate, it seems very confusing to use occluders (at least the 3.x version). |
@Zireael07 Did you figure out how to use occluders in 3.5.2 in the end? Quad-based occluders were added in 3.5 and should be more suitable to your use cases. To get better occlusion coverage, you can make quads or spheres partially overlap each other. |
No, as the racer game moved to 4.0 and the other 3.x project was left broken by an attempt to move to 4.x too :( |
Alright, closing then. |
Yeah, I expect quad based occluders would be the solution (are they going to be available in 4.x?) |
Godot version
3.4 beta 5
System information
Linux Manjaro, GLES 3, Intel Kaby Lake
Issue description
I decided to give the occluders a spin. I added two occluderspheres to each of buildings in my racer game, so that the occluders extend past the building by a metre or two.
I am seeing a very modest increase in fps (roughly from 30 to 35) but the vertices monitor still shows very large values even when I'm purposefully crashed into a building (so that it should occlude practically EVERYTHING except my car).
View occlusion in editor shows literally the same things and information in editor as when it's off.
HALP?
Steps to reproduce
? Instructions on how to use occluders unclear
Minimal reproduction project
Not a minimal project, but if I manage to get it somehow going while making sure it doesn't break the project I'll add a commit to my project's GitHub and link back to it.
The text was updated successfully, but these errors were encountered: