Skip to content

V3 Tiles Format

mika edited this page Oct 7, 2023 · 20 revisions

Instructions

Using BinaryConverter to create V3 tiles

  • Open converter at Window/PointCloudTools/PointCloudToBinary(DX11)
  • Assign your pointcloud file (NOTE: LAS and BREKEL are not supported)
  • Enable [x] Use V3 .pcroot format
  • Set cell minimum pointcount (if cell tile has less points, it will be completely removed. Good for removing stray points)
  • Set cell grid size (your cloud will be split into tiles of this size)
  • Click convert and give the output folder in the safe dialog
  • From console output you can see the root file location
  • image

Viewer

  • image
  • (if your output folder is inside StreamingAssets/ you dont need to use full path)
  • RootFile: yourfile.pcroot
  • LoadAtStart: Start loading cloud from Start()
  • CloudMaterial: Make sure the material has v3 name on it
  • InstantiateMaterial: Enable if you have multiple V3 tiles viewer in same scene
  • UseNativeArrays: If enabled, allows you to release tile memory (when tile is unloaded)
  • ReleaseTileMemory: Releases tile memory when tile is unloaded (requires using native arrays)
  • RenderOnlyMainCam: if you have multiple cameras, only Camera tagged as MainCamera will render these
  • StartDist: LOD fading starts from this distance (anything below if is full tile, all points will be drawn)
  • EndDist: Tiles further than this wont be visible, and tiles below this value will have less points
  • UseStrongFallOff: better than pure linear distance interpolation (more points will be dropped from far away tiles)
  • MinimumTilePointCount: Dont draw tiles with less than this many points (can help performance, if you have lots of small clouds, ideally they should had been filtered out with converter -minpoints param)
  • GPUUploadSteps: 0 no delay, 1 = 1 frame delay (the higher the value, the less lag on mainthread for GPU data upload, but then tiles take longer to appear fully)
  • TileResolution: Global tile resolution multiplier. Note: Tile point count only updates if its reloaded (goes outside of view and back)
  • UseSizeMultiplier: Global point size adjust, not supported in all shaders
  • PointSizeMultiplier: The multiplier value
  • ForceGC: Calls garbage collection after releasing memory

TIPS

  • Output your v3 tiles into separate folder under StreamingAssets/ with a DOT in the folder name, for example .tiles/ .anything/ (this will avoid Unity from importing those files, which can be slow with hundreds of files! *But this might not copy the file into build.)
  • Using Packed format with V3 gives best performance, remember to use v3-packed material in that case.

Using Unity Occlusion Culling

  • https://docs.unity3d.com/Manual/OcclusionCulling.html

  • Place Occluder meshes on scene manually (you can generate meshes from point cloud using external tools like MeshLab, CloudCompare)

  • Or place boxes/planes manually while in play mode, then take copy of your meshes before exit playmode, then paste them back

  • Assign generated meshes as [x] Occluder Static in Occlusion window
    image

  • set Bake options (for example 0.5)
    image

  • Add empty gameobject with Occlusion Area component (and resize the area to fit your scene)
    image

  • Important: Enable [x] Occlusion Culling in Camera and Occluder gameobjects need to have Opaque material

  • Hit bake, test if it works by moving camera behind some plane (so that tiles are behind it, they should get hidden when watching from scene view)

  • Now you can disable the occluder gameobjects, after bake

KNOWN ISSUES

  • Limitation: Editor converter doesnt support LAS format for v3 conversion (use commandline LAS/LAZ tool instead https://github.com/unitycoder/UnityPointCloudViewer/wiki/Commandline-Tools)
  • FrameRate: Loading the v3 cloud index happens in the main thread, causing some framerate issue while its parsed. (this is moved into separate thread in some coming update)
  • Issue: While v3 cloud is loading, not all tiles appear after they have loaded, until whole cloud has finished loading, where culling information gets force refreshed. (This is due to culling information not updating unless the tile goes outside-and-back to view)
  • Memory usage: Whole cloud is still loaded into memory (even if the tile is not visible). This will be later updated into on-demand loader (load points for tile only when needed)

API (public methods)

PointCloudViewerTilesDX11:

  • public Bounds GetBounds() : returns whole cloud bounds
  • public Vector3 GetOffset() : returns offset used in converter (value before scaling)
  • public int GetTotalPointCount() : returns total pointcount for the whole cloud
  • public int GetVisibleTileCount() : returns visible tiles count
  • public long GetVisiblePointCount() : returns total visible point count
  • public Bounds[] GetAllTileBounds() : returns all tile bounds
  • public Vector4[] GetCullingSpheres() : returns culling spheres X,Y,Z,Radius
  • public bool InitIsReady() : returns true if init is done (viewer has finished initialization, creating culling spheres etc.)
  • public int GetLoadQueueCount() : returns how many tiles still in the load queue
  • public void RunGetPointsInsideBoxThread(Transform box) : returns points inside box, using another thread *experimental
  • public void GetPointsInsideBox(object bounds) : returns points inside box *experimental

Converter Window

image

FAQ

  • Some tiles are missing?
    • They are probably filtered out. In the converter, increase your grid size or reduce minimum point count.
  • Warning message: "loading more than 2GBs is unsupported"
    • Single grid cell cannot have that many points, you should reduce grid size

File structure