Skip to content

Commit

Permalink
Fix errors in the PNTS Draco decoding docs (#845)
Browse files Browse the repository at this point in the history
* Fix errors in the PNTS decoding docs

* Reword point about separate decoders

* Add link to threejs docs on draco decoders
  • Loading branch information
jsulli authored Nov 22, 2024
1 parent 17f07b6 commit 600b68e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 );
```


Expand Down

0 comments on commit 600b68e

Please sign in to comment.