Edit of asset "Occlusion Culling and Mesh LOD Demo" Accepted

Old/Current New/Edit
Title Occlusion Culling and Mesh LOD Demo Occlusion Culling and Mesh LOD Demo
Description This demo showcases the use of occlusion culling and mesh level of detail in a 3D scene.

The demo contains 1,024 identical rooms in a 64×64 grid. The room geometry is used as a basis for a baked OccluderInstance3D, which allows each room to be culled if it is hidden by another room's walls.

Occlusion culling can provide a performance benefit in draw call-bound scenarios. However, since the Forward+ backend uses a depth prepass, the shading cost is already reduced by the depth prepass. As a result, occlusion culling will not always result in a tangible performance increase, especially in outdoor scenes that have fewer occlusion culling opportunities. Indoor scenes with no DirectionalLight3D casting shadows are a best-case scenario for occlusion culling.

The blue spheres make use of automatically generated LODs, which reduce the number of triangles that need to be rendered each frame by the GPU. This provides a significant performance increase in scenes with complex geometry. In most scenes, this provides a greater performance benefit compared to occlusion culling.

While running the demo, you can toggle the use of mesh LOD and occlusion culling to view the performance difference these features make in this project. Results will vary depending on your CPU and GPU model.

WARNING: If you are using a engine build that is not fully optimized, you may notice that enabling occlusion culling decreases performance. This is because occlusion culling is a demanding process on the CPU, which needs all the build-time optimization it can get. Official builds are fully optimized, but self-compiled builds are not fully optimized by default (use the `optimize=speed use_lto=yes` SCons options).

Language: GDScript

Renderer: Forward+
This demo showcases the use of occlusion culling and mesh level of detail in a 3D scene.

The demo contains 1,024 identical rooms in a 64×64 grid. The room geometry is used as a basis for a baked OccluderInstance3D, which allows each room to be culled if it is hidden by another room's walls.

Occlusion culling can provide a performance benefit in draw call-bound scenarios. However, since the Forward+ backend uses a depth prepass, the shading cost is already reduced by the depth prepass. As a result, occlusion culling will not always result in a tangible performance increase, especially in outdoor scenes that have fewer occlusion culling opportunities. Indoor scenes with no DirectionalLight3D casting shadows are a best-case scenario for occlusion culling.

The blue spheres make use of automatically generated LODs, which reduce the number of triangles that need to be rendered each frame by the GPU. This provides a significant performance increase in scenes with complex geometry. In most scenes, this provides a greater performance benefit compared to occlusion culling.

While running the demo, you can toggle the use of mesh LOD and occlusion culling to view the performance difference these features make in this project. Results will vary depending on your CPU and GPU model.

WARNING: If you are using a engine build that is not fully optimized, you may notice that enabling occlusion culling decreases performance. This is because occlusion culling is a demanding process on the CPU, which needs all the build-time optimization it can get. Official builds are fully optimized, but self-compiled builds are not fully optimized by default (use the `optimize=speed use_lto=yes` SCons options).

Language: GDScript

Renderer: Forward+
Category Demos Demos
License MIT MIT
Repository Provider Custom Custom
Repository Url https://github.com/godotengine/godot-demo-projects/tree/4.2-31d1c0c/3d/occlusion_culling_mesh_lod https://github.com/godotengine/godot-demo-projects/tree/4.2-31d1c0c/3d/occlusion_culling_mesh_lod
Issues Url https://github.com/godotengine/godot-demo-projects/issues https://github.com/godotengine/godot-demo-projects/issues
Godot version Godot 4.2 Godot 4.2
Version String 4.2-31d1c0c 4.2-31d1c0c
Download Commit https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/3d_occlusion_culling_mesh_lod.zip https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/3d_occlusion_culling_mesh_lod.zip
Download Url (Computed) https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/3d_occlusion_culling_mesh_lod.zip https://github.com/godotengine/godot-demo-projects/releases/download/4.2-31d1c0c/3d_occlusion_culling_mesh_lod.zip
Icon Url https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/3d/occlusion_culling_mesh_lod/icon.webp
https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/3d/occlusion_culling_mesh_lod/icon.webp
Preview Insert
Type image
Image/Video URL https://raw.githubusercontent.com/godotengine/godot-demo-projects/4.2-31d1c0c/3d/occlusion_culling_mesh_lod/screenshots/occlusion_culling_mesh_lod.webp
Thumbnail