Mugen87 пре 1 година
родитељ
комит
08d1ea555b
5 измењених фајлова са 114 додато и 57 уклоњено
  1. 38 19
      build/three.cjs
  2. 38 19
      build/three.js
  3. 0 0
      build/three.min.js
  4. 38 19
      build/three.module.js
  5. 0 0
      build/three.module.min.js

+ 38 - 19
build/three.cjs

@@ -3085,9 +3085,9 @@ class DataArrayTexture extends Texture {
 
 
 class WebGLArrayRenderTarget extends WebGLRenderTarget {
 class WebGLArrayRenderTarget extends WebGLRenderTarget {
 
 
-	constructor( width = 1, height = 1, depth = 1 ) {
+	constructor( width = 1, height = 1, depth = 1, options = {} ) {
 
 
-		super( width, height );
+		super( width, height, options );
 
 
 		this.isWebGLArrayRenderTarget = true;
 		this.isWebGLArrayRenderTarget = true;
 
 
@@ -3134,9 +3134,9 @@ class Data3DTexture extends Texture {
 
 
 class WebGL3DRenderTarget extends WebGLRenderTarget {
 class WebGL3DRenderTarget extends WebGLRenderTarget {
 
 
-	constructor( width = 1, height = 1, depth = 1 ) {
+	constructor( width = 1, height = 1, depth = 1, options = {} ) {
 
 
-		super( width, height );
+		super( width, height, options );
 
 
 		this.isWebGL3DRenderTarget = true;
 		this.isWebGL3DRenderTarget = true;
 
 
@@ -7279,6 +7279,10 @@ class Object3D extends EventDispatcher {
 
 
 	}
 	}
 
 
+	onBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
+
+	onAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
+
 	onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 	onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 
 
 	onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 	onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
@@ -22511,8 +22515,12 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 
 							const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
 							const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
 
 
+							object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
+
 							_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
 							_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
 
 
+							object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
+
 						}
 						}
 
 
 					}
 					}
@@ -22521,8 +22529,12 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 
 					const depthMaterial = getDepthMaterial( object, material, light, type );
 					const depthMaterial = getDepthMaterial( object, material, light, type );
 
 
+					object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
+
 					_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
 					_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
 
 
+					object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
+
 				}
 				}
 
 
 			}
 			}
@@ -32860,15 +32872,16 @@ class MultiDrawRenderList {
 }
 }
 
 
 const ID_ATTR_NAME = 'batchId';
 const ID_ATTR_NAME = 'batchId';
-const _matrix = new Matrix4();
-const _identityMatrix = new Matrix4();
-const _projScreenMatrix$2 = new Matrix4();
-const _frustum = new Frustum();
-const _box$1 = new Box3();
-const _sphere$2 = new Sphere();
-const _vector$5 = new Vector3();
-const _renderList = new MultiDrawRenderList();
-const _mesh = new Mesh();
+const _matrix = /*@__PURE__*/ new Matrix4();
+const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
+const _identityMatrix = /*@__PURE__*/ new Matrix4();
+const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
+const _frustum = /*@__PURE__*/ new Frustum();
+const _box$1 = /*@__PURE__*/ new Box3();
+const _sphere$2 = /*@__PURE__*/ new Sphere();
+const _vector$5 = /*@__PURE__*/ new Vector3();
+const _renderList = /*@__PURE__*/ new MultiDrawRenderList();
+const _mesh = /*@__PURE__*/ new Mesh();
 const _batchIntersects = [];
 const _batchIntersects = [];
 
 
 // @TODO: SkinnedMesh support?
 // @TODO: SkinnedMesh support?
@@ -33668,7 +33681,7 @@ class BatchedMesh extends Mesh {
 
 
 	}
 	}
 
 
-	onBeforeRender( _renderer, _scene, camera, geometry, material/*, _group*/ ) {
+	onBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {
 
 
 		// if visibility has not changed and frustum culling and object sorting is not required
 		// if visibility has not changed and frustum culling and object sorting is not required
 		// then skip iterating over all items
 		// then skip iterating over all items
@@ -33689,7 +33702,7 @@ class BatchedMesh extends Mesh {
 		const drawRanges = this._drawRanges;
 		const drawRanges = this._drawRanges;
 		const perObjectFrustumCulled = this.perObjectFrustumCulled;
 		const perObjectFrustumCulled = this.perObjectFrustumCulled;
 
 
-		// prepare the frustum
+		// prepare the frustum in the local frame
 		if ( perObjectFrustumCulled ) {
 		if ( perObjectFrustumCulled ) {
 
 
 			_projScreenMatrix$2
 			_projScreenMatrix$2
@@ -33697,17 +33710,17 @@ class BatchedMesh extends Mesh {
 				.multiply( this.matrixWorld );
 				.multiply( this.matrixWorld );
 			_frustum.setFromProjectionMatrix(
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix$2,
 				_projScreenMatrix$2,
-				_renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
+				renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
 			);
 			);
 
 
 		}
 		}
 
 
 		let count = 0;
 		let count = 0;
-
 		if ( this.sortObjects ) {
 		if ( this.sortObjects ) {
 
 
-			// get the camera position
-			_vector$5.setFromMatrixPosition( camera.matrixWorld );
+			// get the camera position in the local frame
+			_invMatrixWorld.copy( this.matrixWorld ).invert();
+			_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _invMatrixWorld );
 
 
 			for ( let i = 0, l = visibility.length; i < l; i ++ ) {
 			for ( let i = 0, l = visibility.length; i < l; i ++ ) {
 
 
@@ -33798,6 +33811,12 @@ class BatchedMesh extends Mesh {
 
 
 	}
 	}
 
 
+	onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {
+
+		this.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );
+
+	}
+
 }
 }
 
 
 class LineBasicMaterial extends Material {
 class LineBasicMaterial extends Material {

+ 38 - 19
build/three.js

@@ -3090,9 +3090,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 	class WebGLArrayRenderTarget extends WebGLRenderTarget {
 	class WebGLArrayRenderTarget extends WebGLRenderTarget {
 
 
-		constructor( width = 1, height = 1, depth = 1 ) {
+		constructor( width = 1, height = 1, depth = 1, options = {} ) {
 
 
-			super( width, height );
+			super( width, height, options );
 
 
 			this.isWebGLArrayRenderTarget = true;
 			this.isWebGLArrayRenderTarget = true;
 
 
@@ -3139,9 +3139,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 	class WebGL3DRenderTarget extends WebGLRenderTarget {
 	class WebGL3DRenderTarget extends WebGLRenderTarget {
 
 
-		constructor( width = 1, height = 1, depth = 1 ) {
+		constructor( width = 1, height = 1, depth = 1, options = {} ) {
 
 
-			super( width, height );
+			super( width, height, options );
 
 
 			this.isWebGL3DRenderTarget = true;
 			this.isWebGL3DRenderTarget = true;
 
 
@@ -7284,6 +7284,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 		}
 		}
 
 
+		onBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
+
+		onAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
+
 		onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 		onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 
 
 		onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 		onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
@@ -22516,8 +22520,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 								const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
 								const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
 
 
+								object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
+
 								_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
 								_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
 
 
+								object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
+
 							}
 							}
 
 
 						}
 						}
@@ -22526,8 +22534,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 						const depthMaterial = getDepthMaterial( object, material, light, type );
 						const depthMaterial = getDepthMaterial( object, material, light, type );
 
 
+						object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
+
 						_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
 						_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
 
 
+						object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
+
 					}
 					}
 
 
 				}
 				}
@@ -32865,15 +32877,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 	}
 	}
 
 
 	const ID_ATTR_NAME = 'batchId';
 	const ID_ATTR_NAME = 'batchId';
-	const _matrix = new Matrix4();
-	const _identityMatrix = new Matrix4();
-	const _projScreenMatrix$2 = new Matrix4();
-	const _frustum = new Frustum();
-	const _box$1 = new Box3();
-	const _sphere$2 = new Sphere();
-	const _vector$5 = new Vector3();
-	const _renderList = new MultiDrawRenderList();
-	const _mesh = new Mesh();
+	const _matrix = /*@__PURE__*/ new Matrix4();
+	const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
+	const _identityMatrix = /*@__PURE__*/ new Matrix4();
+	const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
+	const _frustum = /*@__PURE__*/ new Frustum();
+	const _box$1 = /*@__PURE__*/ new Box3();
+	const _sphere$2 = /*@__PURE__*/ new Sphere();
+	const _vector$5 = /*@__PURE__*/ new Vector3();
+	const _renderList = /*@__PURE__*/ new MultiDrawRenderList();
+	const _mesh = /*@__PURE__*/ new Mesh();
 	const _batchIntersects = [];
 	const _batchIntersects = [];
 
 
 	// @TODO: SkinnedMesh support?
 	// @TODO: SkinnedMesh support?
@@ -33673,7 +33686,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 		}
 		}
 
 
-		onBeforeRender( _renderer, _scene, camera, geometry, material/*, _group*/ ) {
+		onBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {
 
 
 			// if visibility has not changed and frustum culling and object sorting is not required
 			// if visibility has not changed and frustum culling and object sorting is not required
 			// then skip iterating over all items
 			// then skip iterating over all items
@@ -33694,7 +33707,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 			const drawRanges = this._drawRanges;
 			const drawRanges = this._drawRanges;
 			const perObjectFrustumCulled = this.perObjectFrustumCulled;
 			const perObjectFrustumCulled = this.perObjectFrustumCulled;
 
 
-			// prepare the frustum
+			// prepare the frustum in the local frame
 			if ( perObjectFrustumCulled ) {
 			if ( perObjectFrustumCulled ) {
 
 
 				_projScreenMatrix$2
 				_projScreenMatrix$2
@@ -33702,17 +33715,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 					.multiply( this.matrixWorld );
 					.multiply( this.matrixWorld );
 				_frustum.setFromProjectionMatrix(
 				_frustum.setFromProjectionMatrix(
 					_projScreenMatrix$2,
 					_projScreenMatrix$2,
-					_renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
+					renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
 				);
 				);
 
 
 			}
 			}
 
 
 			let count = 0;
 			let count = 0;
-
 			if ( this.sortObjects ) {
 			if ( this.sortObjects ) {
 
 
-				// get the camera position
-				_vector$5.setFromMatrixPosition( camera.matrixWorld );
+				// get the camera position in the local frame
+				_invMatrixWorld.copy( this.matrixWorld ).invert();
+				_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _invMatrixWorld );
 
 
 				for ( let i = 0, l = visibility.length; i < l; i ++ ) {
 				for ( let i = 0, l = visibility.length; i < l; i ++ ) {
 
 
@@ -33803,6 +33816,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 		}
 		}
 
 
+		onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {
+
+			this.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );
+
+		}
+
 	}
 	}
 
 
 	class LineBasicMaterial extends Material {
 	class LineBasicMaterial extends Material {

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
build/three.min.js


+ 38 - 19
build/three.module.js

@@ -3083,9 +3083,9 @@ class DataArrayTexture extends Texture {
 
 
 class WebGLArrayRenderTarget extends WebGLRenderTarget {
 class WebGLArrayRenderTarget extends WebGLRenderTarget {
 
 
-	constructor( width = 1, height = 1, depth = 1 ) {
+	constructor( width = 1, height = 1, depth = 1, options = {} ) {
 
 
-		super( width, height );
+		super( width, height, options );
 
 
 		this.isWebGLArrayRenderTarget = true;
 		this.isWebGLArrayRenderTarget = true;
 
 
@@ -3132,9 +3132,9 @@ class Data3DTexture extends Texture {
 
 
 class WebGL3DRenderTarget extends WebGLRenderTarget {
 class WebGL3DRenderTarget extends WebGLRenderTarget {
 
 
-	constructor( width = 1, height = 1, depth = 1 ) {
+	constructor( width = 1, height = 1, depth = 1, options = {} ) {
 
 
-		super( width, height );
+		super( width, height, options );
 
 
 		this.isWebGL3DRenderTarget = true;
 		this.isWebGL3DRenderTarget = true;
 
 
@@ -7277,6 +7277,10 @@ class Object3D extends EventDispatcher {
 
 
 	}
 	}
 
 
+	onBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
+
+	onAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
+
 	onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 	onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 
 
 	onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
 	onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
@@ -22509,8 +22513,12 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 
 							const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
 							const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
 
 
+							object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
+
 							_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
 							_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
 
 
+							object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
+
 						}
 						}
 
 
 					}
 					}
@@ -22519,8 +22527,12 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 
 					const depthMaterial = getDepthMaterial( object, material, light, type );
 					const depthMaterial = getDepthMaterial( object, material, light, type );
 
 
+					object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
+
 					_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
 					_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
 
 
+					object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
+
 				}
 				}
 
 
 			}
 			}
@@ -32858,15 +32870,16 @@ class MultiDrawRenderList {
 }
 }
 
 
 const ID_ATTR_NAME = 'batchId';
 const ID_ATTR_NAME = 'batchId';
-const _matrix = new Matrix4();
-const _identityMatrix = new Matrix4();
-const _projScreenMatrix$2 = new Matrix4();
-const _frustum = new Frustum();
-const _box$1 = new Box3();
-const _sphere$2 = new Sphere();
-const _vector$5 = new Vector3();
-const _renderList = new MultiDrawRenderList();
-const _mesh = new Mesh();
+const _matrix = /*@__PURE__*/ new Matrix4();
+const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
+const _identityMatrix = /*@__PURE__*/ new Matrix4();
+const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
+const _frustum = /*@__PURE__*/ new Frustum();
+const _box$1 = /*@__PURE__*/ new Box3();
+const _sphere$2 = /*@__PURE__*/ new Sphere();
+const _vector$5 = /*@__PURE__*/ new Vector3();
+const _renderList = /*@__PURE__*/ new MultiDrawRenderList();
+const _mesh = /*@__PURE__*/ new Mesh();
 const _batchIntersects = [];
 const _batchIntersects = [];
 
 
 // @TODO: SkinnedMesh support?
 // @TODO: SkinnedMesh support?
@@ -33666,7 +33679,7 @@ class BatchedMesh extends Mesh {
 
 
 	}
 	}
 
 
-	onBeforeRender( _renderer, _scene, camera, geometry, material/*, _group*/ ) {
+	onBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {
 
 
 		// if visibility has not changed and frustum culling and object sorting is not required
 		// if visibility has not changed and frustum culling and object sorting is not required
 		// then skip iterating over all items
 		// then skip iterating over all items
@@ -33687,7 +33700,7 @@ class BatchedMesh extends Mesh {
 		const drawRanges = this._drawRanges;
 		const drawRanges = this._drawRanges;
 		const perObjectFrustumCulled = this.perObjectFrustumCulled;
 		const perObjectFrustumCulled = this.perObjectFrustumCulled;
 
 
-		// prepare the frustum
+		// prepare the frustum in the local frame
 		if ( perObjectFrustumCulled ) {
 		if ( perObjectFrustumCulled ) {
 
 
 			_projScreenMatrix$2
 			_projScreenMatrix$2
@@ -33695,17 +33708,17 @@ class BatchedMesh extends Mesh {
 				.multiply( this.matrixWorld );
 				.multiply( this.matrixWorld );
 			_frustum.setFromProjectionMatrix(
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix$2,
 				_projScreenMatrix$2,
-				_renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
+				renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
 			);
 			);
 
 
 		}
 		}
 
 
 		let count = 0;
 		let count = 0;
-
 		if ( this.sortObjects ) {
 		if ( this.sortObjects ) {
 
 
-			// get the camera position
-			_vector$5.setFromMatrixPosition( camera.matrixWorld );
+			// get the camera position in the local frame
+			_invMatrixWorld.copy( this.matrixWorld ).invert();
+			_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _invMatrixWorld );
 
 
 			for ( let i = 0, l = visibility.length; i < l; i ++ ) {
 			for ( let i = 0, l = visibility.length; i < l; i ++ ) {
 
 
@@ -33796,6 +33809,12 @@ class BatchedMesh extends Mesh {
 
 
 	}
 	}
 
 
+	onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {
+
+		this.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );
+
+	}
+
 }
 }
 
 
 class LineBasicMaterial extends Material {
 class LineBasicMaterial extends Material {

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
build/three.module.min.js


Неке датотеке нису приказане због велике количине промена