Преглед на файлове

DepthTexture: change default type to UnsignedIntType when format is DepthFormat (#24019)

William McMurray преди 3 години
родител
ревизия
9a56e26a94

+ 2 - 2
docs/api/en/textures/DepthTexture.html

@@ -30,7 +30,7 @@
 
 
 		[page:Number height] -- height of the texture.<br />
 		[page:Number height] -- height of the texture.<br />
 
 
-		[page:Constant type] -- Default is [page:Textures THREE.UnsignedShortType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
+		[page:Constant type] -- Default is [page:Textures THREE.UnsignedIntType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
 		See [page:Textures type constants] for other choices.<br />
 		See [page:Textures type constants] for other choices.<br />
 
 
 		[page:Constant mapping] --
 		[page:Constant mapping] --
@@ -72,7 +72,7 @@
 
 
 		<h3>[page:Texture.type type]</h3>
 		<h3>[page:Texture.type type]</h3>
 		<p>
 		<p>
-		Default is [page:Textures THREE.UnsignedShortType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
+		Default is [page:Textures THREE.UnsignedIntType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
 		See [page:Textures format constants] for details.<br />
 		See [page:Textures format constants] for details.<br />
 		</p>
 		</p>
 
 

+ 2 - 2
docs/api/zh/textures/DepthTexture.html

@@ -29,7 +29,7 @@
 
 
 		[page:Number height] -- 纹理的高度。<br />
 		[page:Number height] -- 纹理的高度。<br />
 
 
-		[page:Constant type] -- Default is [page:Textures THREE.UnsignedShortType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
+		[page:Constant type] -- Default is [page:Textures THREE.UnsignedIntType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
 		请参阅[page:Textures type constants](类型常量)来了解其他选项。<br />
 		请参阅[page:Textures type constants](类型常量)来了解其他选项。<br />
 
 
 		[page:Constant mapping] --
 		[page:Constant mapping] --
@@ -71,7 +71,7 @@
 
 
 		<h3>[page:Texture.type type]</h3>
 		<h3>[page:Texture.type type]</h3>
 		<p>
 		<p>
-		Default is [page:Textures THREE.UnsignedShortType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
+		Default is [page:Textures THREE.UnsignedIntType] when using [page:Textures DepthFormat] and [page:Textures THREE.UnsignedInt248Type] when using [page:Textures DepthStencilFormat].
 		请参阅[page:Textures format constants]来了解详细信息。<br />
 		请参阅[page:Textures format constants]来了解详细信息。<br />
 		</p>
 		</p>
 
 

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

@@ -747,7 +747,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 
 						console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' );
 						console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' );
 
 
-						texture.type = UnsignedShortType;
+						texture.type = UnsignedIntType;
 						glType = utils.convert( texture.type );
 						glType = utils.convert( texture.type );
 
 
 					}
 					}

+ 2 - 2
src/renderers/webxr/WebXRManager.js

@@ -13,7 +13,7 @@ import {
 	RGBAFormat,
 	RGBAFormat,
 	sRGBEncoding,
 	sRGBEncoding,
 	UnsignedByteType,
 	UnsignedByteType,
-	UnsignedShortType,
+	UnsignedIntType,
 	UnsignedInt248Type,
 	UnsignedInt248Type,
 } from '../../constants.js';
 } from '../../constants.js';
 
 
@@ -292,7 +292,7 @@ class WebXRManager extends EventDispatcher {
 
 
 						glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
 						glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
 						depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
 						depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
-						depthType = attributes.stencil ? UnsignedInt248Type : UnsignedShortType;
+						depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
 
 
 					}
 					}
 
 

+ 3 - 3
src/textures/DepthTexture.js

@@ -1,5 +1,5 @@
 import { Texture } from './Texture.js';
 import { Texture } from './Texture.js';
-import { NearestFilter, UnsignedShortType, UnsignedInt248Type, DepthFormat, DepthStencilFormat } from '../constants.js';
+import { NearestFilter, UnsignedIntType, UnsignedInt248Type, DepthFormat, DepthStencilFormat } from '../constants.js';
 
 
 class DepthTexture extends Texture {
 class DepthTexture extends Texture {
 
 
@@ -13,7 +13,7 @@ class DepthTexture extends Texture {
 
 
 		}
 		}
 
 
-		if ( type === undefined && format === DepthFormat ) type = UnsignedShortType;
+		if ( type === undefined && format === DepthFormat ) type = UnsignedIntType;
 		if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type;
 		if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type;
 
 
 		super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 		super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
@@ -26,7 +26,7 @@ class DepthTexture extends Texture {
 		this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
 		this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
 
 
 		this.flipY = false;
 		this.flipY = false;
-		this.generateMipmaps	= false;
+		this.generateMipmaps = false;
 
 
 	}
 	}