Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New single-file Potree format #648

Open
3 tasks
m-schuetz opened this issue Feb 27, 2024 · 2 comments
Open
3 tasks

New single-file Potree format #648

m-schuetz opened this issue Feb 27, 2024 · 2 comments

Comments

@m-schuetz
Copy link
Collaborator

About

  • Next version of Potree will have a new single-file format with *.potree ending.
  • It uses color-filtered voxels for lower LODs, and original point cloud data for the highest LOD.
  • The voxel geometry is hierarchically compressed to about 2 bit per voxel. The filtered colors are compressed via a BC-ish compression. Voxels will take about 10 bit per voxel.
  • Points will be compressed with Brotli, which usually gets it down to ~30%.

Overview

The format comprises four main sections

  • first 4 bytes: uint32 byte size of metadata
  • Metadata as JSON string
  • A hierarchy buffer
  • Geometry buffers

Metadata

Metadata contains descriptions of point attributes, byte offsets to the hierarchy and geometry blocks, bounding box, and several other infos about the point cloud.

Example metadata JSON
{
	"version": "2.0",
	"name": "2024.01",
	"description": "",
	"points": 1417800187,
	"projection": "",
	"hierarchy": {
		"firstChunkSize": 168682,
		"stepSize": 6,
		"depth": 10
	},
	"offset": [ 2545704.252, 1210377.936, 872.639],
	"scale": [0.001, 0.001, 0.001],
	"spacing": 26.396867187500903,
	"boundingBox": {
		"min": [ 2545704.252, 1210377.936, 872.639],
		"max": [ 2549083.051, 1213756.735, 4251.438000000116]
	},
	"encoding": "DEFAULT",
	"pointBuffer": {
		"offset": 102400,
		"size": 32761429277
	},
	"hierarchyBuffer": {
		"offset": 32761531677,
		"size": 168682
	},
	"attributes": [
		{
			"name": "position",
			"description": "",
			"size": 12,
			"numElements": 3,
			"elementSize": 4,
			"type": "int32",
			"min": [2545704.252,1210377.936,872.639],
			"max": [2548500.008,1213756.735,1566.392],
			"scale": [1,1,1],
			"offset": [0,0,0]
		},{
			"name": "intensity",
			"description": "",
			"size": 2,
			"numElements": 1,
			"elementSize": 2,
			"type": "uint16",
			"min": [0],
			"max": [65535],
			"scale": [1],
			"offset": [0]
		},{
			"name": "rgb",
			"description": "",
			"size": 6,
			"numElements": 3,
			"elementSize": 2,
			"type": "uint16",
			"min": [0,0,0],
			"max": [65535,65535,65535],
			"scale": [1,1,1],
			"offset": [0,0,0]
		}
	]
}

Hierarchy

Geometry

  • Inner nodes will contain voxel data, leaf nodes will contain point data
  • Voxel positions are encoded relative to the voxels in the parent node (~2bit per voxel)
  • Voxel colors are encoded BC-ish (8 bit per voxel)
  • All children of a node are stored in contiguous memory, allowing us to load all of them in one fetch.
  • Voxel data is stored in a way that allows us to load the most important attributes of multiple nodes in a single fetch. We first store position and filtered colors of all child nodes in contiguous memory, followed by all the remaining attributes. If we are not using the remaining attributes, we do not have to fetch them. [pos] is an array of all positions, and [color] an array of all colors.
    image

TODOs

  • Add lots of padding to the metadata section, so that metadata can be altered afterwards without rewriting the entire file.
    • E.g. capacity for 128kb json? 128kb do not matter much with files that are expected to be GBs large.
    • Users will need command line tools that can extract the json from a *.potree file, allowing them to modify it in a text editor; and a tool that replaces the metadata of a potree file with a provided json file.
@m-schuetz m-schuetz pinned this issue Feb 27, 2024
@Rdataflow
Copy link

@m-schuetz is this maybe obsolete thanks to COPC support added in potree? potree/potree#1381

@Jipwox
Copy link

Jipwox commented Sep 19, 2024

@Rdataflow could you please elaborate on why COPC support would make this obsolete? I am new to potree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants