1 | # Basis Universal GPU Texture Compression
|
2 |
|
3 | Basis Universal is a "[supercompressed](http://gamma.cs.unc.edu/GST/gst.pdf)"
|
4 | GPU texture and texture video compression system that outputs a highly
|
5 | compressed intermediate file format (.basis) that can be quickly transcoded to
|
6 | a wide variety of GPU texture compression formats.
|
7 |
|
8 | [GitHub](https://github.com/BinomialLLC/basis_universal)
|
9 |
|
10 | ## Transcoders
|
11 |
|
12 | Basis 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 |
|
15 | For further documentation about the Basis compressor and transcoder, refer to
|
16 | the [Basis GitHub repository](https://github.com/BinomialLLC/basis_universal).
|
17 |
|
18 | The 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 |
|
23 | Both are dependencies of `THREE.KTX2Loader` and `THREE.BasisTextureLoader`:
|
24 |
|
25 | ```js
|
26 | var ktx2Loader = new THREE.KTX2Loader();
|
27 | ktx2Loader.setTranscoderPath( 'examples/js/libs/basis/' );
|
28 | ktx2Loader.detectSupport( renderer );
|
29 | ktx2Loader.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)
|