Don McCurdy efb3af16b0 Rebuild basis transcoder for KTX2Loader. 5 gadi atpakaļ
..
README.md c36a565f46 KTX2Loader: Initial commit. 5 gadi atpakaļ
basis_transcoder.js c196f7010a Implement support for BPTC (BC7) in BasisU 5 gadi atpakaļ
basis_transcoder.wasm c196f7010a Implement support for BPTC (BC7) in BasisU 5 gadi atpakaļ
msc_basis_transcoder.js efb3af16b0 Rebuild basis transcoder for KTX2Loader. 5 gadi atpakaļ
msc_basis_transcoder.wasm efb3af16b0 Rebuild basis transcoder for KTX2Loader. 5 gadi atpakaļ

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. 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.

.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.

Both are dependencies of THREE.BasisTextureLoader:

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

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

}, function () {

	console.log( 'onProgress' );

}, function ( e ) {

	console.error( e );

} );

.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

Apache License 2.0