Vasya Petrov
Vasya Petrov

Reputation: 145

Load a cubemap from DDS cubemap file with three.js

How to use DDS cubemaps in three.js for scene backgrounds (or skyboxes)? In current time, I explode cubemap DDS to six images and load them with THREE.CubeTextureLoader(). May be other simple way exists? Like this:

var skybox = new THREE.TextureLoader().load('/files/skybox.dds');
scene.background = skybox;

Upvotes: 0

Views: 999

Answers (1)

Radio
Radio

Reputation: 2853

Try the DDSLoader

var loader = new THREE.DDSLoader();
var skybox = loader.load( '/files/skybox.dds' );
scene.background = skybox;

The DDSLoader class must be added to your application: https://github.com/mrdoob/three.js/blob/dev/examples/js/loaders/DDSLoader.js

Upvotes: 2

Related Questions