Class: BASISLoader

Tiny.plugins.compressedTexture. BASISLoader

new Tiny.plugins.compressedTexture.BASISLoader()

Example
// 初始化压缩纹理插件
Tiny.plugins.compressedTexture.init(app.renderer);
// 此 BASIS 方法是 basis_transcoder.js 提供的 wasm 模块
BASIS().then((Module) => {
 const { BasisFile, initializeBasis } = Module;

 // run module
 initializeBasis();
 // 执行绑定
 Tiny.plugins.compressedTexture.BASISLoader.bindTranscoder(BasisFile);

 const loader = new Tiny.loaders.Loader();

 loader
 .add({
   name: 'xxx',
   url: './res/xxx.png',
   // 设置 metadata.useFormat 为 basis,告诉加载器明确只使用 BASIS 纹理
   metadata: { useCompressedTexture: true, useFormat: 'basis' },
 })
 .load((loaderInstance, resources) => {
 });
});

Methods

staticTiny.plugins.compressedTexture.BASISLoader.bindTranscoder(fileCtr)

Name Type Description
fileCtr function

BASIS transcoder 返回的绑定句柄

Documentation generated by JSDoc 3.4.3 on Fri Jul 09 2021 19:32:27 GMT+0800 (CST)