UNPKG

1.49 kBMarkdownView Raw
1# Basis Universal GPU Texture Compression
2
3Basis Universal is a "[supercompressed](http://gamma.cs.unc.edu/GST/gst.pdf)"
4GPU texture and texture video compression system that outputs a highly
5compressed intermediate file format (.basis) that can be quickly transcoded to
6a wide variety of GPU texture compression formats.
7
8[GitHub](https://github.com/BinomialLLC/basis_universal)
9
10## Transcoders
11
12Basis Universal texture data may be used in two different file formats:
13`.basis` and `.ktx2`, where `ktx2` is a standardized wrapper around basis texture data.
14
15For further documentation about the Basis compressor and transcoder, refer to
16the [Basis GitHub repository](https://github.com/BinomialLLC/basis_universal).
17
18The folder contains two files required for transcoding `.basis` or `.ktx2` textures:
19
20* `basis_transcoder.js` — JavaScript wrapper for the WebAssembly transcoder.
21* `basis_transcoder.wasm` — WebAssembly transcoder.
22
23Both are dependencies of `THREE.KTX2Loader` and `THREE.BasisTextureLoader`:
24
25```js
26var ktx2Loader = new THREE.KTX2Loader();
27ktx2Loader.setTranscoderPath( 'examples/js/libs/basis/' );
28ktx2Loader.detectSupport( renderer );
29ktx2Loader.load( 'diffuse.ktx2', function ( texture ) {
30
31 var material = new THREE.MeshStandardMaterial( { map: texture } );
32
33}, function () {
34
35 console.log( 'onProgress' );
36
37}, function ( e ) {
38
39 console.error( e );
40
41} );
42```
43
44## License
45
46[Apache License 2.0](https://github.com/BinomialLLC/basis_universal/blob/master/LICENSE)