Closed VanderSP closed 7 months ago
I've successfully reproduced the bug and I'm now working on a solution.
It’s just that the interface usage of t3d is different. ktx2Loader returns Object instead of Texture2D instance. KTX2Loader needs to be used like this:
ktx2Loader.load('1.ktx2', (data) => {
const texture = new t3d.Texture2D();
const { image, mipmaps, type, format, minFilter, magFilter, generateMipmaps, encoding, premultiplyAlpha } = data;
texture.image = image;
texture.mipmaps = mipmaps;
texture.type = type;
texture.format = format;
texture.minFilter = minFilter;
texture.magFilter = magFilter;
texture.generateMipmaps = generateMipmaps;
texture.encoding = encoding;
texture.premultiplyAlpha = premultiplyAlpha;
material.diffuseMap = texture;
material.needsUpdate = true;
});
I originally wanted to make a pure texture data downloader, but currently it seems that it will cause confusion in use~ However, this is another topic and this issues is closed.
Im one week stopped because i can´t load test ktx2, it parses black...
I packed a rspack project with both t3d and threejs tests
Thanks in advance (please help me!!!)
TestProject.zip