Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Occlusion culling tweaks

Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
06-04-2006 08:30
Just thinking about current things in occlusion culling that could maybe be improved:

Assume you're right!
Currently when something changes in a culling cube, the culling system assumes that that cube should not be culled. This results in a kind of culling flicker, which means that if an object is constantly updating in such a way that culling has to be recalculated, that area will flicker between being culled, and not being culled, which can result in odd laggy behaviour as suddenly a high prim area is rendered, then ignored again.

My proposed solution to this is to not change the cube's culling status unless something has in fact changed about it. ie: if it was culled before, leave it culled until it's been decided that it should be visible. Since such updates to individual cubes (or small groups of cubes) should be calculated on their own, there should be very little delay involved. Besides, if it is decided that the cube should be culled, and it was being culled before the update, then calculation should in fact be easier, since instead of recalculating the entire cube's contents, all that has to be done is that the primitive(s) involved in the update need to be looked at to see what happened.

Even if the entire cube is recalculated anyway, the fact that it remains unrendered until it is calculated that it needs to be, means that there are no FPS fluctuations.

Also, since all objects either side and behind you should be culled by default, assuming that they are still culled as you are turning means you won't suddenly be rendering loads of objects you can't see. In order to combat the issue of this potentially causing a room you are in to be unrendered for a brief moment, simply having culling extend outwards (which is should probably do already?) so that nearby cubes are looked at first. The advantage of looking at them in that order also is that if a cube near you is fully culled, it should allow SL to cull every cube 'behind' it (relative to the player's camera) very quickly.

Multiple pass removals
This is combat objects on the edges of cubes sometimes being rendered even though every cube they intersect is actually being culled.
Basically, on the first culling pass, no extra work is done.
On the second pass however (assuming the avatar is stationary) SL will take all the cubes it's calculated, and look at objects that intersect the edges, it works out which edge (or edges) the object is sitting on, and looks to see if the cubes on those directions are culled or not, if they are, then that object can be removed as well.

Conclusion
Occlusion culling is still rocking my world, but with these adjustments it could be even more efficient :)
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-05-2006 15:52
Also...

Add some hysteresis in the process.

Don't just start culling right away, wait a second. particularly if the camera and avatar are in different cubes because that usually means you're walking around inside and in less than a second the camera's going to be pushed through the wall and into the same cube as the avatar again...