I’m trying to follow the webgl_materials_envmaps_fasthdr.html example but I’m getting an odd error.
first my code:
.
.
import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
.
.
const loader = new KTX2Loader().setTranscoderPath('three/examples/jsm/libs/basis/').detectSupport(renderer);
function loadTexture(url) {
loader.load(url, (texture) => {
texture.mapping = THREE.CubeUVReflectionMapping;
scene.environment = texture;
scene.background = texture;
});
}
loadTexture("./assets/output.ktx2");
I used toKTX tool to convert the HDR to KTX2 (HDR to PNG to KTX2)
toktx --t2 --encode uastc --clevel 5 --qlevel 64 --assign_oetf linear --input_swizzle rgb1 output.ktx2 input.png
error code:
00fb4d4e-bb92-4792-899e-2b8a80955ca5:7 Uncaught SyntaxError: Unexpected identifier 'html' (at 00fb4d4e-bb92-4792-899e-2b8a80955ca5:7:11)
the file (at 00fb4d4e-bb92-4792-899e-2b8a80955ca5:7:11) is: basis_transcoder.js by looking at the error code.
any help? thanks.