فهرست منبع

Updated builds.

Mr.doob 4 هفته پیش
والد
کامیت
367d779305
7فایلهای تغییر یافته به همراه88 افزوده شده و 34 حذف شده
  1. 6 0
      build/three.cjs
  2. 6 0
      build/three.core.js
  3. 0 0
      build/three.core.min.js
  4. 38 17
      build/three.webgpu.js
  5. 0 0
      build/three.webgpu.min.js
  6. 38 17
      build/three.webgpu.nodes.js
  7. 0 0
      build/three.webgpu.nodes.min.js

+ 6 - 0
build/three.cjs

@@ -14756,6 +14756,9 @@ class Object3D extends EventDispatcher {
 
 
 		if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
 		if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
 
 
+		if ( this.morphTargetDictionary !== undefined ) object.morphTargetDictionary = Object.assign( {}, this.morphTargetDictionary );
+		if ( this.morphTargetInfluences !== undefined ) object.morphTargetInfluences = this.morphTargetInfluences.slice();
+
 		// object specific properties
 		// object specific properties
 
 
 		if ( this.isInstancedMesh ) {
 		if ( this.isInstancedMesh ) {
@@ -49390,6 +49393,9 @@ class ObjectLoader extends Loader {
 
 
 		if ( data.pivot !== undefined ) object.pivot = new Vector3().fromArray( data.pivot );
 		if ( data.pivot !== undefined ) object.pivot = new Vector3().fromArray( data.pivot );
 
 
+		if ( data.morphTargetDictionary !== undefined ) object.morphTargetDictionary = Object.assign( {}, data.morphTargetDictionary );
+		if ( data.morphTargetInfluences !== undefined ) object.morphTargetInfluences = data.morphTargetInfluences.slice();
+
 		if ( data.castShadow !== undefined ) object.castShadow = data.castShadow;
 		if ( data.castShadow !== undefined ) object.castShadow = data.castShadow;
 		if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;
 		if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;
 
 

+ 6 - 0
build/three.core.js

@@ -14754,6 +14754,9 @@ class Object3D extends EventDispatcher {
 
 
 		if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
 		if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
 
 
+		if ( this.morphTargetDictionary !== undefined ) object.morphTargetDictionary = Object.assign( {}, this.morphTargetDictionary );
+		if ( this.morphTargetInfluences !== undefined ) object.morphTargetInfluences = this.morphTargetInfluences.slice();
+
 		// object specific properties
 		// object specific properties
 
 
 		if ( this.isInstancedMesh ) {
 		if ( this.isInstancedMesh ) {
@@ -49388,6 +49391,9 @@ class ObjectLoader extends Loader {
 
 
 		if ( data.pivot !== undefined ) object.pivot = new Vector3().fromArray( data.pivot );
 		if ( data.pivot !== undefined ) object.pivot = new Vector3().fromArray( data.pivot );
 
 
+		if ( data.morphTargetDictionary !== undefined ) object.morphTargetDictionary = Object.assign( {}, data.morphTargetDictionary );
+		if ( data.morphTargetInfluences !== undefined ) object.morphTargetInfluences = data.morphTargetInfluences.slice();
+
 		if ( data.castShadow !== undefined ) object.castShadow = data.castShadow;
 		if ( data.castShadow !== undefined ) object.castShadow = data.castShadow;
 		if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;
 		if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
build/three.core.min.js


+ 38 - 17
build/three.webgpu.js

@@ -14205,7 +14205,7 @@ const normalViewGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( builder.material.flatShading === true ) {
+	if ( builder.isFlatShading() ) {
 
 
 		node = normalFlat;
 		node = normalFlat;
 
 
@@ -14229,7 +14229,7 @@ const normalWorldGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let normal = normalViewGeometry.transformDirection( cameraViewMatrix );
 	let normal = normalViewGeometry.transformDirection( cameraViewMatrix );
 
 
-	if ( builder.material.flatShading !== true ) {
+	if ( builder.isFlatShading() !== true ) {
 
 
 		normal = normal.toVarying( 'v_normalWorldGeometry' );
 		normal = normal.toVarying( 'v_normalWorldGeometry' );
 
 
@@ -14245,15 +14245,15 @@ const normalWorldGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
  * @tsl
  * @tsl
  * @type {Node<vec3>}
  * @type {Node<vec3>}
  */
  */
-const normalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, material, context } ) => {
+const normalView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) {
+	if ( builder.subBuildFn === 'NORMAL' || builder.subBuildFn === 'VERTEX' ) {
 
 
 		node = normalViewGeometry;
 		node = normalViewGeometry;
 
 
-		if ( material.flatShading !== true ) {
+		if ( builder.isFlatShading() !== true ) {
 
 
 			node = directionToFaceDirection( node );
 			node = directionToFaceDirection( node );
 
 
@@ -14263,7 +14263,7 @@ const normalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, material, context } ) =>
 
 
 		// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
 		// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
 
 
-		node = context.setupNormal().context( { getUV: null } );
+		node = builder.context.setupNormal().context( { getUV: null } );
 
 
 	}
 	}
 
 
@@ -15239,11 +15239,11 @@ const tangentLocal = /*@__PURE__*/ tangentGeometry.xyz.toVar( 'tangentLocal' );
  * @tsl
  * @tsl
  * @type {Node<vec3>}
  * @type {Node<vec3>}
  */
  */
-const tangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) => {
+const tangentView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
+	if ( builder.subBuildFn === 'VERTEX' || builder.geometry.hasAttribute( 'tangent' ) ) {
 
 
 		node = modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize();
 		node = modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize();
 
 
@@ -15253,7 +15253,7 @@ const tangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) =
 
 
 	}
 	}
 
 
-	if ( material.flatShading !== true ) {
+	if ( builder.isFlatShading() !== true ) {
 
 
 		node = directionToFaceDirection( node );
 		node = directionToFaceDirection( node );
 
 
@@ -15280,11 +15280,11 @@ const tangentWorld = /*@__PURE__*/ tangentView.transformDirection( cameraViewMat
  * @param {string} varyingName - The name of the varying to assign the bitangent to.
  * @param {string} varyingName - The name of the varying to assign the bitangent to.
  * @returns {Node<vec3>} The bitangent node.
  * @returns {Node<vec3>} The bitangent node.
  */
  */
-const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], { subBuildFn, material } ) => {
+const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], builder ) => {
 
 
 	let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz;
 	let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz;
 
 
-	if ( subBuildFn === 'NORMAL' && material.flatShading !== true ) {
+	if ( builder.subBuildFn === 'NORMAL' && builder.isFlatShading() !== true ) {
 
 
 		bitangent = bitangent.toVarying( varyingName );
 		bitangent = bitangent.toVarying( varyingName );
 
 
@@ -15316,11 +15316,11 @@ const bitangentLocal = /*@__PURE__*/ getBitangent( normalLocal.cross( tangentLoc
  * @tsl
  * @tsl
  * @type {Node<vec3>}
  * @type {Node<vec3>}
  */
  */
-const bitangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) => {
+const bitangentView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
+	if ( builder.subBuildFn === 'VERTEX' || builder.geometry.hasAttribute( 'tangent' ) ) {
 
 
 		node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize();
 		node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize();
 
 
@@ -15330,7 +15330,7 @@ const bitangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } )
 
 
 	}
 	}
 
 
-	if ( material.flatShading !== true ) {
+	if ( builder.isFlatShading() !== true ) {
 
 
 		node = directionToFaceDirection( node );
 		node = directionToFaceDirection( node );
 
 
@@ -15485,7 +15485,7 @@ class NormalMapNode extends TempNode {
 
 
 	}
 	}
 
 
-	setup( { material } ) {
+	setup( builder ) {
 
 
 		const { normalMapType, scaleNode, unpackNormalMode } = this;
 		const { normalMapType, scaleNode, unpackNormalMode } = this;
 
 
@@ -15521,7 +15521,7 @@ class NormalMapNode extends TempNode {
 
 
 			let scale = scaleNode;
 			let scale = scaleNode;
 
 
-			if ( material.flatShading === true ) {
+			if ( builder.isFlatShading() === true ) {
 
 
 				scale = directionToFaceDirection( scale );
 				scale = directionToFaceDirection( scale );
 
 
@@ -49771,6 +49771,17 @@ class NodeBuilder {
 
 
 	}
 	}
 
 
+	/**
+	 * Whether the material is using flat shading or not.
+	 *
+	 * @returns {boolean} Whether the material is using flat shading or not.
+	 */
+	isFlatShading() {
+
+		return this.material.flatShading === true || this.geometry.hasAttribute( 'normal' ) === false;
+
+	}
+
 	/**
 	/**
 	 * Whether the material is opaque or not.
 	 * Whether the material is opaque or not.
 	 *
 	 *
@@ -72172,7 +72183,17 @@ class WebGPUTextureUtils {
 
 
 		}
 		}
 
 
-		textureData.texture = backend.device.createTexture( textureDescriptorGPU );
+		try {
+
+			textureData.texture = backend.device.createTexture( textureDescriptorGPU );
+
+		} catch ( e ) {
+
+			warn( 'WebGPURenderer: Failed to create texture with descriptor:', textureDescriptorGPU );
+			this.createDefaultTexture( texture );
+			return;
+
+		}
 
 
 		if ( isMSAA ) {
 		if ( isMSAA ) {
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
build/three.webgpu.min.js


+ 38 - 17
build/three.webgpu.nodes.js

@@ -14205,7 +14205,7 @@ const normalViewGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( builder.material.flatShading === true ) {
+	if ( builder.isFlatShading() ) {
 
 
 		node = normalFlat;
 		node = normalFlat;
 
 
@@ -14229,7 +14229,7 @@ const normalWorldGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let normal = normalViewGeometry.transformDirection( cameraViewMatrix );
 	let normal = normalViewGeometry.transformDirection( cameraViewMatrix );
 
 
-	if ( builder.material.flatShading !== true ) {
+	if ( builder.isFlatShading() !== true ) {
 
 
 		normal = normal.toVarying( 'v_normalWorldGeometry' );
 		normal = normal.toVarying( 'v_normalWorldGeometry' );
 
 
@@ -14245,15 +14245,15 @@ const normalWorldGeometry = /*@__PURE__*/ ( Fn( ( builder ) => {
  * @tsl
  * @tsl
  * @type {Node<vec3>}
  * @type {Node<vec3>}
  */
  */
-const normalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, material, context } ) => {
+const normalView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) {
+	if ( builder.subBuildFn === 'NORMAL' || builder.subBuildFn === 'VERTEX' ) {
 
 
 		node = normalViewGeometry;
 		node = normalViewGeometry;
 
 
-		if ( material.flatShading !== true ) {
+		if ( builder.isFlatShading() !== true ) {
 
 
 			node = directionToFaceDirection( node );
 			node = directionToFaceDirection( node );
 
 
@@ -14263,7 +14263,7 @@ const normalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, material, context } ) =>
 
 
 		// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
 		// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
 
 
-		node = context.setupNormal().context( { getUV: null } );
+		node = builder.context.setupNormal().context( { getUV: null } );
 
 
 	}
 	}
 
 
@@ -15239,11 +15239,11 @@ const tangentLocal = /*@__PURE__*/ tangentGeometry.xyz.toVar( 'tangentLocal' );
  * @tsl
  * @tsl
  * @type {Node<vec3>}
  * @type {Node<vec3>}
  */
  */
-const tangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) => {
+const tangentView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
+	if ( builder.subBuildFn === 'VERTEX' || builder.geometry.hasAttribute( 'tangent' ) ) {
 
 
 		node = modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize();
 		node = modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize();
 
 
@@ -15253,7 +15253,7 @@ const tangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) =
 
 
 	}
 	}
 
 
-	if ( material.flatShading !== true ) {
+	if ( builder.isFlatShading() !== true ) {
 
 
 		node = directionToFaceDirection( node );
 		node = directionToFaceDirection( node );
 
 
@@ -15280,11 +15280,11 @@ const tangentWorld = /*@__PURE__*/ tangentView.transformDirection( cameraViewMat
  * @param {string} varyingName - The name of the varying to assign the bitangent to.
  * @param {string} varyingName - The name of the varying to assign the bitangent to.
  * @returns {Node<vec3>} The bitangent node.
  * @returns {Node<vec3>} The bitangent node.
  */
  */
-const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], { subBuildFn, material } ) => {
+const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], builder ) => {
 
 
 	let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz;
 	let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz;
 
 
-	if ( subBuildFn === 'NORMAL' && material.flatShading !== true ) {
+	if ( builder.subBuildFn === 'NORMAL' && builder.isFlatShading() !== true ) {
 
 
 		bitangent = bitangent.toVarying( varyingName );
 		bitangent = bitangent.toVarying( varyingName );
 
 
@@ -15316,11 +15316,11 @@ const bitangentLocal = /*@__PURE__*/ getBitangent( normalLocal.cross( tangentLoc
  * @tsl
  * @tsl
  * @type {Node<vec3>}
  * @type {Node<vec3>}
  */
  */
-const bitangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) => {
+const bitangentView = /*@__PURE__*/ ( Fn( ( builder ) => {
 
 
 	let node;
 	let node;
 
 
-	if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
+	if ( builder.subBuildFn === 'VERTEX' || builder.geometry.hasAttribute( 'tangent' ) ) {
 
 
 		node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize();
 		node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize();
 
 
@@ -15330,7 +15330,7 @@ const bitangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } )
 
 
 	}
 	}
 
 
-	if ( material.flatShading !== true ) {
+	if ( builder.isFlatShading() !== true ) {
 
 
 		node = directionToFaceDirection( node );
 		node = directionToFaceDirection( node );
 
 
@@ -15485,7 +15485,7 @@ class NormalMapNode extends TempNode {
 
 
 	}
 	}
 
 
-	setup( { material } ) {
+	setup( builder ) {
 
 
 		const { normalMapType, scaleNode, unpackNormalMode } = this;
 		const { normalMapType, scaleNode, unpackNormalMode } = this;
 
 
@@ -15521,7 +15521,7 @@ class NormalMapNode extends TempNode {
 
 
 			let scale = scaleNode;
 			let scale = scaleNode;
 
 
-			if ( material.flatShading === true ) {
+			if ( builder.isFlatShading() === true ) {
 
 
 				scale = directionToFaceDirection( scale );
 				scale = directionToFaceDirection( scale );
 
 
@@ -49771,6 +49771,17 @@ class NodeBuilder {
 
 
 	}
 	}
 
 
+	/**
+	 * Whether the material is using flat shading or not.
+	 *
+	 * @returns {boolean} Whether the material is using flat shading or not.
+	 */
+	isFlatShading() {
+
+		return this.material.flatShading === true || this.geometry.hasAttribute( 'normal' ) === false;
+
+	}
+
 	/**
 	/**
 	 * Whether the material is opaque or not.
 	 * Whether the material is opaque or not.
 	 *
 	 *
@@ -72172,7 +72183,17 @@ class WebGPUTextureUtils {
 
 
 		}
 		}
 
 
-		textureData.texture = backend.device.createTexture( textureDescriptorGPU );
+		try {
+
+			textureData.texture = backend.device.createTexture( textureDescriptorGPU );
+
+		} catch ( e ) {
+
+			warn( 'WebGPURenderer: Failed to create texture with descriptor:', textureDescriptorGPU );
+			this.createDefaultTexture( texture );
+			return;
+
+		}
 
 
 		if ( isMSAA ) {
 		if ( isMSAA ) {
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
build/three.webgpu.nodes.min.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است

粤ICP备19079148号