Przeglądaj źródła

Updated builds.

Mugen87 2 lat temu
rodzic
commit
9f8bb69d3b
5 zmienionych plików z 168 dodań i 99 usunięć
  1. 56 33
      build/three.cjs
  2. 56 33
      build/three.js
  3. 0 0
      build/three.min.js
  4. 56 33
      build/three.module.js
  5. 0 0
      build/three.module.min.js

+ 56 - 33
build/three.cjs

@@ -5,7 +5,7 @@
  */
  */
 'use strict';
 'use strict';
 
 
-const REVISION = '151';
+const REVISION = '152dev';
 const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
 const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
 const CullFaceNone = 0;
 const CullFaceNone = 0;
@@ -11930,7 +11930,7 @@ function getUnlitUniformColorSpace( renderer ) {
 	if ( renderer.getRenderTarget() === null ) {
 	if ( renderer.getRenderTarget() === null ) {
 
 
 		// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
 		// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
-		return renderer.outputEncoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
+		return renderer.outputColorSpace;
 
 
 	}
 	}
 
 
@@ -13503,7 +13503,7 @@ var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_
 
 
 var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";
 var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";
 
 
-var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif";
+var map_fragment = "#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif";
 
 
 var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
 var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
 
 
@@ -13597,7 +13597,7 @@ var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defin
 
 
 const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
 const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
 
 
-const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 
 const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 
 
@@ -18750,16 +18750,16 @@ function handleSource( string, errorLine ) {
 
 
 }
 }
 
 
-function getEncodingComponents( encoding ) {
+function getEncodingComponents( colorSpace ) {
 
 
-	switch ( encoding ) {
+	switch ( colorSpace ) {
 
 
-		case LinearEncoding:
+		case LinearSRGBColorSpace:
 			return [ 'Linear', '( value )' ];
 			return [ 'Linear', '( value )' ];
-		case sRGBEncoding:
+		case SRGBColorSpace:
 			return [ 'sRGB', '( value )' ];
 			return [ 'sRGB', '( value )' ];
 		default:
 		default:
-			console.warn( 'THREE.WebGLProgram: Unsupported encoding:', encoding );
+			console.warn( 'THREE.WebGLProgram: Unsupported color space:', colorSpace );
 			return [ 'Linear', '( value )' ];
 			return [ 'Linear', '( value )' ];
 
 
 	}
 	}
@@ -18790,9 +18790,9 @@ function getShaderErrors( gl, shader, type ) {
 
 
 }
 }
 
 
-function getTexelEncodingFunction( functionName, encoding ) {
+function getTexelEncodingFunction( functionName, colorSpace ) {
 
 
-	const components = getEncodingComponents( encoding );
+	const components = getEncodingComponents( colorSpace );
 	return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }';
 	return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }';
 
 
 }
 }
@@ -19411,8 +19411,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
 			parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
 			parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
 			parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
 			parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
 
 
-			parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
-
 			parameters.vertexTangents ? '#define USE_TANGENT' : '',
 			parameters.vertexTangents ? '#define USE_TANGENT' : '',
 			parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
 			parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
 			parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
 			parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
@@ -19449,7 +19447,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
 			parameters.opaque ? '#define OPAQUE' : '',
 			parameters.opaque ? '#define OPAQUE' : '',
 
 
 			ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
 			ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
-			getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputEncoding ),
+			getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),
 
 
 			parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
 			parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
 
 
@@ -19961,7 +19959,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
 			instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
 
 
 			supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
 			supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
-			outputEncoding: ( currentRenderTarget === null ) ? renderer.outputEncoding : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.encoding : LinearEncoding ),
+			outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? ( currentRenderTarget.texture.encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace ) : LinearSRGBColorSpace ),
 
 
 			map: HAS_MAP,
 			map: HAS_MAP,
 			matcap: HAS_MATCAP,
 			matcap: HAS_MATCAP,
@@ -19978,8 +19976,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
 			normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
 			normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
 			normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
 
 
-			decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.encoding === sRGBEncoding ),
-
 			metalnessMap: HAS_METALNESSMAP,
 			metalnessMap: HAS_METALNESSMAP,
 			roughnessMap: HAS_ROUGHNESSMAP,
 			roughnessMap: HAS_ROUGHNESSMAP,
 
 
@@ -20151,7 +20147,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 
 
 			getProgramCacheKeyParameters( array, parameters );
 			getProgramCacheKeyParameters( array, parameters );
 			getProgramCacheKeyBooleans( array, parameters );
 			getProgramCacheKeyBooleans( array, parameters );
-			array.push( renderer.outputEncoding );
+			array.push( renderer.outputColorSpace );
 
 
 		}
 		}
 
 
@@ -20164,7 +20160,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 	function getProgramCacheKeyParameters( array, parameters ) {
 	function getProgramCacheKeyParameters( array, parameters ) {
 
 
 		array.push( parameters.precision );
 		array.push( parameters.precision );
-		array.push( parameters.outputEncoding );
+		array.push( parameters.outputColorSpace );
 		array.push( parameters.envMapMode );
 		array.push( parameters.envMapMode );
 		array.push( parameters.envMapCubeUVHeight );
 		array.push( parameters.envMapCubeUVHeight );
 		array.push( parameters.mapUv );
 		array.push( parameters.mapUv );
@@ -20284,12 +20280,10 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			_programLayers.enable( 15 );
 			_programLayers.enable( 15 );
 		if ( parameters.sheen )
 		if ( parameters.sheen )
 			_programLayers.enable( 16 );
 			_programLayers.enable( 16 );
-		if ( parameters.decodeVideoTexture )
-			_programLayers.enable( 17 );
 		if ( parameters.opaque )
 		if ( parameters.opaque )
-			_programLayers.enable( 18 );
+			_programLayers.enable( 17 );
 		if ( parameters.pointsUvs )
 		if ( parameters.pointsUvs )
-			_programLayers.enable( 19 );
+			_programLayers.enable( 18 );
 
 
 		array.push( _programLayers.mask );
 		array.push( _programLayers.mask );
 
 
@@ -22149,7 +22143,7 @@ function WebGLState( gl, extensions, capabilities ) {
 	const currentScissor = new Vector4().fromArray( scissorParam );
 	const currentScissor = new Vector4().fromArray( scissorParam );
 	const currentViewport = new Vector4().fromArray( viewportParam );
 	const currentViewport = new Vector4().fromArray( viewportParam );
 
 
-	function createTexture( type, target, count ) {
+	function createTexture( type, target, count, dimensions ) {
 
 
 		const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.
 		const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.
 		const texture = gl.createTexture();
 		const texture = gl.createTexture();
@@ -22160,7 +22154,15 @@ function WebGLState( gl, extensions, capabilities ) {
 
 
 		for ( let i = 0; i < count; i ++ ) {
 		for ( let i = 0; i < count; i ++ ) {
 
 
-			gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );
+			if ( isWebGL2 && ( type === gl.TEXTURE_3D || type === gl.TEXTURE_2D_ARRAY ) ) {
+
+				gl.texImage3D( target, 0, gl.RGBA, 1, 1, dimensions, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );
+
+			} else {
+
+				gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );
+
+			}
 
 
 		}
 		}
 
 
@@ -22172,6 +22174,13 @@ function WebGLState( gl, extensions, capabilities ) {
 	emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );
 	emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );
 	emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );
 	emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );
 
 
+	if ( isWebGL2 ) {
+
+		emptyTextures[ gl.TEXTURE_2D_ARRAY ] = createTexture( gl.TEXTURE_2D_ARRAY, gl.TEXTURE_2D_ARRAY, 1, 1 );
+		emptyTextures[ gl.TEXTURE_3D ] = createTexture( gl.TEXTURE_3D, gl.TEXTURE_3D, 1, 1 );
+
+	}
+
 	// init
 	// init
 
 
 	colorBuffer.setClear( 0, 0, 0, 1 );
 	colorBuffer.setClear( 0, 0, 0, 1 );
@@ -23774,7 +23783,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 				glFormat = utils.convert( texture.format, texture.encoding );
 				glFormat = utils.convert( texture.format, texture.encoding );
 
 
 			let glType = utils.convert( texture.type ),
 			let glType = utils.convert( texture.type ),
-				glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding, texture.isVideoTexture );
+				glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );
 
 
 			setTextureParameters( textureType, texture, supportsMips );
 			setTextureParameters( textureType, texture, supportsMips );
 
 
@@ -24997,7 +25006,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		const format = texture.format;
 		const format = texture.format;
 		const type = texture.type;
 		const type = texture.type;
 
 
-		if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;
+		if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image;
 
 
 		if ( encoding !== LinearEncoding ) {
 		if ( encoding !== LinearEncoding ) {
 
 
@@ -26012,7 +26021,7 @@ class WebXRManager extends EventDispatcher {
 						{
 						{
 							format: RGBAFormat,
 							format: RGBAFormat,
 							type: UnsignedByteType,
 							type: UnsignedByteType,
-							encoding: renderer.outputEncoding,
+							encoding: renderer.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding,
 							stencilBuffer: attributes.stencil
 							stencilBuffer: attributes.stencil
 						}
 						}
 					);
 					);
@@ -26051,7 +26060,7 @@ class WebXRManager extends EventDispatcher {
 							type: UnsignedByteType,
 							type: UnsignedByteType,
 							depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
 							depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
 							stencilBuffer: attributes.stencil,
 							stencilBuffer: attributes.stencil,
-							encoding: renderer.outputEncoding,
+							encoding: renderer.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding,
 							samples: attributes.antialias ? 4 : 0
 							samples: attributes.antialias ? 4 : 0
 						} );
 						} );
 
 
@@ -27586,7 +27595,7 @@ class WebGLRenderer {
 
 
 		// physically based shading
 		// physically based shading
 
 
-		this.outputEncoding = LinearEncoding;
+		this.outputColorSpace = LinearSRGBColorSpace;
 
 
 		// physical lights
 		// physical lights
 
 
@@ -28949,7 +28958,7 @@ class WebGLRenderer {
 
 
 			const materialProperties = properties.get( material );
 			const materialProperties = properties.get( material );
 
 
-			materialProperties.outputEncoding = parameters.outputEncoding;
+			materialProperties.outputColorSpace = parameters.outputColorSpace;
 			materialProperties.instancing = parameters.instancing;
 			materialProperties.instancing = parameters.instancing;
 			materialProperties.skinning = parameters.skinning;
 			materialProperties.skinning = parameters.skinning;
 			materialProperties.morphTargets = parameters.morphTargets;
 			materialProperties.morphTargets = parameters.morphTargets;
@@ -28972,7 +28981,7 @@ class WebGLRenderer {
 
 
 			const fog = scene.fog;
 			const fog = scene.fog;
 			const environment = material.isMeshStandardMaterial ? scene.environment : null;
 			const environment = material.isMeshStandardMaterial ? scene.environment : null;
-			const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.encoding : LinearEncoding );
+			const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? ( _currentRenderTarget.texture.encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace ) : LinearSRGBColorSpace );
 			const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
 			const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
 			const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
 			const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
 			const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;
 			const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;
@@ -29014,7 +29023,7 @@ class WebGLRenderer {
 
 
 					needsProgramChange = true;
 					needsProgramChange = true;
 
 
-				} else if ( materialProperties.outputEncoding !== encoding ) {
+				} else if ( materialProperties.outputColorSpace !== colorSpace ) {
 
 
 					needsProgramChange = true;
 					needsProgramChange = true;
 
 
@@ -29763,6 +29772,20 @@ class WebGLRenderer {
 
 
 	}
 	}
 
 
+	get outputEncoding() { // @deprecated, r152
+
+		console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
+		return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
+
+	}
+
+	set outputEncoding( encoding ) { // @deprecated, r152
+
+		console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
+		this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
+
+	}
+
 }
 }
 
 
 class WebGL1Renderer extends WebGLRenderer {}
 class WebGL1Renderer extends WebGLRenderer {}

+ 56 - 33
build/three.js

@@ -10,7 +10,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
 	(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
 })(this, (function (exports) { 'use strict';
 })(this, (function (exports) { 'use strict';
 
 
-	const REVISION = '151';
+	const REVISION = '152dev';
 	const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 	const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 	const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
 	const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
 	const CullFaceNone = 0;
 	const CullFaceNone = 0;
@@ -11935,7 +11935,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 		if ( renderer.getRenderTarget() === null ) {
 		if ( renderer.getRenderTarget() === null ) {
 
 
 			// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
 			// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
-			return renderer.outputEncoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
+			return renderer.outputColorSpace;
 
 
 		}
 		}
 
 
@@ -13508,7 +13508,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 	var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";
 	var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";
 
 
-	var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif";
+	var map_fragment = "#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif";
 
 
 	var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
 	var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
 
 
@@ -13602,7 +13602,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 	const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
 	const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
 
 
-	const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+	const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 
 	const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 	const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 
 
@@ -18755,16 +18755,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 	}
 	}
 
 
-	function getEncodingComponents( encoding ) {
+	function getEncodingComponents( colorSpace ) {
 
 
-		switch ( encoding ) {
+		switch ( colorSpace ) {
 
 
-			case LinearEncoding:
+			case LinearSRGBColorSpace:
 				return [ 'Linear', '( value )' ];
 				return [ 'Linear', '( value )' ];
-			case sRGBEncoding:
+			case SRGBColorSpace:
 				return [ 'sRGB', '( value )' ];
 				return [ 'sRGB', '( value )' ];
 			default:
 			default:
-				console.warn( 'THREE.WebGLProgram: Unsupported encoding:', encoding );
+				console.warn( 'THREE.WebGLProgram: Unsupported color space:', colorSpace );
 				return [ 'Linear', '( value )' ];
 				return [ 'Linear', '( value )' ];
 
 
 		}
 		}
@@ -18795,9 +18795,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 	}
 	}
 
 
-	function getTexelEncodingFunction( functionName, encoding ) {
+	function getTexelEncodingFunction( functionName, colorSpace ) {
 
 
-		const components = getEncodingComponents( encoding );
+		const components = getEncodingComponents( colorSpace );
 		return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }';
 		return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }';
 
 
 	}
 	}
@@ -19416,8 +19416,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 				parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
 				parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
 				parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
 				parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
 
 
-				parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
-
 				parameters.vertexTangents ? '#define USE_TANGENT' : '',
 				parameters.vertexTangents ? '#define USE_TANGENT' : '',
 				parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
 				parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
 				parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
 				parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
@@ -19454,7 +19452,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 				parameters.opaque ? '#define OPAQUE' : '',
 				parameters.opaque ? '#define OPAQUE' : '',
 
 
 				ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
 				ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
-				getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputEncoding ),
+				getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),
 
 
 				parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
 				parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
 
 
@@ -19966,7 +19964,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 				instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
 				instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
 
 
 				supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
 				supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
-				outputEncoding: ( currentRenderTarget === null ) ? renderer.outputEncoding : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.encoding : LinearEncoding ),
+				outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? ( currentRenderTarget.texture.encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace ) : LinearSRGBColorSpace ),
 
 
 				map: HAS_MAP,
 				map: HAS_MAP,
 				matcap: HAS_MATCAP,
 				matcap: HAS_MATCAP,
@@ -19983,8 +19981,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 				normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
 				normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
 				normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
 				normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
 
 
-				decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.encoding === sRGBEncoding ),
-
 				metalnessMap: HAS_METALNESSMAP,
 				metalnessMap: HAS_METALNESSMAP,
 				roughnessMap: HAS_ROUGHNESSMAP,
 				roughnessMap: HAS_ROUGHNESSMAP,
 
 
@@ -20156,7 +20152,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 				getProgramCacheKeyParameters( array, parameters );
 				getProgramCacheKeyParameters( array, parameters );
 				getProgramCacheKeyBooleans( array, parameters );
 				getProgramCacheKeyBooleans( array, parameters );
-				array.push( renderer.outputEncoding );
+				array.push( renderer.outputColorSpace );
 
 
 			}
 			}
 
 
@@ -20169,7 +20165,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 		function getProgramCacheKeyParameters( array, parameters ) {
 		function getProgramCacheKeyParameters( array, parameters ) {
 
 
 			array.push( parameters.precision );
 			array.push( parameters.precision );
-			array.push( parameters.outputEncoding );
+			array.push( parameters.outputColorSpace );
 			array.push( parameters.envMapMode );
 			array.push( parameters.envMapMode );
 			array.push( parameters.envMapCubeUVHeight );
 			array.push( parameters.envMapCubeUVHeight );
 			array.push( parameters.mapUv );
 			array.push( parameters.mapUv );
@@ -20289,12 +20285,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 				_programLayers.enable( 15 );
 				_programLayers.enable( 15 );
 			if ( parameters.sheen )
 			if ( parameters.sheen )
 				_programLayers.enable( 16 );
 				_programLayers.enable( 16 );
-			if ( parameters.decodeVideoTexture )
-				_programLayers.enable( 17 );
 			if ( parameters.opaque )
 			if ( parameters.opaque )
-				_programLayers.enable( 18 );
+				_programLayers.enable( 17 );
 			if ( parameters.pointsUvs )
 			if ( parameters.pointsUvs )
-				_programLayers.enable( 19 );
+				_programLayers.enable( 18 );
 
 
 			array.push( _programLayers.mask );
 			array.push( _programLayers.mask );
 
 
@@ -22154,7 +22148,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 		const currentScissor = new Vector4().fromArray( scissorParam );
 		const currentScissor = new Vector4().fromArray( scissorParam );
 		const currentViewport = new Vector4().fromArray( viewportParam );
 		const currentViewport = new Vector4().fromArray( viewportParam );
 
 
-		function createTexture( type, target, count ) {
+		function createTexture( type, target, count, dimensions ) {
 
 
 			const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.
 			const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.
 			const texture = gl.createTexture();
 			const texture = gl.createTexture();
@@ -22165,7 +22159,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 			for ( let i = 0; i < count; i ++ ) {
 			for ( let i = 0; i < count; i ++ ) {
 
 
-				gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );
+				if ( isWebGL2 && ( type === gl.TEXTURE_3D || type === gl.TEXTURE_2D_ARRAY ) ) {
+
+					gl.texImage3D( target, 0, gl.RGBA, 1, 1, dimensions, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );
+
+				} else {
+
+					gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );
+
+				}
 
 
 			}
 			}
 
 
@@ -22177,6 +22179,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 		emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );
 		emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );
 		emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );
 		emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );
 
 
+		if ( isWebGL2 ) {
+
+			emptyTextures[ gl.TEXTURE_2D_ARRAY ] = createTexture( gl.TEXTURE_2D_ARRAY, gl.TEXTURE_2D_ARRAY, 1, 1 );
+			emptyTextures[ gl.TEXTURE_3D ] = createTexture( gl.TEXTURE_3D, gl.TEXTURE_3D, 1, 1 );
+
+		}
+
 		// init
 		// init
 
 
 		colorBuffer.setClear( 0, 0, 0, 1 );
 		colorBuffer.setClear( 0, 0, 0, 1 );
@@ -23779,7 +23788,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 					glFormat = utils.convert( texture.format, texture.encoding );
 					glFormat = utils.convert( texture.format, texture.encoding );
 
 
 				let glType = utils.convert( texture.type ),
 				let glType = utils.convert( texture.type ),
-					glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding, texture.isVideoTexture );
+					glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );
 
 
 				setTextureParameters( textureType, texture, supportsMips );
 				setTextureParameters( textureType, texture, supportsMips );
 
 
@@ -25002,7 +25011,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 			const format = texture.format;
 			const format = texture.format;
 			const type = texture.type;
 			const type = texture.type;
 
 
-			if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;
+			if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image;
 
 
 			if ( encoding !== LinearEncoding ) {
 			if ( encoding !== LinearEncoding ) {
 
 
@@ -26017,7 +26026,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 							{
 							{
 								format: RGBAFormat,
 								format: RGBAFormat,
 								type: UnsignedByteType,
 								type: UnsignedByteType,
-								encoding: renderer.outputEncoding,
+								encoding: renderer.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding,
 								stencilBuffer: attributes.stencil
 								stencilBuffer: attributes.stencil
 							}
 							}
 						);
 						);
@@ -26056,7 +26065,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 								type: UnsignedByteType,
 								type: UnsignedByteType,
 								depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
 								depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
 								stencilBuffer: attributes.stencil,
 								stencilBuffer: attributes.stencil,
-								encoding: renderer.outputEncoding,
+								encoding: renderer.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding,
 								samples: attributes.antialias ? 4 : 0
 								samples: attributes.antialias ? 4 : 0
 							} );
 							} );
 
 
@@ -27591,7 +27600,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 			// physically based shading
 			// physically based shading
 
 
-			this.outputEncoding = LinearEncoding;
+			this.outputColorSpace = LinearSRGBColorSpace;
 
 
 			// physical lights
 			// physical lights
 
 
@@ -28954,7 +28963,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 				const materialProperties = properties.get( material );
 				const materialProperties = properties.get( material );
 
 
-				materialProperties.outputEncoding = parameters.outputEncoding;
+				materialProperties.outputColorSpace = parameters.outputColorSpace;
 				materialProperties.instancing = parameters.instancing;
 				materialProperties.instancing = parameters.instancing;
 				materialProperties.skinning = parameters.skinning;
 				materialProperties.skinning = parameters.skinning;
 				materialProperties.morphTargets = parameters.morphTargets;
 				materialProperties.morphTargets = parameters.morphTargets;
@@ -28977,7 +28986,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 				const fog = scene.fog;
 				const fog = scene.fog;
 				const environment = material.isMeshStandardMaterial ? scene.environment : null;
 				const environment = material.isMeshStandardMaterial ? scene.environment : null;
-				const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.encoding : LinearEncoding );
+				const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? ( _currentRenderTarget.texture.encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace ) : LinearSRGBColorSpace );
 				const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
 				const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
 				const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
 				const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
 				const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;
 				const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;
@@ -29019,7 +29028,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 						needsProgramChange = true;
 						needsProgramChange = true;
 
 
-					} else if ( materialProperties.outputEncoding !== encoding ) {
+					} else if ( materialProperties.outputColorSpace !== colorSpace ) {
 
 
 						needsProgramChange = true;
 						needsProgramChange = true;
 
 
@@ -29768,6 +29777,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 		}
 		}
 
 
+		get outputEncoding() { // @deprecated, r152
+
+			console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
+			return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
+
+		}
+
+		set outputEncoding( encoding ) { // @deprecated, r152
+
+			console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
+			this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
+
+		}
+
 	}
 	}
 
 
 	class WebGL1Renderer extends WebGLRenderer {}
 	class WebGL1Renderer extends WebGLRenderer {}

Plik diff jest za duży
+ 0 - 0
build/three.min.js


+ 56 - 33
build/three.module.js

@@ -3,7 +3,7 @@
  * Copyright 2010-2023 Three.js Authors
  * Copyright 2010-2023 Three.js Authors
  * SPDX-License-Identifier: MIT
  * SPDX-License-Identifier: MIT
  */
  */
-const REVISION = '151';
+const REVISION = '152dev';
 const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
 const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
 const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
 const CullFaceNone = 0;
 const CullFaceNone = 0;
@@ -11928,7 +11928,7 @@ function getUnlitUniformColorSpace( renderer ) {
 	if ( renderer.getRenderTarget() === null ) {
 	if ( renderer.getRenderTarget() === null ) {
 
 
 		// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
 		// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
-		return renderer.outputEncoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
+		return renderer.outputColorSpace;
 
 
 	}
 	}
 
 
@@ -13501,7 +13501,7 @@ var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_
 
 
 var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";
 var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";
 
 
-var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif";
+var map_fragment = "#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif";
 
 
 var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
 var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
 
 
@@ -13595,7 +13595,7 @@ var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defin
 
 
 const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
 const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
 
 
-const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 
 const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
 
 
@@ -18748,16 +18748,16 @@ function handleSource( string, errorLine ) {
 
 
 }
 }
 
 
-function getEncodingComponents( encoding ) {
+function getEncodingComponents( colorSpace ) {
 
 
-	switch ( encoding ) {
+	switch ( colorSpace ) {
 
 
-		case LinearEncoding:
+		case LinearSRGBColorSpace:
 			return [ 'Linear', '( value )' ];
 			return [ 'Linear', '( value )' ];
-		case sRGBEncoding:
+		case SRGBColorSpace:
 			return [ 'sRGB', '( value )' ];
 			return [ 'sRGB', '( value )' ];
 		default:
 		default:
-			console.warn( 'THREE.WebGLProgram: Unsupported encoding:', encoding );
+			console.warn( 'THREE.WebGLProgram: Unsupported color space:', colorSpace );
 			return [ 'Linear', '( value )' ];
 			return [ 'Linear', '( value )' ];
 
 
 	}
 	}
@@ -18788,9 +18788,9 @@ function getShaderErrors( gl, shader, type ) {
 
 
 }
 }
 
 
-function getTexelEncodingFunction( functionName, encoding ) {
+function getTexelEncodingFunction( functionName, colorSpace ) {
 
 
-	const components = getEncodingComponents( encoding );
+	const components = getEncodingComponents( colorSpace );
 	return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }';
 	return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }';
 
 
 }
 }
@@ -19409,8 +19409,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
 			parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
 			parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
 			parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
 			parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
 
 
-			parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
-
 			parameters.vertexTangents ? '#define USE_TANGENT' : '',
 			parameters.vertexTangents ? '#define USE_TANGENT' : '',
 			parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
 			parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
 			parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
 			parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
@@ -19447,7 +19445,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
 			parameters.opaque ? '#define OPAQUE' : '',
 			parameters.opaque ? '#define OPAQUE' : '',
 
 
 			ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
 			ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
-			getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputEncoding ),
+			getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),
 
 
 			parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
 			parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
 
 
@@ -19959,7 +19957,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
 			instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
 
 
 			supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
 			supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
-			outputEncoding: ( currentRenderTarget === null ) ? renderer.outputEncoding : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.encoding : LinearEncoding ),
+			outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? ( currentRenderTarget.texture.encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace ) : LinearSRGBColorSpace ),
 
 
 			map: HAS_MAP,
 			map: HAS_MAP,
 			matcap: HAS_MATCAP,
 			matcap: HAS_MATCAP,
@@ -19976,8 +19974,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
 			normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
 			normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
 			normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
 
 
-			decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.encoding === sRGBEncoding ),
-
 			metalnessMap: HAS_METALNESSMAP,
 			metalnessMap: HAS_METALNESSMAP,
 			roughnessMap: HAS_ROUGHNESSMAP,
 			roughnessMap: HAS_ROUGHNESSMAP,
 
 
@@ -20149,7 +20145,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 
 
 			getProgramCacheKeyParameters( array, parameters );
 			getProgramCacheKeyParameters( array, parameters );
 			getProgramCacheKeyBooleans( array, parameters );
 			getProgramCacheKeyBooleans( array, parameters );
-			array.push( renderer.outputEncoding );
+			array.push( renderer.outputColorSpace );
 
 
 		}
 		}
 
 
@@ -20162,7 +20158,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 	function getProgramCacheKeyParameters( array, parameters ) {
 	function getProgramCacheKeyParameters( array, parameters ) {
 
 
 		array.push( parameters.precision );
 		array.push( parameters.precision );
-		array.push( parameters.outputEncoding );
+		array.push( parameters.outputColorSpace );
 		array.push( parameters.envMapMode );
 		array.push( parameters.envMapMode );
 		array.push( parameters.envMapCubeUVHeight );
 		array.push( parameters.envMapCubeUVHeight );
 		array.push( parameters.mapUv );
 		array.push( parameters.mapUv );
@@ -20282,12 +20278,10 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
 			_programLayers.enable( 15 );
 			_programLayers.enable( 15 );
 		if ( parameters.sheen )
 		if ( parameters.sheen )
 			_programLayers.enable( 16 );
 			_programLayers.enable( 16 );
-		if ( parameters.decodeVideoTexture )
-			_programLayers.enable( 17 );
 		if ( parameters.opaque )
 		if ( parameters.opaque )
-			_programLayers.enable( 18 );
+			_programLayers.enable( 17 );
 		if ( parameters.pointsUvs )
 		if ( parameters.pointsUvs )
-			_programLayers.enable( 19 );
+			_programLayers.enable( 18 );
 
 
 		array.push( _programLayers.mask );
 		array.push( _programLayers.mask );
 
 
@@ -22147,7 +22141,7 @@ function WebGLState( gl, extensions, capabilities ) {
 	const currentScissor = new Vector4().fromArray( scissorParam );
 	const currentScissor = new Vector4().fromArray( scissorParam );
 	const currentViewport = new Vector4().fromArray( viewportParam );
 	const currentViewport = new Vector4().fromArray( viewportParam );
 
 
-	function createTexture( type, target, count ) {
+	function createTexture( type, target, count, dimensions ) {
 
 
 		const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.
 		const data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.
 		const texture = gl.createTexture();
 		const texture = gl.createTexture();
@@ -22158,7 +22152,15 @@ function WebGLState( gl, extensions, capabilities ) {
 
 
 		for ( let i = 0; i < count; i ++ ) {
 		for ( let i = 0; i < count; i ++ ) {
 
 
-			gl.texImage2D( target + i, 0, 6408, 1, 1, 0, 6408, 5121, data );
+			if ( isWebGL2 && ( type === 32879 || type === 35866 ) ) {
+
+				gl.texImage3D( target, 0, 6408, 1, 1, dimensions, 0, 6408, 5121, data );
+
+			} else {
+
+				gl.texImage2D( target + i, 0, 6408, 1, 1, 0, 6408, 5121, data );
+
+			}
 
 
 		}
 		}
 
 
@@ -22170,6 +22172,13 @@ function WebGLState( gl, extensions, capabilities ) {
 	emptyTextures[ 3553 ] = createTexture( 3553, 3553, 1 );
 	emptyTextures[ 3553 ] = createTexture( 3553, 3553, 1 );
 	emptyTextures[ 34067 ] = createTexture( 34067, 34069, 6 );
 	emptyTextures[ 34067 ] = createTexture( 34067, 34069, 6 );
 
 
+	if ( isWebGL2 ) {
+
+		emptyTextures[ 35866 ] = createTexture( 35866, 35866, 1, 1 );
+		emptyTextures[ 32879 ] = createTexture( 32879, 32879, 1, 1 );
+
+	}
+
 	// init
 	// init
 
 
 	colorBuffer.setClear( 0, 0, 0, 1 );
 	colorBuffer.setClear( 0, 0, 0, 1 );
@@ -23772,7 +23781,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 				glFormat = utils.convert( texture.format, texture.encoding );
 				glFormat = utils.convert( texture.format, texture.encoding );
 
 
 			let glType = utils.convert( texture.type ),
 			let glType = utils.convert( texture.type ),
-				glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding, texture.isVideoTexture );
+				glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );
 
 
 			setTextureParameters( textureType, texture, supportsMips );
 			setTextureParameters( textureType, texture, supportsMips );
 
 
@@ -24995,7 +25004,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 		const format = texture.format;
 		const format = texture.format;
 		const type = texture.type;
 		const type = texture.type;
 
 
-		if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;
+		if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image;
 
 
 		if ( encoding !== LinearEncoding ) {
 		if ( encoding !== LinearEncoding ) {
 
 
@@ -26010,7 +26019,7 @@ class WebXRManager extends EventDispatcher {
 						{
 						{
 							format: RGBAFormat,
 							format: RGBAFormat,
 							type: UnsignedByteType,
 							type: UnsignedByteType,
-							encoding: renderer.outputEncoding,
+							encoding: renderer.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding,
 							stencilBuffer: attributes.stencil
 							stencilBuffer: attributes.stencil
 						}
 						}
 					);
 					);
@@ -26049,7 +26058,7 @@ class WebXRManager extends EventDispatcher {
 							type: UnsignedByteType,
 							type: UnsignedByteType,
 							depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
 							depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
 							stencilBuffer: attributes.stencil,
 							stencilBuffer: attributes.stencil,
-							encoding: renderer.outputEncoding,
+							encoding: renderer.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding,
 							samples: attributes.antialias ? 4 : 0
 							samples: attributes.antialias ? 4 : 0
 						} );
 						} );
 
 
@@ -27584,7 +27593,7 @@ class WebGLRenderer {
 
 
 		// physically based shading
 		// physically based shading
 
 
-		this.outputEncoding = LinearEncoding;
+		this.outputColorSpace = LinearSRGBColorSpace;
 
 
 		// physical lights
 		// physical lights
 
 
@@ -28947,7 +28956,7 @@ class WebGLRenderer {
 
 
 			const materialProperties = properties.get( material );
 			const materialProperties = properties.get( material );
 
 
-			materialProperties.outputEncoding = parameters.outputEncoding;
+			materialProperties.outputColorSpace = parameters.outputColorSpace;
 			materialProperties.instancing = parameters.instancing;
 			materialProperties.instancing = parameters.instancing;
 			materialProperties.skinning = parameters.skinning;
 			materialProperties.skinning = parameters.skinning;
 			materialProperties.morphTargets = parameters.morphTargets;
 			materialProperties.morphTargets = parameters.morphTargets;
@@ -28970,7 +28979,7 @@ class WebGLRenderer {
 
 
 			const fog = scene.fog;
 			const fog = scene.fog;
 			const environment = material.isMeshStandardMaterial ? scene.environment : null;
 			const environment = material.isMeshStandardMaterial ? scene.environment : null;
-			const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.encoding : LinearEncoding );
+			const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? ( _currentRenderTarget.texture.encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace ) : LinearSRGBColorSpace );
 			const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
 			const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
 			const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
 			const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
 			const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;
 			const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;
@@ -29012,7 +29021,7 @@ class WebGLRenderer {
 
 
 					needsProgramChange = true;
 					needsProgramChange = true;
 
 
-				} else if ( materialProperties.outputEncoding !== encoding ) {
+				} else if ( materialProperties.outputColorSpace !== colorSpace ) {
 
 
 					needsProgramChange = true;
 					needsProgramChange = true;
 
 
@@ -29761,6 +29770,20 @@ class WebGLRenderer {
 
 
 	}
 	}
 
 
+	get outputEncoding() { // @deprecated, r152
+
+		console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
+		return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
+
+	}
+
+	set outputEncoding( encoding ) { // @deprecated, r152
+
+		console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
+		this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
+
+	}
+
 }
 }
 
 
 class WebGL1Renderer extends WebGLRenderer {}
 class WebGL1Renderer extends WebGLRenderer {}

Plik diff jest za duży
+ 0 - 0
build/three.module.min.js


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików