What is DDSLoader?

On the OBJ + MTL loaders example I see that you are adding this handler:

THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() );

What exactly is this handler purpose?

I’m not using it but everything seems to work fine for me.

Is it good only for the OBJ and MTL use-cases?

Thank you.

DDSLoader loads textures based on the S3TC texture compression format. This type of texture is used in the mentioned example and requires a special loader for loading and processing. So if you use the mentioned line of code in your app, MTLLoader will automatically use it if it encounters a texture with the DDS extension. If your assets do not use S3TC at all, you can omit it.

No, S3TC can be used with other 3D formats like glTF. Texture compressions is great since you save a lot of VRAM and the GPU does not have to decode the entire texture during the loading process (this is necessary for JPG and PNG). Decoding is usually implemented in hardware and done on-the-fly when the GPU actually reads a block of texels.


Thank you @Mugen87, that was super helpful!