Просмотр исходного кода

fix typos (#31447)

Co-authored-by: Samuel Rigaud <rigaud@gmail.com>
Samuel Rigaud 7 месяцев назад
Родитель
Сommit
4870f070c7

+ 1 - 1
examples/jsm/transpiler/GLSLDecoder.js

@@ -861,7 +861,7 @@ class GLSLDecoder {
 
 		const switchDeterminantTokens = this.readTokensUntil( ')' );
 
-		// Parse expresison between parentheses. Index 1: char after '('. Index -1: char before ')'
+		// Parse expression between parentheses. Index 1: char after '('. Index -1: char before ')'
 		const discriminant = this.parseExpressionFromTokens( switchDeterminantTokens.slice( 1, - 1 ) );
 
 		// Validate curly braces

+ 1 - 1
examples/webgl_loader_obj.html

@@ -56,7 +56,7 @@
 				materials.preload();
 
 				const objLoader = new OBJLoader().setPath( 'models/obj/male02/' );
-				objLoader.setMaterials( materials ); // optional since OBJ asstes can be loaded without an accompanying MTL file
+				objLoader.setMaterials( materials ); // optional since OBJ assets can be loaded without an accompanying MTL file
 
 				const object = await objLoader.loadAsync( 'male02.obj' );
 

+ 1 - 1
examples/webgl_tonemapping.html

@@ -94,7 +94,7 @@
 				scene = new THREE.Scene();
 				scene.backgroundBlurriness = params.blurriness;
 
-				const light = new THREE.DirectionalLight( 0xfff3ee, 3 ); // simualte sun
+				const light = new THREE.DirectionalLight( 0xfff3ee, 3 ); // simulate sun
 				light.position.set( 1, 0.05, 0.7 );
 				scene.add( light );
 

+ 16 - 16
examples/webgpu_centroid_sampling.html

@@ -25,7 +25,7 @@
 			align-items: center;
 		}
 
-		#antialising-disabled {
+		#antialiasing-disabled {
 			border-right: 1px solid black;
 		}
 
@@ -36,11 +36,11 @@
 	</style>
 	<body>
 		<div id="demo">
-			<div id="antialising-disabled" class="renderer-wrapper">
-				<div>antialising disabled</div>
+			<div id="antialiasing-disabled" class="renderer-wrapper">
+				<div>antialiasing disabled</div>
 			</div>
-			<div id="antialising-enabled" class="renderer-wrapper">
-				<div>antialising enabled</div>
+			<div id="antialiasing-enabled" class="renderer-wrapper">
+				<div>antialiasing enabled</div>
 			</div>
 		</div>
 
@@ -140,7 +140,7 @@
 					);
 
 					return geometry;
-			
+
 				};
 
 				const material = new THREE.MeshBasicNodeMaterial();
@@ -197,9 +197,9 @@
 						mesh.position.set( x * 2, y * 2, 0 );
 						faceMeshes.push( mesh );
 						scene.add( mesh );
-			
+
 					}
-			
+
 				}
 
 				// Create Standard Renderer
@@ -218,13 +218,13 @@
 					forceWebGL: forceWebGL
 				} );
 
-				document.body.querySelector( '#antialising-enabled' ).appendChild( rendererAntialiasingEnabled.domElement );
+				document.body.querySelector( '#antialiasing-enabled' ).appendChild( rendererAntialiasingEnabled.domElement );
 				rendererAntialiasingEnabled.setPixelRatio( window.devicePixelRatio );
 				rendererAntialiasingEnabled.setSize( window.innerWidth / 2, window.innerHeight );
 				rendererAntialiasingEnabled.setAnimationLoop( animateAliased );
-			
-				document.body.querySelector( '#antialising-disabled' ).appendChild( rendererAntialiasingDisabled.domElement );
-				document.body.querySelector( '#antialising-disabled' ).appendChild( rendererAntialiasingDisabled.domElement );
+
+				document.body.querySelector( '#antialiasing-disabled' ).appendChild( rendererAntialiasingDisabled.domElement );
+				document.body.querySelector( '#antialiasing-disabled' ).appendChild( rendererAntialiasingDisabled.domElement );
 
 				onWindowResize();
 
@@ -256,7 +256,7 @@
 
 					}
 
-			
+
 				} );
 
 			}
@@ -267,7 +267,7 @@
 				rendererAntialiasingDisabled.setSize( halfWidth, window.innerHeight );
 				rendererAntialiasingEnabled.setSize( halfWidth, window.innerHeight );
 				const aspect = ( halfWidth ) / window.innerHeight;
-			
+
 				camera.aspect = aspect;
 				camera.updateProjectionMatrix();
 
@@ -276,13 +276,13 @@
 			function animateStandard() {
 
 				rendererAntialiasingDisabled.render( scene, camera );
-			
+
 			}
 
 			function animateAliased() {
 
 				rendererAntialiasingEnabled.render( scene, camera );
-			
+
 			}
 
 		</script>

+ 13 - 13
examples/webgpu_compute_water.html

@@ -151,7 +151,7 @@
 					// Get 2-D compute coordinate from one-dimensional instanceIndex. The calculation will
 					// still work even if you dispatch your compute shader 2-dimensionally, since within a compute
 					// context, instanceIndex is a 1-dimensional value derived from the workgroup dimensions.
-			
+
 					// Cast to int to prevent unintended index overflow upon subtraction.
 					const x = int( index.mod( WIDTH ) );
 					const y = int( index.div( WIDTH ) );
@@ -168,7 +168,7 @@
 
 					const westIndex = y.mul( width ).add( leftX );
 					const eastIndex = y.mul( width ).add( rightX );
-			
+
 					const southIndex = bottomY.mul( width ).add( x );
 					const northIndex = topY.mul( width ).add( x );
 
@@ -283,7 +283,7 @@
 				meshRay.matrixAutoUpdate = false;
 				meshRay.updateMatrix();
 				scene.add( meshRay );
-			
+
 				// Initialize sphere mesh instance position and velocity.
 				// position<vec3> + velocity<vec2> + unused<vec3> = 8 floats per sphere.
 				// for structs arrays must be enclosed in multiple of 4
@@ -339,7 +339,7 @@
 					const targetY = waterHeight.add( yOffset );
 
 					const deltaY = targetY.sub( instancePosition.y );
-					instancePosition.y.addAssign( deltaY.mul( verticalResponseFactor ) ); // Atualiza Y gradualmente
+					instancePosition.y.addAssign( deltaY.mul( verticalResponseFactor ) ); // Gradually update position
 
 					// Get the normal of the water surface at the duck's position
 					const pushX = normalX.mul( waterPushFactor );
@@ -373,7 +373,7 @@
 					If( instancePosition.z.lessThan( - limit ), () => {
 
 						instancePosition.z = - limit;
-						velocity.y.mulAssign( bounceDamping ); // Inverte e amortece vz (velocity.y)
+						velocity.y.mulAssign( bounceDamping ); // Invert and damp vz (velocity.y)
 
 					} ).ElseIf( instancePosition.z.greaterThan( limit ), () => {
 
@@ -448,18 +448,18 @@
 				gui.add( effectController.viscosity, 'value', 0.9, 0.96, 0.001 ).name( 'viscosity' );
 				gui.add( effectController, 'speed', 1, 6, 1 );
 				gui.add( effectController, 'ducksEnabled' ).onChange( () => {
-			
+
 					duckMesh.visible = effectController.ducksEnabled;
-			
+
 				} );
 				gui.add( effectController, 'wireframe' ).onChange( () => {
-			
+
 					waterMesh.material.wireframe = ! waterMesh.material.wireframe;
 					poolBorder.material.wireframe = ! poolBorder.material.wireframe;
 					duckModel.material.wireframe = ! duckModel.material.wireframe;
 					waterMesh.material.needsUpdate = true;
 					poolBorder.material.needsUpdate = true;
-			
+
 				} );
 
 			}
@@ -484,7 +484,7 @@
 				mouseDown = true;
 				firstClick = true;
 				updateOriginMouseDown = true;
-			
+
 			}
 
 			function onPointerUp() {
@@ -529,7 +529,7 @@
 							effectController.mousePos.value.set( point.x, point.z );
 
 							updateOriginMouseDown = false;
-			
+
 						}
 
 						effectController.mouseSpeed.value.set(
@@ -554,7 +554,7 @@
 					}
 
 					firstClick = false;
-			
+
 				} else {
 
 					updateOriginMouseDown = true;
@@ -582,7 +582,7 @@
 					}
 
 					frame = 0;
-			
+
 				}
 
 				renderer.render( scene, camera );

+ 4 - 4
examples/webgpu_layers.html

@@ -46,7 +46,7 @@
 				camera.position.z = 10;
 
 				scene = new THREE.Scene();
-			
+
 				const horizontalEffect = screenUV.x.mix( color( 0xf996ae ), color( 0xf6f0a3 ) );
 				const lightEffect = screenUV.distance( vec2( 0.5, 1.0 ) ).oneMinus().mul( color( 0xd9b6fd ) );
 
@@ -137,7 +137,7 @@
 				const v = new THREE.Vector3();
 
 				for ( let i = 0; i < count; i ++ ) {
-			
+
 					positions.push(
 						THREE.MathUtils.randFloat( - 25, - 20 ),
 						THREE.MathUtils.randFloat( - 10, 50 ),
@@ -179,8 +179,8 @@
 				const localTime = instancedBufferAttribute( timeAttribute ).add( time.mul( 0.02 ) );
 				const modTime = mod( localTime, 1.0 );
 
-				const rotatedPositon = rotate( positionLocal, instanceRotation.mul( modTime.mul( 20 ) ) );
-				material.positionNode = rotatedPositon.add( instancePosition ).add( instanceDirection.mul( modTime.mul( 50 ) ) );
+				const rotatedPosition = rotate( positionLocal, instanceRotation.mul( modTime.mul( 20 ) ) );
+				material.positionNode = rotatedPosition.add( instancePosition ).add( instanceDirection.mul( modTime.mul( 50 ) ) );
 
 				return material;
 

+ 5 - 5
examples/webgpu_lights_pointlights.html

@@ -35,7 +35,7 @@
 			import { abs, attribute, distance, float, max, modelWorldMatrixInverse, positionLocal, sin, time, uniform } from 'three/tsl';
 
 			let camera, scene, timer, renderer, controls;
-			
+
 			let light1, light2;
 
 			init();
@@ -78,7 +78,7 @@
 				scene.add( light2 );
 
 				scene.add( new THREE.AmbientLight( 0xaaaaaa, 0.1 ) );
-			
+
 				// renderer
 
 				renderer = new THREE.WebGPURenderer( { antialias: true } );
@@ -128,7 +128,7 @@
 			function createMaterial() {
 
 				const material = new THREE.MeshPhongNodeMaterial();
-			
+
 				const seedAttribute = attribute( 'seed' );
 				const displaceNormalAttribute = attribute( 'displaceNormal' );
 
@@ -152,7 +152,7 @@
 			}
 
 			function createGeometry( geometry ) {
-			
+
 				const positionAttribute = geometry.getAttribute( 'position' );
 
 				const v0 = new THREE.Vector3();
@@ -179,7 +179,7 @@
 					v3.copy( v0 ).add( v1 ).add( v2 ).divideScalar( 3 ); // compute center
 					v3.add( n.copy( plane.normal ).multiplyScalar( - 1 ) ); // displace center inwards
 
-					// generate tetraeder for each triangle
+					// generate tetrahedron for each triangle
 
 					vertices.push( v0.x, v0.y, v0.z, v1.x, v1.y, v1.z, v2.x, v2.y, v2.z );
 					vertices.push( v3.x, v3.y, v3.z, v1.x, v1.y, v1.z, v0.x, v0.y, v0.z );

+ 7 - 7
examples/webgpu_reflection.html

@@ -28,7 +28,7 @@
 		<script type="module">
 
 			import * as THREE from 'three';
-			
+
 			import { abs, color, div, float, Fn, instancedBufferAttribute, materialColor, min, normalWorldGeometry, pass, positionGeometry, positionLocal, reflector, screenUV, sin, sub, texture, time, uniform, uv, varyingProperty } from 'three/tsl';
 			import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
 
@@ -174,7 +174,7 @@
 			}
 
 			function startTweens() {
-			
+
 				const lifeTween = new TWEEN.Tween( uniformLife )
 					.to( { value: 1 }, 5000 )
 					.easing( TWEEN.Easing.Bounce.Out );
@@ -187,7 +187,7 @@
 					.onComplete( function () {
 
 						secondaryTweens();
-			
+
 					} );
 				effectTween.start();
 
@@ -321,13 +321,13 @@
 
 				// TSL
 
-				const vVisbility = varyingProperty( 'float' );
+				const vVisibility = varyingProperty( 'float' );
 
 				const instancePosition = instancedBufferAttribute( attributePosition );
 				const instanceNormal = instancedBufferAttribute( attributeNormal );
 				const instanceColor = instancedBufferAttribute( attributeColor );
 				const instanceData = instancedBufferAttribute( attributeData );
-			
+
 				material.positionNode = Fn( () => {
 
 					const instanceSize = instanceData.x;
@@ -345,7 +345,7 @@
 					// life (controls the visibility and initial scale of the cubes)
 
 					const scale = uniformLife.greaterThan( instanceTime ).select( min( 1, div( uniformLife.sub( instanceTime ), 0 ) ) ).oneMinus();
-					vVisbility.assign( uniformLife.greaterThan( instanceTime ).select( 1, 0 ) );
+					vVisibility.assign( uniformLife.greaterThan( instanceTime ).select( 1, 0 ) );
 
 					// accumulate different vertex animations
 
@@ -363,7 +363,7 @@
 
 				material.colorNode = Fn( () => {
 
-					vVisbility.equal( 0 ).discard();
+					vVisibility.equal( 0 ).discard();
 
 					return materialColor.mul( instanceColor );
 

+ 2 - 2
examples/webgpu_reflection_blurred.html

@@ -149,9 +149,9 @@
 					// reflection composite
 
 					const reflectionMask = reflectionBlurred.a.mul( reflectionDepth ).remapClamp( 0, roughnessRange );
-					const reflectionItensity = .1;
+					const reflectionIntensity = .1;
 					const reflectionMixFactor = reflectionMask.mul( roughness.mul( 2 ).min( 1 ) );
-					const reflectionFinal = mix( reflection.rgb, reflectionBlurred.rgb, reflectionMixFactor ).mul( reflectionItensity );
+					const reflectionFinal = mix( reflection.rgb, reflectionBlurred.rgb, reflectionMixFactor ).mul( reflectionIntensity );
 
 					// mix reflection with animated circle
 

+ 1 - 1
examples/webgpu_tonemapping.html

@@ -76,7 +76,7 @@
 				scene = new THREE.Scene();
 				scene.backgroundBlurriness = params.blurriness;
 
-				const light = new THREE.DirectionalLight( 0xfff3ee, 3 ); // simualte sun
+				const light = new THREE.DirectionalLight( 0xfff3ee, 3 ); // simulate sun
 				light.position.set( 1, 0.05, 0.7 );
 				scene.add( light );
 

+ 2 - 2
examples/webgpu_tsl_transpiler.html

@@ -100,7 +100,7 @@ float noise(vec2 p, float freq ){
 }
 
 float pNoise(vec2 p, int res){
-	float persistance = .5;
+	float persistence = .5;
 	float n = 0.;
 	float normK = 0.;
 	float f = 4.;
@@ -110,7 +110,7 @@ float pNoise(vec2 p, int res){
 		n+=amp*noise(p, f);
 		f*=2.;
 		normK+=amp;
-		amp*=persistance;
+		amp*=persistence;
 		if (iCount == res) break;
 		iCount++;
 	}

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -2965,7 +2965,7 @@ class WebGLRenderer {
 					_gl.bindBuffer( _gl.PIXEL_PACK_BUFFER, glBuffer );
 					_gl.bufferData( _gl.PIXEL_PACK_BUFFER, buffer.byteLength, _gl.STREAM_READ );
 
-					// when using MRT, select the corect color buffer for the subsequent read command
+					// when using MRT, select the correct color buffer for the subsequent read command
 
 					if ( renderTarget.textures.length > 1 ) _gl.readBuffer( _gl.COLOR_ATTACHMENT0 + textureIndex );
 

粤ICP备19079148号