Skip to content

Commit

Permalink
Merge pull request #18490 from donmccurdy/feat-ktx2loader
Browse files Browse the repository at this point in the history
KTX2Loader
  • Loading branch information
mrdoob authored Jul 2, 2020
2 parents 6a08232 + 73ea860 commit 921c23e
Show file tree
Hide file tree
Showing 8 changed files with 859 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ var files = {
"webgl_loader_texture_exr",
"webgl_loader_texture_hdr",
"webgl_loader_texture_ktx",
"webgl_loader_texture_ktx2",
"webgl_loader_texture_pvrtc",
"webgl_loader_texture_rgbm",
"webgl_loader_texture_tga",
Expand Down
27 changes: 23 additions & 4 deletions examples/js/libs/basis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ a wide variety of GPU texture compression formats.

[GitHub](https://github.com/BinomialLLC/basis_universal)

## Contents
## Transcoders

This folder contains two files:
Basis Universal texture data may be used in two different file formats:
`.basis` and `.ktx2`. Texture data is identical in both cases, but different
transcoders are required to read the two file types. Both transcoders are
available in this folder now, but they may be merged in the future.

For further documentation about the Basis compressor and transcoder, refer to
the [Basis GitHub repository](https://github.com/BinomialLLC/basis_universal).

### .basis

The folder contains two files required for transcoding `.basis` textures:

* `basis_transcoder.js` — JavaScript wrapper for the WebAssembly transcoder.
* `basis_transcoder.wasm` — WebAssembly transcoder.
Expand All @@ -35,8 +45,17 @@ basisLoader.load( 'diffuse.basis', function ( texture ) {
} );
```

For further documentation about the Basis compressor and transcoder, refer to
the [Basis GitHub repository](https://github.com/BinomialLLC/basis_universal).
### .ktx2

The folder contains two files required for transcoding `.ktx2` textures:

* `msc_basis_transcoder.js` — JavaScript wrapper for the WebAssembly transcoder.
* `msc_basis_transcoder.wasm` — WebAssembly transcoder.

Currently, the `msc_basis_transcoder.js` file must be added to the page as a
global script. The WASM transcoder will be downloaded from the same directory
automatically. These will likely be replaced with ES modules, and merged with
the `.basis` transcoder, in the future. See `KTX2Loader` for usage.

## License

Expand Down
21 changes: 21 additions & 0 deletions examples/js/libs/basis/msc_basis_transcoder.js

Large diffs are not rendered by default.

Binary file added examples/js/libs/basis/msc_basis_transcoder.wasm
Binary file not shown.
Loading

0 comments on commit 921c23e

Please sign in to comment.