Skip to content

Commit aaca279

Browse files
committed
add meshopt default path and test example
1 parent e85baec commit aaca279

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

docs/components/gltf-model.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ When using glTF models compressed with Draco, KTX2 or Meshopt, you must configur
146146
|------------------|--------------------------------------|----|
147147
| dracoDecoderPath | Path to the Draco decoder libraries. | 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/' |
148148
| basisTranscoderPath | Path to the basis/KTX2 transcoder libraries. | '' |
149-
| meshoptDecoderPath | Path to the Meshopt decoder. | '' |
149+
| meshoptDecoderPath | Path to the Meshopt decoder. | 'https://unpkg.com/meshoptimizer@0.18.0/meshopt_decoder.js' |
150150

151151
`dracoDecoderPath` path must be a folder containing three files:
152152

@@ -167,7 +167,7 @@ be included.
167167
These files are available from the three.js repository in [`/examples/js/libs/basis`](https://github.com/mrdoob/three.js/tree/master/examples/js/libs/basis).
168168

169169

170-
`meshoptDecoderPath` path should be the complete file path (including filename) for a Meshopt decoder, typically named `meshopt_decoder.js`. Meshopt requires WebAssembly support. A CDN-hosted, versioned decoder is available at `https://unpkg.com/meshoptimizer@0.16.0/meshopt_decoder.js`, or you may download copies from the [meshoptimizer GitHub repository][meshopt-decoder].
170+
`meshoptDecoderPath` path should be the complete file path (including filename) for a Meshopt decoder, typically named `meshopt_decoder.js`. Meshopt requires WebAssembly support. A CDN-hosted, versioned decoder is available at `https://unpkg.com/meshoptimizer@0.18.0/meshopt_decoder.js`, or you may download copies from the [meshoptimizer GitHub repository][meshopt-decoder].
171171

172172
## More Resources
173173

examples/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ <h2>Tests</h2>
169169
<li><a href="test/geometry-gallery/">Geometry Gallery</a></li>
170170
<li><a href="test/gltf-model/">glTF Model</a></li>
171171
<li><a href="test/gltf-model/draco.html">glTF Model Draco</a></li>
172+
<li><a href="test/gltf-model/meshopt.html">glTF Model Meshopt</a></li>
172173
<li><a href="test/laser-controls/">Laser Controls</a></li>
173174
<li><a href="test/layer/">Compositor Layer</a></li>
174175
<li><a href="test/mixin/">Mixin</a></li>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>glTF Model Meshopt</title>
6+
<meta name="description" content="glTF Model Meshopt - A-Frame">
7+
<script src="../../../dist/aframe-master.js"></script>
8+
</head>
9+
<body>
10+
<a-scene stats background="color: black">
11+
<a-assets>
12+
<a-asset-item id="lucy" src="https://naver.github.io/egjs-view3d/model/meshopt/lucy.glb"></a-asset-item>
13+
</a-assets>
14+
<a-entity position="0 1 -2" gltf-model="#lucy"></a-entity>
15+
</a-scene>
16+
</body>
17+
</html>

src/systems/gltf-model.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function fetchScript (src) {
1515
/**
1616
* glTF model system.
1717
*
18-
* Configures glTF loading options. Models using glTF compression require that a Draco decoder be
18+
* Configures glTF loading options. Models using glTF compression require that a decoder be
1919
* provided externally.
2020
*
2121
* @param {string} dracoDecoderPath - Base path from which to load Draco decoder library.
@@ -26,7 +26,7 @@ module.exports.System = registerSystem('gltf-model', {
2626
schema: {
2727
dracoDecoderPath: {default: 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/'},
2828
basisTranscoderPath: {default: ''},
29-
meshoptDecoderPath: {default: ''}
29+
meshoptDecoderPath: {default: 'https://unpkg.com/meshoptimizer@0.18.0/meshopt_decoder.js'}
3030
},
3131

3232
init: function () {

0 commit comments

Comments
 (0)