You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extensions/2.0/Khronos/KHR_gaussian_splatting_compression_spz/README.md
+47-26Lines changed: 47 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,23 +44,14 @@ At rest, the 3D Gaussian splats are stored within the SPZ compression format. Up
44
44
45
45
## Compressing 3D Gaussian splats using SPZ
46
46
47
-
If a primitive contains an `extension` property which defines both `KHR_gaussian_splatting`and `KHR_spz_gaussian_splats_compression` then support for SPZ compression is required. There is no requirement for a backup uncompressed buffer.
47
+
To use this extension, it must be defined in the `extensions` property in a `KHR_gaussian_splatting`extension definition. Any mesh primitive using `KHR_gaussian_splatting` that is using this extension will use the SPZ payload to retreive the values for `POSITION`, `COLOR_0`, `KHR_gaussian_splatting:SCALE`, `KHR_gaussian_splatting:ROTATION`, and all `KHR_gaussian_splatting:SH_DEGREE_ℓ_COEF_n` attributes. The [attribute mapping](#attribute-mapping) section defines how the SPZ data is mapped to these attributes.
48
48
49
-
The extension must be listed in `extensionsUsed` alongside `KHR_gaussian_splatting`.
49
+
The extension must then be listed in `extensionsUsed` alongside `KHR_gaussian_splatting`.
50
50
51
51
```json
52
52
"extensionsUsed" : [
53
53
"KHR_gaussian_splatting",
54
-
"KHR_spz_gaussian_splats_compression"
55
-
]
56
-
```
57
-
58
-
It must also be listed in `extensionsRequired`. When `KHR_spz_gaussian_splats_compression` is in use, the `KHR_gaussian_splatting` extension must also be listed as required.
59
-
60
-
```json
61
-
"extensionsRequired" : [
62
-
"KHR_gaussian_splatting",
63
-
"KHR_spz_gaussian_splats_compression"
54
+
"KHR_gaussian_splatting_compression_spz"
64
55
]
65
56
```
66
57
@@ -70,25 +61,29 @@ As this extension extends the base extension, all components of the base extensi
70
61
71
62
### Schema Example
72
63
73
-
Example SPZ extension shown below. This extension only affects any `primitive` nodes containting Gaussian splat data. Note that unlike the base `KHR_gaussian_splatting` extension, the `indices` property is excluded, and a `bufferView` is provided by the extension. This bufferview points to where the SPZ blob is stored.
64
+
Example SPZ extension shown below. This extension only affects any `primitive` nodes containting Gaussian splat data. A `bufferView` is provided by the extension which points to where the SPZ blob is stored.
74
65
75
66
```json
76
67
"meshes": [{
77
68
"primitives": [{
78
69
"attributes": {
79
70
"POSITION": 0,
80
71
"COLOR_0": 1,
81
-
"_SCALE": 2,
82
-
"_ROTATION": 3,
83
-
"_SH_DEGREE_1_COEF_0": 4,
84
-
"_SH_DEGREE_1_COEF_1": 5,
85
-
"_SH_DEGREE_1_COEF_2": 6
72
+
"KHR_gaussian_splatting:SCALE": 2,
73
+
"KHR_gaussian_splatting:ROTATION": 3,
74
+
"KHR_gaussian_splatting:SH_DEGREE_1_COEF_0": 4,
75
+
"KHR_gaussian_splatting:SH_DEGREE_1_COEF_1": 5,
76
+
"KHR_gaussian_splatting:SH_DEGREE_1_COEF_2": 6
86
77
},
87
78
"material": 0,
88
79
"mode": 0,
89
80
"extensions": {
90
-
"KHR_spz_gaussian_splats_compression": {
91
-
"bufferView": 0,
81
+
"KHR_gaussian_splatting": {
82
+
"extensions": {
83
+
"KHR_gaussian_splatting_compression_spz": {
84
+
"bufferView": 0,
85
+
}
86
+
}
92
87
}
93
88
}
94
89
}]
@@ -109,29 +104,55 @@ Example SPZ extension shown below. This extension only affects any `primitive` n
109
104
110
105
This property points to the bufferView containing the Gaussian splat data compressed with SPZ.
111
106
107
+
### Attribute Mapping
108
+
109
+
Data may be used directly from SPZ or may be mapped to the placeholder attributes this extension provides. When mapping to attributes, the data from SPZ is mapped from the `GaussianCloudData` struct in SPZ to the following attributes in glTF. Several fields require additional conversion to make them glTF and renderer ready.
|`colors`|`COLOR_0` RGB components | Compute _0.5 + 0.282095 * x_ to get the color between 0 and 1. |
115
+
|`alphas`|`COLOR_0` A component | Compute the sigmoid to get the alpha between 0 and 1. (Sigmoid formula: _1 / (1 + e^-x)_) |
116
+
|`scales`|`KHR_gaussian_splatting:SCALE`| Compute the base-e exponential of each scale value. (e.g. _e^x_ or `std::exp(x)`) |
117
+
|`rotations`|`KHR_gaussian_splatting:ROTATION`||
118
+
|`sh` index 0 to 2 |`KHR_gaussian_splatting:SH_DEGREE_1_COEF_0`||
119
+
|`sh` index 3 to 5 |`KHR_gaussian_splatting:SH_DEGREE_1_COEF_2`||
120
+
|`sh` index 6 to 8 |`KHR_gaussian_splatting:SH_DEGREE_1_COEF_3`||
121
+
|`sh` index 9 to 11 |`KHR_gaussian_splatting:SH_DEGREE_2_COEF_0`||
122
+
|`sh` index 12 to 14 |`KHR_gaussian_splatting:SH_DEGREE_2_COEF_1`||
123
+
|`sh` index 15 to 17 |`KHR_gaussian_splatting:SH_DEGREE_2_COEF_2`||
124
+
|`sh` index 18 to 20 |`KHR_gaussian_splatting:SH_DEGREE_2_COEF_3`||
125
+
|`sh` index 21 to 23 |`KHR_gaussian_splatting:SH_DEGREE_2_COEF_4`||
126
+
|`sh` index 24 to 26 |`KHR_gaussian_splatting:SH_DEGREE_3_COEF_0`||
127
+
|`sh` index 27 to 29 |`KHR_gaussian_splatting:SH_DEGREE_3_COEF_1`||
128
+
|`sh` index 30 to 32 |`KHR_gaussian_splatting:SH_DEGREE_3_COEF_2`||
129
+
|`sh` index 33 to 35 |`KHR_gaussian_splatting:SH_DEGREE_3_COEF_3`||
130
+
|`sh` index 36 to 38 |`KHR_gaussian_splatting:SH_DEGREE_3_COEF_4`||
131
+
|`sh` index 39 to 41 |`KHR_gaussian_splatting:SH_DEGREE_3_COEF_5`||
132
+
|`sh` index 42 to 44 |`KHR_gaussian_splatting:SH_DEGREE_3_COEF_6`||
133
+
112
134
### Accessors
113
135
114
136
Accessor requirements are modified from the base `KHR_gaussian_splatting` extension with the following adjustments to definition:
115
137
116
-
- SPZ compressed attributes must not include `bufferView` nor `byteOffset`. (See: [Conformance](#conformance))
117
138
- Accessor `type` is defined for the resulting type after decompression and dequantization has occurred.
118
139
- The accessor `count` must match the number of points in the compressed SPZ data.
119
140
120
141
## Conformance
121
142
122
143
The recommended process for handling SPZ compression is as follows:
123
144
124
-
- If the loader does not support `KHR_gaussian_splatting` and `KHR_spz_gaussian_splats_compression`, it must fail.
125
-
- If the loader does support `KHR_gaussian_splatting` and `KHR_spz_gaussian_splats_compression` then:
145
+
- If the loader does not support `KHR_gaussian_splatting_compression_spz` and `accessor.bufferView` is undefined, other extensions may be providing the data.
146
+
- If the loader does not support `KHR_gaussian_splatting_compression_spz` and `accessor.bufferView` is defined, accessor data should be sourced as usual.
147
+
- If the loader does support `KHR_gaussian_splatting_compression_spz` then the loader must process `KHR_gaussian_splatting_compression_spz` data first. The loader must get the data from `KHR_gaussian_splatting_compression_spz`'s `bufferView` extension property.
126
148
127
-
- The loader must process `KHR_spz_gaussian_splats_compression` data first. The loader must get the data from `KHR_spz_gaussian_splats_compression`'s `bufferView` property.
128
-
- SPZ compressed attributes must not include `bufferView` nor `byteOffset` in their accessor declarations. Any attributes falling outside the SPZ format, however, must be stored as regular glTF attributes and must therefore include `bufferView` (and optionally `byteOffset`) in their accessor definitions.
149
+
This allows for a graceful fallback when an implementation does not support this extension.
129
150
130
151
When compressing or decompressing the SPZ data to be stored within the glTF, you must specify a Left-Up-Front (`LUF`) coordinate system in the SPZ `PackOptions` or `UnpackOptions` within the SPZ library. This ensures that the data is compressed and decompressed appropriately for glTF.
0 commit comments