# Level of Detail Meshing Source: https://www.nianticspatial.com/docs/nsdk/experimental/level_of_detail_meshing/?platform=kotlin # Level of Detail Meshing (Experimental) ## Overview Niantic Spatial Meshing reconstructs the visible geometry of the scene, allowing AR characters and objects to interact physically with their environment. By default, the spatial resolution used for this reconstruction is constant. Level of Detail Meshing is a new experimental feature that changes the local resolution of the reconstruction based on how far the player is from specific points in space. While they are far away, world details are rendered coarsely, but as they approach, the resolution becomes finer, showing a more precise version of the geometry. ## Enabling Levels of Detail To enable levels of detail, configure the meshing session with more than one level of detail: ```kotlin val meshingSession = nsdkSession.meshingSession.acquire() // Configure and start meshing meshingSession.configure( MeshingConfig( fuseKeyframesOnly = true, numVoxelLevels = 3, ) ) meshingSession.start() ``` Choose a value from 2 to 5, with 5 providing the most detail and 2 the least. (Setting this to 1 or 0 will result in the default behavior: no additional levels of detail.) > **Caution:** > > Enabling levels of detail in conjunction with **Distance-based Volumetric Cleanup** is not recommended. To try this code on your device, download the [Sample Project](https://www.nianticspatial.com/docs/nsdk/sample_projects/). ## Level of Detail Setup Examples We provide two examples for how to set up meshing level of detail in your project. The first example, set for a distance of 30 meters, is suitable for indoor use, while the second, set for 100 meters, is better for outdoor experiences. ### Indoor LOD Configuration - **frameRate:** 10 - **fuseKeyframesOnly:** true - **maximumIntegrationDistance:** 30 - **voxelSize:** 0.025 - **enableDistanceBasedVolumetricCleanup:** true - **meshBlockSize:** 2 - **meshCullingDistance:** 0 - **enableMeshDecimation:** true - **filterMeshWithSemantics:** true - **enableBlocklist:** true - **packedBlocklist:** 1 - **numVoxelLevels:** 3 ### Outdoor LOD Configuration - **frameRate:** 10 - **fuseKeyframesOnly:** true - **maximumIntegrationDistance:** 100 - **voxelSize:** 0.05 - **enableDistanceBasedVolumetricCleanup:** true - **meshBlockSize:** 2 - **meshCullingDistance:** 0 - **enableMeshDecimation:** true - **filterMeshWithSemantics:** true - **enableBlocklist:** true - **packedBlocklist:** 1 - **numVoxelLevels:** 4