Răsfoiți Sursa

Updated builds.

Mugen87 2 ani în urmă
părinte
comite
c4e5919be4
4 a modificat fișierele cu 206 adăugiri și 7 ștergeri
  1. 63 2
      build/three.cjs
  2. 63 2
      build/three.js
  3. 0 0
      build/three.min.js
  4. 80 3
      build/three.module.js

+ 63 - 2
build/three.cjs

@@ -8638,10 +8638,10 @@ var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 =
 var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
 
 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;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\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\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 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 fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 const vertex$f = "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 fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
@@ -9238,6 +9238,9 @@ const ShaderLib = {
 			},
 			t2D: {
 				value: null
+			},
+			backgroundIntensity: {
+				value: 1
 			}
 		},
 		vertexShader: ShaderChunk.background_vert,
@@ -9253,6 +9256,9 @@ const ShaderLib = {
 			},
 			backgroundBlurriness: {
 				value: 0
+			},
+			backgroundIntensity: {
+				value: 1
 			}
 		},
 		vertexShader: ShaderChunk.backgroundCube_vert,
@@ -9466,6 +9472,7 @@ function WebGLBackground(renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 			boxMesh.material.uniforms.envMap.value = background;
 			boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1;
 			boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
+			boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
 			if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {
 				boxMesh.material.needsUpdate = true;
 				currentBackground = background;
@@ -9499,6 +9506,7 @@ function WebGLBackground(renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 				objects.update(planeMesh);
 			}
 			planeMesh.material.uniforms.t2D.value = background;
+			planeMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
 			if (background.matrixAutoUpdate === true) {
 				background.updateMatrix();
 			}
@@ -16253,6 +16261,8 @@ class WebXRManager extends EventDispatcher {
 		let newRenderTarget = null;
 		const controllers = [];
 		const controllerInputSources = [];
+		const planes = new Set();
+		const planesLastChangedTimes = new Map();
 
 		//
 
@@ -16630,6 +16640,9 @@ class WebXRManager extends EventDispatcher {
 				glBaseLayer.fixedFoveation = foveation;
 			}
 		};
+		this.getPlanes = function () {
+			return planes;
+		};
 
 		// Animation Loop
 
@@ -16695,6 +16708,50 @@ class WebXRManager extends EventDispatcher {
 				}
 			}
 			if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
+			if (frame.detectedPlanes) {
+				scope.dispatchEvent({
+					type: 'planesdetected',
+					data: frame.detectedPlanes
+				});
+				let planesToRemove = null;
+				for (const plane of planes) {
+					if (!frame.detectedPlanes.has(plane)) {
+						if (planesToRemove === null) {
+							planesToRemove = [];
+						}
+						planesToRemove.push(plane);
+					}
+				}
+				if (planesToRemove !== null) {
+					for (const plane of planesToRemove) {
+						planes.delete(plane);
+						planesLastChangedTimes.delete(plane);
+						scope.dispatchEvent({
+							type: 'planeremoved',
+							data: plane
+						});
+					}
+				}
+				for (const plane of frame.detectedPlanes) {
+					if (!planes.has(plane)) {
+						planes.add(plane);
+						planesLastChangedTimes.set(plane, frame.lastChangedTime);
+						scope.dispatchEvent({
+							type: 'planeadded',
+							data: plane
+						});
+					} else {
+						const lastKnownTime = planesLastChangedTimes.get(plane);
+						if (plane.lastChangedTime > lastKnownTime) {
+							planesLastChangedTimes.set(plane, plane.lastChangedTime);
+							scope.dispatchEvent({
+								type: 'planechanged',
+								data: plane
+							});
+						}
+					}
+				}
+			}
 			xrFrame = null;
 		}
 		const animation = new WebGLAnimation();
@@ -18785,6 +18842,7 @@ class Scene extends Object3D {
 		this.environment = null;
 		this.fog = null;
 		this.backgroundBlurriness = 0;
+		this.backgroundIntensity = 1;
 		this.overrideMaterial = null;
 		if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
 			__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', {
@@ -18798,6 +18856,7 @@ class Scene extends Object3D {
 		if (source.environment !== null) this.environment = source.environment.clone();
 		if (source.fog !== null) this.fog = source.fog.clone();
 		this.backgroundBlurriness = source.backgroundBlurriness;
+		this.backgroundIntensity = source.backgroundIntensity;
 		if (source.overrideMaterial !== null) this.overrideMaterial = source.overrideMaterial.clone();
 		this.matrixAutoUpdate = source.matrixAutoUpdate;
 		return this;
@@ -18806,6 +18865,7 @@ class Scene extends Object3D {
 		const data = super.toJSON(meta);
 		if (this.fog !== null) data.object.fog = this.fog.toJSON();
 		if (this.backgroundBlurriness > 0) data.backgroundBlurriness = this.backgroundBlurriness;
+		if (this.backgroundIntensity !== 1) data.backgroundIntensity = this.backgroundIntensity;
 		return data;
 	}
 
@@ -27304,6 +27364,7 @@ class ObjectLoader extends Loader {
 			}
 			const metadata = json.metadata;
 			if (metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry') {
+				if (onError !== undefined) onError(new Error('THREE.ObjectLoader: Can\'t load ' + url));
 				console.error('THREE.ObjectLoader: Can\'t load ' + url);
 				return;
 			}

+ 63 - 2
build/three.js

@@ -8640,10 +8640,10 @@
 	var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
 
 	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;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\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\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 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 fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+	const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 	const vertex$f = "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 fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
@@ -9240,6 +9240,9 @@
 				},
 				t2D: {
 					value: null
+				},
+				backgroundIntensity: {
+					value: 1
 				}
 			},
 			vertexShader: ShaderChunk.background_vert,
@@ -9255,6 +9258,9 @@
 				},
 				backgroundBlurriness: {
 					value: 0
+				},
+				backgroundIntensity: {
+					value: 1
 				}
 			},
 			vertexShader: ShaderChunk.backgroundCube_vert,
@@ -9468,6 +9474,7 @@
 				boxMesh.material.uniforms.envMap.value = background;
 				boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1;
 				boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
+				boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
 				if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {
 					boxMesh.material.needsUpdate = true;
 					currentBackground = background;
@@ -9501,6 +9508,7 @@
 					objects.update(planeMesh);
 				}
 				planeMesh.material.uniforms.t2D.value = background;
+				planeMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
 				if (background.matrixAutoUpdate === true) {
 					background.updateMatrix();
 				}
@@ -16255,6 +16263,8 @@
 			let newRenderTarget = null;
 			const controllers = [];
 			const controllerInputSources = [];
+			const planes = new Set();
+			const planesLastChangedTimes = new Map();
 
 			//
 
@@ -16632,6 +16642,9 @@
 					glBaseLayer.fixedFoveation = foveation;
 				}
 			};
+			this.getPlanes = function () {
+				return planes;
+			};
 
 			// Animation Loop
 
@@ -16697,6 +16710,50 @@
 					}
 				}
 				if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
+				if (frame.detectedPlanes) {
+					scope.dispatchEvent({
+						type: 'planesdetected',
+						data: frame.detectedPlanes
+					});
+					let planesToRemove = null;
+					for (const plane of planes) {
+						if (!frame.detectedPlanes.has(plane)) {
+							if (planesToRemove === null) {
+								planesToRemove = [];
+							}
+							planesToRemove.push(plane);
+						}
+					}
+					if (planesToRemove !== null) {
+						for (const plane of planesToRemove) {
+							planes.delete(plane);
+							planesLastChangedTimes.delete(plane);
+							scope.dispatchEvent({
+								type: 'planeremoved',
+								data: plane
+							});
+						}
+					}
+					for (const plane of frame.detectedPlanes) {
+						if (!planes.has(plane)) {
+							planes.add(plane);
+							planesLastChangedTimes.set(plane, frame.lastChangedTime);
+							scope.dispatchEvent({
+								type: 'planeadded',
+								data: plane
+							});
+						} else {
+							const lastKnownTime = planesLastChangedTimes.get(plane);
+							if (plane.lastChangedTime > lastKnownTime) {
+								planesLastChangedTimes.set(plane, plane.lastChangedTime);
+								scope.dispatchEvent({
+									type: 'planechanged',
+									data: plane
+								});
+							}
+						}
+					}
+				}
 				xrFrame = null;
 			}
 			const animation = new WebGLAnimation();
@@ -18787,6 +18844,7 @@
 			this.environment = null;
 			this.fog = null;
 			this.backgroundBlurriness = 0;
+			this.backgroundIntensity = 1;
 			this.overrideMaterial = null;
 			if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
 				__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', {
@@ -18800,6 +18858,7 @@
 			if (source.environment !== null) this.environment = source.environment.clone();
 			if (source.fog !== null) this.fog = source.fog.clone();
 			this.backgroundBlurriness = source.backgroundBlurriness;
+			this.backgroundIntensity = source.backgroundIntensity;
 			if (source.overrideMaterial !== null) this.overrideMaterial = source.overrideMaterial.clone();
 			this.matrixAutoUpdate = source.matrixAutoUpdate;
 			return this;
@@ -18808,6 +18867,7 @@
 			const data = super.toJSON(meta);
 			if (this.fog !== null) data.object.fog = this.fog.toJSON();
 			if (this.backgroundBlurriness > 0) data.backgroundBlurriness = this.backgroundBlurriness;
+			if (this.backgroundIntensity !== 1) data.backgroundIntensity = this.backgroundIntensity;
 			return data;
 		}
 
@@ -27306,6 +27366,7 @@
 				}
 				const metadata = json.metadata;
 				if (metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry') {
+					if (onError !== undefined) onError(new Error('THREE.ObjectLoader: Can\'t load ' + url));
 					console.error('THREE.ObjectLoader: Can\'t load ' + url);
 					return;
 				}

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
build/three.min.js


+ 80 - 3
build/three.module.js

@@ -13035,11 +13035,11 @@ 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 fragment$h = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\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\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 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 fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
+const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
 
 const vertex$f = "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}";
 
@@ -13670,6 +13670,7 @@ const ShaderLib = {
 		uniforms: {
 			uvTransform: { value: /*@__PURE__*/ new Matrix3() },
 			t2D: { value: null },
+			backgroundIntensity: { value: 1 }
 		},
 
 		vertexShader: ShaderChunk.background_vert,
@@ -13682,7 +13683,8 @@ const ShaderLib = {
 		uniforms: {
 			envMap: { value: null },
 			flipEnvMap: { value: - 1 },
-			backgroundBlurriness: { value: 0 }
+			backgroundBlurriness: { value: 0 },
+			backgroundIntensity: { value: 1 }
 		},
 
 		vertexShader: ShaderChunk.backgroundCube_vert,
@@ -13889,6 +13891,7 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 			boxMesh.material.uniforms.envMap.value = background;
 			boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;
 			boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
+			boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
 
 			if ( currentBackground !== background ||
 				currentBackgroundVersion !== background.version ||
@@ -13943,6 +13946,7 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
 			}
 
 			planeMesh.material.uniforms.t2D.value = background;
+			planeMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
 
 			if ( background.matrixAutoUpdate === true ) {
 
@@ -25029,6 +25033,9 @@ class WebXRManager extends EventDispatcher {
 		const controllers = [];
 		const controllerInputSources = [];
 
+		const planes = new Set();
+		const planesLastChangedTimes = new Map();
+
 		//
 
 		const cameraL = new PerspectiveCamera();
@@ -25586,6 +25593,12 @@ class WebXRManager extends EventDispatcher {
 
 		};
 
+		this.getPlanes = function () {
+
+			return planes;
+
+		};
+
 		// Animation Loop
 
 		let onAnimationFrameCallback = null;
@@ -25694,6 +25707,65 @@ class WebXRManager extends EventDispatcher {
 
 			if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );
 
+			if ( frame.detectedPlanes ) {
+
+				scope.dispatchEvent( { type: 'planesdetected', data: frame.detectedPlanes } );
+
+				let planesToRemove = null;
+
+				for ( const plane of planes ) {
+
+					if ( ! frame.detectedPlanes.has( plane ) ) {
+
+						if ( planesToRemove === null ) {
+
+							planesToRemove = [];
+
+						}
+
+						planesToRemove.push( plane );
+
+					}
+
+				}
+
+				if ( planesToRemove !== null ) {
+
+					for ( const plane of planesToRemove ) {
+
+						planes.delete( plane );
+						planesLastChangedTimes.delete( plane );
+						scope.dispatchEvent( { type: 'planeremoved', data: plane } );
+
+					}
+
+				}
+
+				for ( const plane of frame.detectedPlanes ) {
+
+					if ( ! planes.has( plane ) ) {
+
+						planes.add( plane );
+						planesLastChangedTimes.set( plane, frame.lastChangedTime );
+						scope.dispatchEvent( { type: 'planeadded', data: plane } );
+
+					} else {
+
+						const lastKnownTime = planesLastChangedTimes.get( plane );
+
+						if ( plane.lastChangedTime > lastKnownTime ) {
+
+							planesLastChangedTimes.set( plane, plane.lastChangedTime );
+							scope.dispatchEvent( { type: 'planechanged', data: plane } );
+
+						}
+
+					}
+
+				}
+
+			}
+
 			xrFrame = null;
 
 		}
@@ -29046,6 +29118,7 @@ class Scene extends Object3D {
 		this.fog = null;
 
 		this.backgroundBlurriness = 0;
+		this.backgroundIntensity = 1;
 
 		this.overrideMaterial = null;
 
@@ -29066,6 +29139,7 @@ class Scene extends Object3D {
 		if ( source.fog !== null ) this.fog = source.fog.clone();
 
 		this.backgroundBlurriness = source.backgroundBlurriness;
+		this.backgroundIntensity = source.backgroundIntensity;
 
 		if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
 
@@ -29081,6 +29155,7 @@ class Scene extends Object3D {
 
 		if ( this.fog !== null ) data.object.fog = this.fog.toJSON();
 		if ( this.backgroundBlurriness > 0 ) data.backgroundBlurriness = this.backgroundBlurriness;
+		if ( this.backgroundIntensity !== 1 ) data.backgroundIntensity = this.backgroundIntensity;
 
 		return data;
 
@@ -42290,6 +42365,8 @@ class ObjectLoader extends Loader {
 
 			if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {
 
+				if ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\'t load ' + url ) );
+
 				console.error( 'THREE.ObjectLoader: Can\'t load ' + url );
 				return;
 

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff