Using an array of Targa (TGA) files as input to CubeTextureLoader(..)

I am currently loading a cube map using the handy CubeTextureLoader function, pass in an array of PNGs stored as data URLs and things work as expected:

scene.background = new THREE.CubeTextureLoader().load(img_urls);

The images are large (up to 4k x 4k) and the C++ code that generates the PNG files takes too long to encode and write them - sometimes 4-5 seconds. I changed my code to write the data URLs as uncompressed Targa (TGA) files which takes just a few milliseconds but the CubeTextureLoader appears to refuse to load them - there is no error in the console but they are not loaded into the scene as I would expect.

Should this work? I realize TGA is an ancient format but for this unusual use-case, it was perfect.

Web browsers do not support TGA: html - How can I show a TGA image in a <img> tga? - Stack Overflow

Yep, understood but I imagined since there is a TGA loader in Three.js, internally, the CubeMapLoader could load anything that was supported.

I was able to tweak the C++ PNG encoder and reduce the compression & encode time so it’s probably fast enough now.