Voxel Occlusion Culling Test 2
A lot more stable now with the help of a pre-pass that relaxes voxels a bit to avoid over-occlusion. Usable now without even noticing that the occlusion culling is happening, which is good. Only problem is light leaking in caves as occluded chunks above the surface would get culled during the shadow pass. A fix for this would be to keep the chunks visible but just set their shadow type to "shadow only". Also works with props as well, I just send the software rasterized occlusion depth texture to the GPU and let the compute shader culler also do the occlusion culling. Main difference is that props are treated as a single point in space, instead of considering their culling spheres. This avoids doing the two nested for loops for checking each pixel that makes up the screen-space AABB, which is pretty expensive when you have more than ~50k props visible. You might notice that some of the chunks are not culled when outside the camera's frustum, and that's normal. The unity SRP culler handles frustum culling automatically so they'll get culled before being sent to the GPU. Again, all the code is here on github: https://github.com/jedjoud10/VoxelTerrain/tree/ecs/Runtime/Occlusion https://github.com/jedjoud10/VoxelTerrain/blob/ecs/Runtime/Systems/TerrainOcclusionApplySystem.cs https://github.com/jedjoud10/VoxelTerrain/blob/ecs/Runtime/Systems/TerrainOcclusionRasterizeSystem.cs
Download
0 formatsNo download links available.