mrdoob/three.js — pull request #5380 by tstanev (2014-09-27 17:27:52+00:00)
Title: Autodesk/cube data texture3

Checks if the image.data property is there, as is the case for DataTexture.image. Otherwise uses the regular code path.

This is an example how to construct a data cube map -- opted to assign the underlying image instead of the DataTexture itself as face since that seemed more consistent with what CubeMapTextureLoader does, but either way can be done.

var x_neg = new THREE.DataTexture( pixelsSide, 2, 2, THREE.RGBAFormat );
var x_pos = new THREE.DataTexture( pixelsSide, 2, 2, THREE.RGBAFormat );
var y_neg = new THREE.DataTexture( pixelsBot, 2, 2, THREE.RGBAFormat );
var y_pos = new THREE.DataTexture( pixelsTop, 2, 2, THREE.RGBAFormat );
var z_neg = new THREE.DataTexture( pixelsSide, 2, 2, THREE.RGBAFormat );
var z_pos = new THREE.DataTexture( pixelsSide, 2, 2, THREE.RGBAFormat );

var texture = new THREE.Texture(null, new THREE.CubeReflectionMapping(),
THREE.RepeatWrapping, THREE.RepeatWrapping,
THREE.LinearFilter, THREE.LinearFilter,
THREE.RGBAFormat);
texture.image = [x_pos.image, x_neg.image, y_pos.image, y_neg.image, z_pos.image, z_neg.image];
texture.needsUpdate = true;