-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix errors in the PNTS Draco decoding docs (#845)
* Fix errors in the PNTS decoding docs * Reword point about separate decoders * Add link to threejs docs on draco decoders
- Loading branch information
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,11 +171,13 @@ scene.add( tilesRenderer2.group ); | |
## Adding DRACO Decompression Support | ||
|
||
Adding support for DRACO decompression within the GLTF files that are transported in B3DM and I3DM formats. The same approach can be used to add support for KTX2 and DDS textures. | ||
There are different builds of the draco decoder, pick the appropriate one depending on your model type. [More info](https://github.com/mrdoob/three.js/tree/dev/examples/jsm/libs/draco) | ||
|
||
```js | ||
|
||
// Note the DRACO compression files need to be supplied via an explicit source. | ||
// We use unpkg here but in practice should be provided by the application. | ||
// Decompressing GLTF requires the GLTF branch of the draco decoder | ||
const tilesRenderer = new TilesRenderer( './path/to/tileset.json' ); | ||
|
||
const dracoLoader = new DRACOLoader(); | ||
|
@@ -193,12 +195,12 @@ Adding support for DRACO decompression within the PNTS files. | |
|
||
// Note the DRACO compression files need to be supplied via an explicit source. | ||
// We use unpkg here but in practice should be provided by the application. | ||
// Decompressing point clouds should use the master branch of the draco decoder in place of the GLTF branch | ||
const dracoLoader = new DRACOLoader(); | ||
dracoLoader.setDecoderPath( 'https://unpkg.com/[email protected]/examples/js/libs/draco/gltf/' ); | ||
|
||
dracoLoader.setDecoderPath( 'https://unpkg.com/[email protected]/examples/js/libs/draco/' ); | ||
|
||
const tilesRenderer = new TilesRenderer( './path/to/tileset.json' ); | ||
tilesRenderer.manager.addHandler( /\.drc$/g, loader ); | ||
tilesRenderer.manager.addHandler( /\.drc$/g, dracoLoader ); | ||
``` | ||
|
||
|
||
|