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

DRACOLoader: Move Draco libs and add readme. #13351

Merged
merged 2 commits into from
Feb 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/js/libs/draco/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Draco 3D Data Compression

Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.

[Website](https://google.github.io/draco/) | [GitHub](https://github.com/google/draco)

## Contents

This folder contains three utilities:

* `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser.
* `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices.
* `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder.

Each file is provided in two variations:

* **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco).
* **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension).

Either variation may be used with `THREE.DRACOLoader`:

```js
THREE.DRACOLoader.setDecoderPath('path/to/decoders/');
THREE.DRACOLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
var dracoLoader = new THREE.DRACOLoader();
```

Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).

## License

[Apache License 2.0](https://github.com/google/draco/blob/master/LICENSE)
4 changes: 2 additions & 2 deletions examples/webgl_loader_draco.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
<a href="https://github.com/google/draco" target="_blank" rel="noopener">DRACO</a> loader
</div>
<script src="../build/three.js"></script>
<script src="js/loaders/draco/DRACOLoader.js"></script>
<script src="js/loaders/DRACOLoader.js"></script>
<script>

var camera, scene, renderer;

// Configure and create Draco decoder.
THREE.DRACOLoader.setDecoderPath('js/loaders/draco/');
THREE.DRACOLoader.setDecoderPath('js/libs/draco/');
THREE.DRACOLoader.setDecoderConfig({type: 'js'});
var dracoLoader = new THREE.DRACOLoader();
init();
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl_loader_gltf_extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</div>
<script src="../build/three.js"></script>
<script src="js/controls/OrbitControls.js"></script>
<script src="js/loaders/draco/DRACOLoader.js"></script>
<script src="js/loaders/DRACOLoader.js"></script>
<script src="js/loaders/GLTFLoader.js"></script>

<script>
Expand Down Expand Up @@ -206,7 +206,7 @@

loader = new THREE.GLTFLoader();

THREE.DRACOLoader.setDecoderPath( 'js/loaders/draco/gltf/' );
THREE.DRACOLoader.setDecoderPath( 'js/libs/draco/gltf/' );
loader.setDRACOLoader( new THREE.DRACOLoader() );

for (var i = 0; i < extensionSelect.children.length; i++) {
Expand Down