Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/webgl_materials_texture3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
var zip = new JSZip( data );
var array = zip.files[ 'head256x256x109' ].asUint8Array();

var texture = new THREE.Texture3D( array, 256, 256, 109 );
var texture = new THREE.DataTexture3D( array, 256, 256, 109 );

texture.format = THREE.RedFormat;
texture.type = THREE.UnsignedByteType;
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_materials_texture3d_volume.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
// 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 );
var texture = new THREE.DataTexture3D( volume.data, volume.xLength, volume.yLength, volume.zLength );
texture.format = THREE.RedFormat;
texture.type = THREE.FloatType;
texture.minFilter = texture.magFilter = THREE.LinearFilter;
Expand Down
2 changes: 1 addition & 1 deletion src/Three.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export { Points } from './objects/Points.js';
export { Group } from './objects/Group.js';
export { VideoTexture } from './textures/VideoTexture.js';
export { DataTexture } from './textures/DataTexture.js';
export { Texture3D } from './textures/Texture3D.js';
export { DataTexture3D } from './textures/DataTexture3D.js';
export { CompressedTexture } from './textures/CompressedTexture.js';
export { CubeTexture } from './textures/CubeTexture.js';
export { CanvasTexture } from './textures/CanvasTexture.js';
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webgl/WebGLTextures.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,

var textureType;

if ( texture.isTexture3D ) {
if ( texture.isDataTexture3D ) {

textureType = _gl.TEXTURE_3D;

Expand Down Expand Up @@ -648,7 +648,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,

textureProperties.__maxMipLevel = mipmaps.length - 1;

} else if ( texture.isTexture3D ) {
} else if ( texture.isDataTexture3D ) {

state.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );
textureProperties.__maxMipLevel = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webgl/WebGLUniforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@

import { CubeTexture } from '../../textures/CubeTexture.js';
import { Texture } from '../../textures/Texture.js';
import { Texture3D } from '../../textures/Texture3D.js';
import { DataTexture3D } from '../../textures/DataTexture3D.js';

var emptyTexture = new Texture();
var emptyTexture3d = new Texture3D();
var emptyTexture3d = new DataTexture3D();
var emptyCubeTexture = new CubeTexture();

// --- Base for inner nodes (including the root) ---
Expand Down
14 changes: 7 additions & 7 deletions src/textures/Texture3D.js → src/textures/DataTexture3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import { Texture } from './Texture.js';
import { NearestFilter } from '../constants.js';

function Texture3D( data, width, height, depth ) {
function DataTexture3D( data, width, height, depth ) {

// We're going to add .setXXX() methods for setting properties later.
// Users can still set in Texture3D directly.
// Users can still set in DataTexture3D directly.
//
// var texture = new THREE.Texture3D( data, width, height, depth );
// var texture = new THREE.DataTexture3D( data, width, height, depth );
// texture.anisotropy = 16;
//
// See #14839
Expand All @@ -27,8 +27,8 @@ function Texture3D( data, width, height, depth ) {

}

Texture3D.prototype = Object.create( Texture.prototype );
Texture3D.prototype.constructor = Texture3D;
Texture3D.prototype.isTexture3D = true;
DataTexture3D.prototype = Object.create( Texture.prototype );
DataTexture3D.prototype.constructor = DataTexture3D;
DataTexture3D.prototype.isDataTexture3D = true;

export { Texture3D };
export { DataTexture3D };