Emmett Lalish f35f4b8ab5 added KTX2 docs 4 年之前
..
README.md f35f4b8ab5 added KTX2 docs 4 年之前
basis_transcoder.js 46c40718f5 Basis: Update Basis library. 4 年之前
basis_transcoder.wasm 46c40718f5 Basis: Update Basis library. 4 年之前

README.md

Basis Universal GPU Texture Compression

Basis Universal is a "supercompressed" GPU texture and texture video compression system that outputs a highly compressed intermediate file format (.basis) that can be quickly transcoded to a wide variety of GPU texture compression formats.

GitHub

Transcoders

Basis Universal texture data may be used in two different file formats: .basis and .ktx2, where ktx2 is a standardized wrapper around basis texture data.

For further documentation about the Basis compressor and transcoder, refer to the Basis GitHub repository.

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

  • basis_transcoder.js — JavaScript wrapper for the WebAssembly transcoder.
  • basis_transcoder.wasm — WebAssembly transcoder.

Both are dependencies of THREE.KTX2Loader and THREE.BasisTextureLoader:

var ktx2Loader = new THREE.KTX2Loader();
ktx2Loader.setTranscoderPath( 'examples/js/libs/basis/' );
ktx2Loader.detectSupport( renderer );
ktx2Loader.load( 'diffuse.ktx2', function ( texture ) {

	var material = new THREE.MeshStandardMaterial( { map: texture } );

}, function () {

	console.log( 'onProgress' );

}, function ( e ) {

	console.error( e );

} );

License

Apache License 2.0