Browse Source

update use of Texture3D constructor

Almar Klein 7 years ago
parent
commit
25b9b81c99
1 changed files with 3 additions and 1 deletions
  1. 3 1
      examples/webgl_materials_texture3d_volume1.html

+ 3 - 1
examples/webgl_materials_texture3d_volume1.html

@@ -115,7 +115,9 @@
 				// THREEJS will select R32F (33326) based on the RedFormat and FloatType.
 				// Also see https://www.khronos.org/registry/webgl/specs/latest/2.0/#TEXTURE_TYPES_FORMATS_FROM_DOM_ELEMENTS_TABLE
 				// TODO: look the dtype up in the volume metadata
-				var texture = new THREE.Texture3D(volume.data, volume.xLength, volume.yLength, volume.zLength, THREE.RedFormat, THREE.FloatType);
+				var texture = new THREE.Texture3D( volume.data, volume.xLength, volume.yLength, volume.zLength );
+				texture.format = THREE.RedFormat;
+				texture.type = THREE.FloatType;
 				texture.minFilter = texture.magFilter = THREE.LinearFilter;
 				texture.unpackAlignment = 1;
 				texture.needsUpdate = true;