Selaa lähdekoodia

Merge pull request #14839 from takahirox/3DTextureMinorUpdate

3D Texture minor update
Mr.doob 7 vuotta sitten
vanhempi
commit
6102fc09c9

+ 1 - 1
src/renderers/webgl/WebGLTextures.js

@@ -650,7 +650,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 		} else if ( texture.isTexture3D ) {
 
-			state.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.length, 0, glFormat, glType, image.data );
+			state.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );
 			textureProperties.__maxMipLevel = 0;
 
 		} else {

+ 1 - 1
src/renderers/webgl/WebGLUniforms.js

@@ -53,7 +53,7 @@ import { CubeTexture } from '../../textures/CubeTexture.js';
 import { Texture } from '../../textures/Texture.js';
 
 var emptyTexture = new Texture();
-var emptyTexture3d = new Texture();
+var emptyTexture3d = new Texture3D();
 var emptyCubeTexture = new CubeTexture();
 
 // --- Base for inner nodes (including the root) ---

+ 2 - 2
src/textures/Texture3D.js

@@ -5,11 +5,11 @@
 import { Texture } from './Texture.js';
 import { NearestFilter } from '../constants.js';
 
-function Texture3D( data, width, height, length, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
+function Texture3D( data, width, height, depth, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
 
 	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
-	this.image = { data: data, width: width, height: height, length: length };
+	this.image = { data: data, width: width, height: height, depth: depth };
 
 	this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
 	this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;