Draco 3D Data Compression

Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.

Website | GitHub

Contents

This folder contains three utilities:

  • draco_decoder.js — Emscripten-compiled decoder, compatible with any modern browser.
  • draco_decoder.wasm — WebAssembly decoder, compatible with newer browsers and devices.
  • draco_wasm_wrapper.js — JavaScript wrapper for the WASM decoder.

Each file is provided in two variations:

Either variation may be used with DRACOLoader:

var dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('path/to/decoders/');
dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.

Further documentation on GitHub.

License

Apache License 2.0

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 KTX2Loader:

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

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

}, function () {

    console.log( 'onProgress' );

}, function ( e ) {

    console.error( e );

} );

License

Apache License 2.0