Browse Source

Typos (#31732)

Co-authored-by: Samuel Rigaud <rigaud@gmail.com>
Samuel Rigaud 7 months ago
parent
commit
43063dfea1

+ 1 - 1
examples/jsm/tsl/display/BloomNode.js

@@ -364,7 +364,7 @@ class BloomNode extends TempNode {
 
 		// gaussian blur materials
 
-		// These sizes have been changed to account for the altered coefficents-calculation to avoid blockiness,
+		// These sizes have been changed to account for the altered coefficients-calculation to avoid blockiness,
 		// while retaining the same blur-strength. For details see https://github.com/mrdoob/three.js/pull/31528
 		const kernelSizeArray = [ 6, 10, 14, 18, 22 ];
 

+ 1 - 1
examples/jsm/tsl/display/SSRNode.js

@@ -123,7 +123,7 @@ class SSRNode extends TempNode {
 		 * of raymarching iterations/samples) and `0` means no samples at all.
 		 *
 		 * A quality of `0.5` is usually sufficient for most use cases. Try to keep
-		 * this parameter as low as possible. Larger values result in noticable more
+		 * this parameter as low as possible. Larger values result in noticeable more
 		 * overhead.
 		 *
 		 * @type {UniformNode<float>}

+ 1 - 1
examples/jsm/tsl/display/boxBlur.js

@@ -7,7 +7,7 @@ import { Fn, vec2, uv, Loop, vec4, premultiplyAlpha, unpremultiplyAlpha, max, in
  * configured. It is intended for mobile devices or performance restricted use cases where Gaussian is too heavy.
  *
  * The (kernel) `size` parameter should be small (1, 2 or 3) since it determines the number of samples based on (size * 2 + 1)^2.
- * This implementation uses a single pass approach so the kernel is not applied as a seprabable filter. That means larger
+ * This implementation uses a single pass approach so the kernel is not applied as a separable filter. That means larger
  * kernels won't perform well. Use Gaussian instead if you need a more high-quality blur.
  *
  * To produce wider blurs, increase the `separation` parameter instead which has no influence on the performance.

+ 1 - 1
examples/webgpu_compute_cloth.html

@@ -69,7 +69,7 @@
 			};
 
 			// TODO: Fix example with WebGL backend
-			
+
 			if ( WebGPU.isAvailable() === false ) {
 
 				document.body.appendChild( WebGPU.getErrorMessage() );

+ 47 - 47
examples/webgpu_compute_reduce.html

@@ -50,13 +50,13 @@
 			justify-content: center;
 			margin-bottom: 5px;
 		}
-		
+
 		.stage-label {
 			font-size: 1.2em;
 			color: #aaa;
 			font-style: bold;
 			margin-top: 6px;
-			margin-bottom: 20px; 
+			margin-bottom: 20px;
 		}
 
 		.thread {
@@ -81,10 +81,10 @@
 			white-space: nowrap;
 			overflow: hidden;
 			text-overflow: ellipsis;
-			font-size: clamp(8px, 2vw, 14px); 
+			font-size: clamp(8px, 2vw, 14px);
 			text-align: center;
 		}
-		
+
 		.subgroup {
 			display: flex;
 			position: relative;
@@ -96,9 +96,9 @@
 			/* label text for each subgroup label */
 			content: "subgroupAdd()";
 			position: absolute;
-			top: -20px; 
+			top: -20px;
 			/* Hide until animation is displayed */
-			opacity: 0; 
+			opacity: 0;
 			z-index: 100;
 			transition: opacity 0.5s ease;
 			font-weight: bold;
@@ -119,7 +119,7 @@
 		.reduction-stage {
 			margin-bottom: 20px;
 		}
-		
+
 		@keyframes labelAbsorb {
 			0% {
 				opacity: 0;
@@ -149,7 +149,7 @@
 			animation-duration: 1.5s;
 			transition:
 			transform 0.6s ease-out,
-			opacity 0.3s ease-in 0.3s; 
+			opacity 0.3s ease-in 0.3s;
 		}
 
 	</style>
@@ -164,7 +164,7 @@
 			<div id="left_side_display" style="position: absolute;top: 150px;left: 0;padding: 10px;background: rgba( 0, 0, 0, 0.5 );color: #fff;font-family: monospace;font-size: 12px;line-height: 1.5;pointer-events: none;text-align: left;"></div>
 			<div id="right_side_display" style="position: absolute;top: 150px;right: 0;padding: 10px;background: rgba( 0, 0, 0, 0.5 );color: #fff;font-family: monospace;font-size: 12px;line-height: 1.5;pointer-events: none;text-align: left;"></div>
 		</div>
-		
+
 		<div id="reduction-panel">
 			<h3 id="panel-title" style="flex: 0 0 auto;">Subgroup Reduction Explanation</h3>
 			<div class="reduction-stage" id="subgroup-reduction-stage">
@@ -248,7 +248,7 @@
 					currentSubgroupDiv.setAttribute( 'data-label', `Threads ${currentSubgroupIndex * cssSubgroupSize}-${( currentSubgroupIndex + 1 ) * cssSubgroupSize - 1}` );
 					initialSubgroups.push( currentSubgroupDiv );
 					workgroupThreadsContainer.appendChild( currentSubgroupDiv );
-			
+
 				}
 
 				const data = Math.floor( Math.random() * 9 ) + 1;
@@ -257,7 +257,7 @@
 				const thread = createThreadWithData( data );
 				workgroupThreads.push( thread );
 				currentSubgroupDiv.appendChild( thread );
-			
+
 			}
 
 			const deactivateLabelAnimation = ( subgroupDiv, idx ) => {
@@ -267,7 +267,7 @@
 				const subgroupReductionBufferElement = document.getElementById( `subgroup_reduction_element_${idx}` ).querySelector( '.thread_data' );
 
 				subgroupReductionBufferElement.innerHTML = 0;
-			
+
 			};
 
 			const activateLabelAnimation = ( subgroupDiv, idx ) => {
@@ -311,7 +311,7 @@
 				initialSubgroups.forEach( ( subgroupDiv, idx ) => {
 
 					activateLabelAnimation( subgroupDiv, idx );
-			
+
 				} );
 
 			} );
@@ -321,7 +321,7 @@
 				initialSubgroups.forEach( ( subgroupDiv, idx ) => {
 
 					deactivateLabelAnimation( subgroupDiv, idx );
-			
+
 				} );
 
 				workgroupThreads.forEach( ( thread, idx ) => {
@@ -331,8 +331,8 @@
 				} );
 
 			} );
-			
-			
+
+
 			if ( WebGPU.isAvailable() === false ) {
 
 				document.body.appendChild( WebGPU.getErrorMessage() );
@@ -377,7 +377,7 @@
 				loggedBuffer: 'Input Buffer',
 				elementsReduced: size,
 			};
-			
+
 
 			const leftEffectController = {
 				// Current reduction algorithm being executed by this side
@@ -386,11 +386,11 @@
 				highlight: uniform( 0 ),
 				// Uniform that corresponds to the index of the current algorithm within the algorithms array
 				currentAlgo: uniform( 0 ),
-				// Current state of reduction (Running, validating, reseting)
+				// Current state of reduction (Running, validating, resetting)
 				state: 'Run Algo',
 				// Current display mode
 				displayMode: 'Input Log2',
-				// Reduce 0 specfic uniform
+				// Reduce 0 specific uniform
 				numThreadsDispatched: uniform( size / 2 ),
 				// The subgroup size used by this side's device
 			};
@@ -414,7 +414,7 @@
 			gui.add( leftEffectController, 'algo', algorithms ).onChange( () => {
 
 				leftEffectController.currentAlgo.value = algorithms.findIndex( val => val === leftEffectController.algo );
-			
+
 			} );
 
 			gui.add( rightEffectController, 'algo', algorithms ).onChange( () => {
@@ -524,11 +524,11 @@
 				} )().compute( dispatchSize, [ workgroupSize ] );
 
 				return fnDef;
-			
+
 			};
 
 			// REDUCE 2
-			
+
 			// For non power of 2 # of workgroups
 			const createReduce2Fn = ( createReduce2FnProps ) => {
 
@@ -620,7 +620,7 @@
 							total.addAssign( inputElement );
 
 						}
-			
+
 						// Increment up a thread
 						localThreadOffset.addAssign( 1 );
 
@@ -632,13 +632,13 @@
 				} );
 
 				// Ignoring left over check for this example, since we know ahead of time the value of leftover (2048 % 1024 === 0)
-			
+
 			};
 
 			const WorkgroupReduce = ( workgroupReduceProps ) => {
 
 				const { total, workgroupSize } = workgroupReduceProps;
-			
+
 				const subgroupSums = createSubgroupArray( 'uint', workgroupSize );
 
 				// Assign sum of all values in subgroup to total
@@ -651,7 +651,7 @@
 				Loop( float( delta ).greaterThan( 1.0 ), () => {
 
 					If( invocationSubgroupIndex.equal( 0 ), () => {
-			
+
 						// Each subgroup will populate the subgroupSums array
 						subgroupSums.element( subgroupMetaRank ).assign( total );
 
@@ -679,7 +679,7 @@
 
 					const inputSize = uint( inputBuffer.bufferCount.length );
 					const rowOffset = workgroupId.x.mul( rowSize );
-			
+
 					// If the current rows elements exceed the bounds of the input
 					// Select either 0 or number of elements left,
 					// otherwise, select existing ROW_SIZE
@@ -709,7 +709,7 @@
 					If( invocationLocalIndex.equal( 0 ), () => {
 
 						intermediateBuffer.element( workgroupId.x ).assign( total );
-			
+
 					} );
 
 				} )();
@@ -719,7 +719,7 @@
 			};
 
 			// REDUCE 4
-			
+
 			// b0nes164 inspired implementation with vec4
 			const createReduce4Fn = ( props ) => {
 
@@ -741,9 +741,9 @@
 
 					// Get the index of the subgroup within the workgroup
 					const subgroupMetaRank = invocationLocalIndex.div( subgroupSize );
-			
+
 					// Each subgroup block scans across 4 subgroups. So when we move into a new subgroup,
-					// align that subgroups' acccesses to the next 4 subgroups
+					// align that subgroups' accesses to the next 4 subgroups
 					const subgroupOffset = subgroupMetaRank.mul( subgroupSize ).mul( workPerThread );
 					subgroupOffset.addAssign( invocationSubgroupIndex );
 
@@ -751,7 +751,7 @@
 					const workgroupOffset = workgroupId.x.mul( uint( maxWorkgroupSize ).mul( workPerThread ) );
 
 					const startThread = subgroupOffset.add( workgroupOffset );
-			
+
 					const subgroupReduction = uint( 0 );
 
 					// Each thread will accumulate values from across 'workPerThread' subgroups
@@ -773,9 +773,9 @@
 
 							// Increment so thread will scan value in next subgroup
 							startThread.addAssign( subgroupSize );
-			
+
 						} );
-			
+
 					} );
 
 					// Ensure that the last workgroup does not access out of bounds indices
@@ -791,12 +791,12 @@
 
 							// Ensure index is less than number of available vectors in inputBuffer
 							const val = select( startThread.lessThan( uint( vecSize ) ), inputBuffer.element( startThread ), uvec4( 0 ) ).uniformFlow();
-			
+
 							subgroupReduction.addAssign( dot( val, uvec4( 1 ) ) );
 							startThread.addAssign( subgroupSize );
-			
+
 						} );
-			
+
 					} );
 
 					subgroupReduction.assign( subgroupAdd( subgroupReduction ) );
@@ -896,7 +896,7 @@
 				return fnDef;
 
 			};
-			
+
 
 			// INCORRECT BASELINE
 
@@ -911,7 +911,7 @@
 				} )();
 
 				return fnDef;
-			
+
 			};
 
 
@@ -940,7 +940,7 @@
 				// Represents array of data as vec4s in compute shader;
 				const inputVec4BufferAttribute = new THREE.StorageInstancedBufferAttribute( array, 4 );
 				const inputVectorizedStorage = storage( inputVec4BufferAttribute, 'uvec4', vecSize ).setPBO( true ).setName( `CurrentVectorized_${leftSideDisplay ? 'Left' : 'Right'}` );
-			
+
 				// Reduce 3 Calculations
 				const workPerThread = 4;
 				const numRows = workPerThread * 32;
@@ -972,7 +972,7 @@
 				const computeResetBufferFn = Fn( () => {
 
 					inputStorage.element( instanceIndex ).assign( 1 );
-			
+
 				} );
 
 				const computeResetWorkgroupSumsFn = Fn( () => {
@@ -980,7 +980,7 @@
 					workgroupSumsStorage.element( instanceIndex ).assign( 0 );
 
 				} );
-			
+
 
 				// Re-initialize compute buffer
 				const computeResetBuffer = computeResetBufferFn().compute( size );
@@ -1102,7 +1102,7 @@
 						inputBuffer: inputStorage,
 					} ).compute( size ),
 				];
-			
+
 				const calls = {
 					'Reduce 0 (N/2)': reduce0Calls,
 					'Reduce 1 (Naive Accumulate)': reduce1Calls,
@@ -1168,7 +1168,7 @@
 
 					const colorChanger = uint( 0 ).toVar();
 					const color = vec3( 0 ).toVar( 'color' );
-			
+
 					colorChanger.assign( inputStorage.element( uint( 1 ).shiftLeft( newUV.x ) ) );
 					color.assign( getColor( inputStorage, colorChanger, gridElementWidth, gridElementHeight ) );
 
@@ -1187,7 +1187,7 @@
 					colorChanger.assign( clamp( inputStorage.element( 0 ), 0, size / 2 ) );
 					color.assign( getColor( inputStorage, colorChanger, gridElementWidth, gridElementHeight ) );
 					return color;
-			
+
 				} )();
 
 				displayNodes[ 'Workgroup Sum Grid' ] = Fn( () => {
@@ -1264,7 +1264,7 @@
 						const cpuTime = 0;
 
 						switch ( currentAlgorithm ) {
-			
+
 							case 'Reduce 0 (N/2)': {
 
 								let m = size / 2;
@@ -1318,7 +1318,7 @@
 
 						}
 
-			
+
 
 
 						timestamps[ leftSideDisplay ? 'left_side_display' : 'right_side_display' ].innerHTML = `

+ 9 - 9
examples/webgpu_postprocessing_ssr.html

@@ -14,7 +14,7 @@
 
 	<div id="info">
 		<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> webgpu - postprocessing - screen space reflections<br />
-		<a href="https://skfb.ly/6tqYD" target="_blank" rel="noopener">Steampunk Camera</a> by 
+		<a href="https://skfb.ly/6tqYD" target="_blank" rel="noopener">Steampunk Camera</a> by
 		<a href="https://sketchfab.com/lumoize" target="_blank" rel="noopener">dylanheyes</a> is licensed under <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener">Creative Commons Attribution</a>.<br />
 	</div>
 
@@ -69,7 +69,7 @@
 			const dracoLoader = new DRACOLoader();
 			dracoLoader.setDecoderPath( 'jsm/libs/draco/' );
 			dracoLoader.setDecoderConfig( { type: 'js' } );
-		
+
 			const loader = new GLTFLoader();
 			loader.setDRACOLoader( dracoLoader );
 			loader.load( 'models/gltf/steampunk_camera.glb', function ( gltf ) {
@@ -90,9 +90,9 @@
 						object.material.side = THREE.FrontSide;
 
 					}
-		
+
 				} );
-		
+
 				model.position.y = 0.1;
 				scene.add( model );
 
@@ -124,7 +124,7 @@
 			scenePass.setMRT( mrt( {
 				output: output,
 				normal: directionToColor( normalView ),
-				metalrough: vec2( metalness, roughness ) // pack metalness and roughness into a single attachement
+				metalrough: vec2( metalness, roughness ) // pack metalness and roughness into a single attachment
 			} ) );
 
 			const scenePassColor = scenePass.getTextureNode( 'output' );
@@ -153,7 +153,7 @@
 			// blend SSR over beauty
 
 			const outputNode = smaa( blendColor( scenePassColor, ssrPass ) );
-		
+
 			postProcessing.outputNode = outputNode;
 
 			//
@@ -201,13 +201,13 @@
 					if ( object.material ) {
 
 						object.material.roughness = value;
-		
+
 					}
-		
+
 				} );
 
 			} );
-		
+
 			updateParameters();
 
 		}

+ 1 - 1
src/extras/lib/earcut.js

@@ -487,7 +487,7 @@ function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {
 
 // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
 function isValidDiagonal(a, b) {
-    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
+    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges
            (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
             (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
             equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case

+ 1 - 1
src/nodes/display/PassNode.js

@@ -638,7 +638,7 @@ class PassNode extends TempNode {
 	/**
 	 * Precompiles the pass.
 	 *
-	 * Note that this method must be called after the pass configuartion is complete.
+	 * Note that this method must be called after the pass configuration is complete.
 	 * So calls like `setMRT()` and `getTextureNode()` must proceed the precompilation.
 	 *
 	 * @async

粤ICP备19079148号