ソースを参照

Typos (#30843)

* Typos

* fix alpha

---------

Co-authored-by: Samuel Rigaud <rigaud@gmail.com>
Samuel Rigaud 9 ヶ月 前
コミット
1e61693570

+ 1 - 1
examples/jsm/postprocessing/EffectComposer.js

@@ -119,7 +119,7 @@ class EffectComposer {
 		this.copyPass.material.blending = NoBlending;
 
 		/**
-		 * The intenral clock for managing time data.
+		 * The internal clock for managing time data.
 		 *
 		 * @private
 		 * @type {Clock}

+ 2 - 2
examples/jsm/postprocessing/GTAOPass.js

@@ -366,7 +366,7 @@ class GTAOPass extends Pass {
 	}
 
 	/**
-	 * Updates the GTAO material from the given paramter object.
+	 * Updates the GTAO material from the given parameter object.
 	 *
 	 * @param {Object} parameters - The GTAO material parameters.
 	 */
@@ -420,7 +420,7 @@ class GTAOPass extends Pass {
 	}
 
 	/**
-	 * Updates the Denoise material from the given paramter object.
+	 * Updates the Denoise material from the given parameter object.
 	 *
 	 * @param {Object} parameters - The denoise parameters.
 	 */

+ 1 - 1
examples/jsm/postprocessing/GlitchPass.js

@@ -50,7 +50,7 @@ class GlitchPass extends Pass {
 		} );
 
 		/**
-		 * Whether to noticeably increase the effect instensity or not.
+		 * Whether to noticeably increase the effect intensity or not.
 		 *
 		 * @type {boolean}
 		 * @default false

+ 2 - 2
examples/jsm/postprocessing/RenderTransitionPass.js

@@ -82,7 +82,7 @@ class RenderTransitionPass extends Pass {
 	 * Sets the transition factor. Must be in the range `[0,1]`.
 	 * This value determines to what degree both scenes are mixed.
 	 *
-	 * @param {boolenumberan} value - The transition factor.
+	 * @param {boolean|number} value - The transition factor.
 	 */
 	setTransition( value ) {
 
@@ -116,7 +116,7 @@ class RenderTransitionPass extends Pass {
 	 * Sets the texture threshold. This value defined how strong the texture effects
 	 * the transition. Must be in the range `[0,1]` (0 means full effect, 1 means no effect).
 	 *
-	 * @param {boolenumberan} value - The threshold value.
+	 * @param {boolean|number} value - The threshold value.
 	 */
 	setTextureThreshold( value ) {
 

+ 1 - 1
examples/jsm/postprocessing/SAOPass.js

@@ -82,7 +82,7 @@ class SAOPass extends Pass {
 		this._oldClearAlpha = 1;
 
 		/**
-		 * The SAO paramter.
+		 * The SAO parameter.
 		 *
 		 * @type {Object}
 		 */

+ 1 - 1
examples/jsm/postprocessing/SMAAPass.js

@@ -12,7 +12,7 @@ import { SMAABlendShader, SMAAEdgesShader, SMAAWeightsShader } from '../shaders/
 
 /**
  * A pass for applying SMAA. Unlike {@link FXAAPass}, `SMAAPass` operates in
- * `linar-srgb` so this pass must be executed before {@link OutputPass}.
+ * `linear-srgb` so this pass must be executed before {@link OutputPass}.
  *
  * ```js
  * const smaaPass = new SMAAPass();

+ 2 - 2
examples/jsm/postprocessing/SSRPass.js

@@ -100,7 +100,7 @@ class SSRPass extends Pass {
 		this.groundReflector = groundReflector;
 
 		/**
-		 * The opactiy.
+		 * The opacity.
 		 *
 		 * @type {number}
 		 * @default 0.5
@@ -221,7 +221,7 @@ class SSRPass extends Pass {
 		this._distanceAttenuation = SSRShader.defines.DISTANCE_ATTENUATION;
 
 		/**
-		 * Whether to use distance attenutation or not.
+		 * Whether to use distance attenuation or not.
 		 *
 		 * @name SSRPass#distanceAttenuation
 		 * @type {boolean}

+ 1 - 1
examples/jsm/shaders/VolumeShader.js

@@ -263,7 +263,7 @@ const VolumeRenderShader1 = {
 						// note: could allow multiple lights
 						for (int i=0; i<1; i++)
 						{
-								 // Get light direction (make sure to prevent zero devision)
+								 // Get light direction (make sure to prevent zero division)
 								vec3 L = normalize(view_ray);	//lightDirs[i];
 								float lightEnabled = float( length(L) > 0.0 );
 								L = normalize(L + (1.0 - lightEnabled));

+ 4 - 4
examples/jsm/tsl/display/AnamorphicNode.js

@@ -22,11 +22,11 @@ class AnamorphicNode extends TempNode {
 	 * Constructs a new anamorphic node.
 	 *
 	 * @param {TextureNode} textureNode - The texture node that represents the input of the effect.
-	 * @param {Node<float>} tresholdNode - The threshold is one option to control the intensity and size of the effect.
+	 * @param {Node<float>} thresholdNode - The threshold is one option to control the intensity and size of the effect.
 	 * @param {Node<float>} scaleNode - Defines the vertical scale of the flares.
 	 * @param {number} samples - More samples result in larger flares and a more expensive runtime behavior.
 	 */
-	constructor( textureNode, tresholdNode, scaleNode, samples ) {
+	constructor( textureNode, thresholdNode, scaleNode, samples ) {
 
 		super( 'vec4' );
 
@@ -42,7 +42,7 @@ class AnamorphicNode extends TempNode {
 		 *
 		 * @type {Node<float>}
 		 */
-		this.tresholdNode = tresholdNode;
+		this.thresholdNode = thresholdNode;
 
 		/**
 		 * Defines the vertical scale of the flares.
@@ -202,7 +202,7 @@ class AnamorphicNode extends TempNode {
 
 				const uv = vec2( uvNode.x.add( this._invSize.x.mul( i ).mul( this.scaleNode ) ), uvNode.y );
 				const color = sampleTexture( uv );
-				const pass = threshold( color, this.tresholdNode ).mul( softness );
+				const pass = threshold( color, this.thresholdNode ).mul( softness );
 
 				total.addAssign( pass );
 

+ 14 - 14
examples/webgl_animation_walk.html

@@ -211,7 +211,7 @@
 								object.material.roughness = 0.2;
 								object.material.color.set( 1, 1, 1 );
 								object.material.metalnessMap = object.material.map;
-			
+
 							} else {
 
 								object.material.metalness = 1;
@@ -219,9 +219,9 @@
 								object.material.transparent = true;
 								object.material.opacity = 0.8;
 								object.material.color.set( 1, 1, 1 );
-			
+
 							}
-			
+
 						}
 
 					} );
@@ -253,7 +253,7 @@
 						actions[ m ].enabled = true;
 						actions[ m ].setEffectiveTimeScale( 1 );
 						if ( m !== 'Idle' ) actions[ m ].setEffectiveWeight( 0 );
-			
+
 					}
 
 					actions.Idle.play();
@@ -272,7 +272,7 @@
 				const ease = controls.ease;
 				const rotate = controls.rotate;
 				const position = controls.position;
-				const azimut = orbitControls.getAzimuthalAngle();
+				const azimuth = orbitControls.getAzimuthalAngle();
 
 				const active = key[ 0 ] === 0 && key[ 1 ] === 0 ? false : true;
 				const play = active ? ( key[ 2 ] ? 'Run' : 'Walk' ) : 'Idle';
@@ -293,7 +293,7 @@
 						current.weight = 1.0;
 						current.stopFading();
 						old.stopFading();
-						// sycro if not idle
+						// synchro if not idle
 						if ( play !== 'Idle' ) current.time = old.time * ( current.getClip().duration / old.getClip().duration );
 						old._scheduleFading( fade, old.getEffectiveWeight(), 0 );
 						current._scheduleFading( fade, current.getEffectiveWeight(), 1 );
@@ -320,11 +320,11 @@
 					ease.set( key[ 1 ], 0, key[ 0 ] ).multiplyScalar( velocity * delta );
 
 					// calculate camera direction
-					const angle = unwrapRad( Math.atan2( ease.x, ease.z ) + azimut );
+					const angle = unwrapRad( Math.atan2( ease.x, ease.z ) + azimuth );
 					rotate.setFromAxisAngle( up, angle );
 
 					// apply camera angle on ease
-					controls.ease.applyAxisAngle( up, azimut );
+					controls.ease.applyAxisAngle( up, azimuth );
 
 					position.add( ease );
 					camera.position.add( ease );
@@ -335,7 +335,7 @@
 					orbitControls.target.copy( position ).add( { x: 0, y: 1, z: 0 } );
 					followGroup.position.copy( position );
 
-					// decale floor at infinie
+					// Move the floor without any limit
 					const dx = ( position.x - floor.position.x );
 					const dz = ( position.z - floor.position.z );
 					if ( Math.abs( dx ) > controls.floorDecale ) floor.position.x += dx;
@@ -344,7 +344,7 @@
 				}
 
 				if ( mixer ) mixer.update( delta );
-			
+
 				orbitControls.update();
 
 			}
@@ -352,7 +352,7 @@
 			function unwrapRad( r ) {
 
 				return Math.atan2( Math.sin( r ), Math.cos( r ) );
-			
+
 			}
 
 			function createPanel() {
@@ -364,7 +364,7 @@
 					skeleton.visible = b;
 
 				} );
-			
+
 				panel.add( settings, 'fixe_transition' );
 
 			}
@@ -387,7 +387,7 @@
 					case 'ArrowLeft': case 'KeyA': case 'KeyQ': key[ 1 ] = - 1; break;
 					case 'ArrowRight': case 'KeyD': key[ 1 ] = 1; break;
 					case 'ShiftLeft' : case 'ShiftRight' : key[ 2 ] = 1; break;
-			
+
 	}
 
 			}
@@ -402,7 +402,7 @@
 					case 'ArrowLeft': case 'KeyA': case 'KeyQ': key[ 1 ] = key[ 1 ] < 0 ? 0 : key[ 1 ]; break;
 					case 'ArrowRight': case 'KeyD': key[ 1 ] = key[ 1 ] > 0 ? 0 : key[ 1 ]; break;
 					case 'ShiftLeft' : case 'ShiftRight' : key[ 2 ] = 0; break;
-			
+
 	}
 
 			}

+ 17 - 17
examples/webgl_gpgpu_water.html

@@ -101,7 +101,7 @@
 				vec2 normal = vec2(
 					( texture2D( levelTexture, point1 + vec2( - cellSize.x, 0 ) ).x - texture2D( levelTexture, point1 + vec2( cellSize.x, 0 ) ).x ) * WIDTH / BOUNDS,
 					( texture2D( levelTexture, point1 + vec2( 0, - cellSize.y ) ).x - texture2D( levelTexture, point1 + vec2( 0, cellSize.y ) ).x ) * WIDTH / BOUNDS );
-			
+
 
 				if ( gl_FragCoord.x < 1.5 ) {
 
@@ -199,7 +199,7 @@
 			};
 
 			init();
-			
+
 
 			async function init() {
 
@@ -239,7 +239,7 @@
 				const rgbeLoader = new RGBELoader().setPath( './textures/equirectangular/' );
 				const glbloader = new GLTFLoader().setPath( 'models/gltf/' );
 				glbloader.setDRACOLoader( new DRACOLoader().setDecoderPath( 'jsm/libs/draco/gltf/' ) );
-			
+
 				const [ env, model ] = await Promise.all( [ rgbeLoader.loadAsync( 'blouberg_sunrise_2_1k.hdr' ), glbloader.loadAsync( 'duck.glb' ) ] );
 				env.mapping = THREE.EquirectangularReflectionMapping;
 				scene.environment = env;
@@ -268,7 +268,7 @@
 						if ( ducks[ i ] ) ducks[ i ].visible = ducksEnabled;
 
 					}
-			
+
 				};
 
 				gui.add( effectController, 'mouseSize', 0.1, 1.0, 0.1 ).onChange( valuesChanger );
@@ -280,13 +280,13 @@
 
 					waterMesh.material.wireframe = v;
 					poolBorder.material.wireframe = v;
-			
+
 				} );
 				gui.add( effectController, 'shadow' ).onChange( addShadow );
-			
+
 				//const buttonSmooth = { smoothWater: function () {smoothWater();} };
 				//gui.add( buttonSmooth, 'smoothWater' );
-			
+
 
 				initWater();
 
@@ -452,7 +452,7 @@
 				} else {
 
 					if ( sun.shadow ) sun.shadow.dispose();
-			
+
 				}
 
 				// debug shadow
@@ -536,7 +536,7 @@
 						sphere.userData.velocity.multiplyScalar( 0.998 );
 						pos.add( sphere.userData.velocity );
 
-			
+
 
 						const decal = 0.001;
 						const limit = BOUNDS_HALF - 0.2;
@@ -568,7 +568,7 @@
 						// duck orientation test
 
 						const startNormal = new THREE.Vector3( pixels[ 1 ], 1, - pixels[ 2 ] ).normalize();
-			
+
 						const dir = startPos.sub( pos );
 						dir.y = 0;
 						dir.normalize();
@@ -605,7 +605,7 @@
 
 				mousedown = false;
 				controls.enabled = true;
-			
+
 			}
 
 			function onPointerMove( event ) {
@@ -698,13 +698,13 @@
 
 					this.extra = {};
 
-					this.addParametre( 'heightmap', null );
-			
+					this.addParameter( 'heightmap', null );
+
 					this.setValues( parameters );
 
 				}
 
-				addParametre( name, value ) {
+				addParameter( name, value ) {
 
 					this.extra[ name ] = value;
 					Object.defineProperty( this, name, {
@@ -713,10 +713,10 @@
 
 							this.extra[ name ] = v;
 							if ( this.userData.shader ) this.userData.shader.uniforms[ name ].value = this.extra[ name ];
-			
+
 						}
 					} );
-			
+
 				}
 
 				onBeforeCompile( shader ) {
@@ -724,7 +724,7 @@
 					for ( const name in this.extra ) {
 
 						shader.uniforms[ name ] = { value: this.extra[ name ] };
-			
+
 					}
 
 					shader.vertexShader = shader.vertexShader.replace( '#include <common>', shaderChange.common );

+ 15 - 15
examples/webgl_random_uv.html

@@ -115,7 +115,7 @@
 
 							const shaderBall = gltf.scene.children[ 0 ];
 
-							// shaderBall is a groop with 3 children : base, inside and logo
+							// shaderBall is a group with 3 children : base, inside and logo
 							// ao map is include in model
 
 							let i = shaderBall.children.length, n = 0;
@@ -125,7 +125,7 @@
 								shaderBall.children[ i ].receiveShadow = true;
 								shaderBall.children[ i ].castShadow = true;
 								shaderBall.children[ i ].renderOrder = n ++;
-			
+
 							}
 
 							material = shaderBall.children[ 0 ].material;
@@ -149,7 +149,7 @@
 								shader.uniforms[ 'debugNoise' ] = { value: 0 };
 
 								shader.fragmentShader = shader.fragmentShader.replace( '#include <clipping_planes_pars_fragment>', '#include <clipping_planes_pars_fragment>' + randomUV );
-								shader.fragmentShader = shader.fragmentShader.replace( '#include <map_fragment>', mapRemplace );
+								shader.fragmentShader = shader.fragmentShader.replace( '#include <map_fragment>', map_fragment );
 
 								// for disolve
 								shader.fragmentShader = shader.fragmentShader.replace( '#include <alphamap_pars_fragment>', alphamap_pars_fragment );
@@ -276,7 +276,7 @@
 				gui.add( setting, 'UseNoiseMap' );
 				gui.add( setting, 'SuslikMethod' );
 				gui.add( setting, 'DebugNoise' );
-			
+
 			}
 
 			function onWindowResize() {
@@ -309,7 +309,7 @@
 			    vec2 ip = floor(p);
 			    vec2 u = fract(p);
 			    u = u*u*(3.0-2.0*u);
-			    
+
 			    float res = mix(
 			        mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x),
 			        mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y);
@@ -324,8 +324,8 @@
 			    float k = 0.0;
 			    if( useNoiseMap == 1.0 ) k = texture2D( noiseMap, 0.005*uv ).x;
 			    else k = directNoise( uv );
-			    
-			    // compute index    
+
+			    // compute index
 			    float index = k*8.0;
 			    float f = fract( index );
 			    float ia = 0.0;
@@ -340,15 +340,15 @@
 			    	ib = ia + 1.0;
 			    }
 
-			    // offsets for the different virtual patterns    
-			    vec2 offa = sin(vec2(3.0,7.0)*ia); // can replace with any other hash    
-			    vec2 offb = sin(vec2(3.0,7.0)*ib); // can replace with any other hash    
+			    // offsets for the different virtual patterns
+			    vec2 offa = sin(vec2(3.0,7.0)*ia); // can replace with any other hash
+			    vec2 offb = sin(vec2(3.0,7.0)*ib); // can replace with any other hash
 
-			    // compute derivatives for mip-mapping    
+			    // compute derivatives for mip-mapping
 			    vec2 dx = dFdx(uv);
 			    vec2 dy = dFdy(uv);
-			    
-			    // sample the two closest virtual patterns    
+
+			    // sample the two closest virtual patterns
 			    vec4 cola = textureGrad( mapper, uv + offa, dx, dy );
 			    vec4 colb = textureGrad( mapper, uv + offb, dx, dy );
 			    if( debugNoise == 1.0 ){
@@ -356,12 +356,12 @@
 			    	colb = vec4( 0.0,0.0,1.0,1.0 );
 			    }
 
-			    // interpolate between the two virtual patterns    
+			    // interpolate between the two virtual patterns
 			    return mix( cola, colb, smoothstep(0.2,0.8,f-0.1*sum(cola-colb)) );
 
 			}`;
 
-			const mapRemplace = /* glsl */ `
+			const map_fragment = /* glsl */ `
 			#ifdef USE_MAP
 
 				if( enableRandom == 1.0 ) diffuseColor *= textureNoTile( map, vMapUv );

+ 3 - 3
examples/webgl_reverse_depth_buffer.html

@@ -61,7 +61,7 @@
 				display: block;
 				text-align: center;
 			}
-			
+
 			#depth-warning {
 				position: absolute;
 				top: 40px;
@@ -86,7 +86,7 @@
 		<div id="info">
 			<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - reverse depth buffer<br/>
 		</div>
-		
+
 		<div id="depth-warning">
 			Warning: Your browser's WebGL provides less than 24-bit depth buffer precision. This example may not display correctly.
 		</div>
@@ -129,7 +129,7 @@
 				const numInstances = xCount * yCount;
 
 				const d = 0.0001; // half distance between two planes
-				const o = 0.5; // half x offset to shift planes so they are only partially overlaping
+				const o = 0.5; // half x offset to shift planes so they are only partially overlapping
 
 				const positions = new Float32Array( [
 					- 1 - o, - 1, d,

+ 17 - 17
examples/webgl_watch.html

@@ -18,7 +18,7 @@
 				"imports": {
 					"three": "../build/three.module.js",
 					"three/addons/": "./jsm/",
-					"tween": "./jsm/libs/tween.module.js" 
+					"tween": "./jsm/libs/tween.module.js"
 				}
 			}
 		</script>
@@ -112,15 +112,15 @@
 
 											child.receiveShadow = true;
 										    child.castShadow = true;
-			
+
 										}
-			
+
 									}
 
 									meshs[ child.name ] = child;
-			
+
 								}
-			
+
 							} );
 
 							scene.add( gltf.scene );
@@ -167,7 +167,7 @@
 				shadowCam.left = shadowCam.bottom = - s;
 				// debug shadow
 				//scene.add(  new THREE.CameraHelper(shadowCam) );
-			
+
 				pointLight = new THREE.PointLight( 0x7b8cad, 1, 0, 2 );
 				pointLight.position.set( 0.3, - 0.2, - 0.2 );
 				scene.add( pointLight );
@@ -224,14 +224,14 @@
 					bloomPass.threshold = setting.threshold;
 					bloomPass.strength = setting.strength;
 					bloomPass.radius = setting.radius;
-			
+
 					fxaaPass = new ShaderPass( FXAAShader );
 					const pixelRatio = renderer.getPixelRatio();
 					fxaaPass.material.uniforms[ 'resolution' ].value.set( 1 / ( window.innerWidth * pixelRatio ), 1 / ( window.innerHeight * pixelRatio ) );
 
 					composer = new EffectComposer( renderer );
 					composer.setPixelRatio( pixelRatio );
-			
+
 					composer.addPass( renderPass );
 					composer.addPass( bloomPass );
 					composer.addPass( fxaaPass );
@@ -264,7 +264,7 @@
 				gui.add( setting, 'threshold', 0, 1, 0.01 ).onChange( upBloom );
 				gui.add( setting, 'strength', 0, 3, 0.01 ).onChange( upBloom );
 				gui.add( setting, 'radius', 0, 1, 0.01 ).onChange( upBloom );
-			
+
 			}
 
 			function upMaterial() {
@@ -272,7 +272,7 @@
 				materials.Gold.metalness = materials.Silver.metalness = setting.metalness;
 				materials.Gold.roughness = materials.Silver.roughness = setting.roughness;
 				meshs.glass.material.opacity = setting.opacity;
-			
+
 			}
 
 			function upBloom() {
@@ -291,8 +291,8 @@
 				const minute = currentDate.getMinutes();
 				const second = currentDate.getSeconds();
 				let day = currentDate.getDay();
-				const mounth = currentDate.getMonth();
-				const mili = currentDate.getMilliseconds();
+				const month = currentDate.getMonth();
+				const milli = currentDate.getMilliseconds();
 				if ( hour >= 12 ) hour -= 12;
 				if ( day > 30 ) day = 30;
 
@@ -300,8 +300,8 @@
 				meshs.minute.rotation.y = - minute * 6 * torad;
 				meshs.second.rotation.y = - second * 6 * torad;
 				meshs.mini_03.rotation.y = - day * 12 * torad;
-				meshs.mini_02.rotation.y = - mounth * 30 * torad;
-				meshs.mini_01.rotation.y = - mili * 0.36 * torad;
+				meshs.mini_02.rotation.y = - month * 30 * torad;
+				meshs.mini_01.rotation.y = - milli * 0.36 * torad;
 
 			}
 
@@ -320,9 +320,9 @@
 
 						const pr = renderer.getPixelRatio();
 						fxaaPass.material.uniforms[ 'resolution' ].value.set( 1 / ( width * pr ), 1 / ( height * pr ) );
-			
+
 					}
-			
+
 				}
 
 			}
@@ -334,7 +334,7 @@
 				controls.update();
 
 				TWEEN.update();
-			
+
 				if ( composer ) composer.render();
 				else renderer.render( scene, camera );
 

+ 1 - 1
manual/examples/cameras-orthographic-canvas-top-left-origin.html

@@ -51,7 +51,7 @@ function main() {
 	const left = 0;
 	const right = 300; // default canvas size
 	const top = 0;
-	const bottom = 150; // defautl canvas size
+	const bottom = 150; // default canvas size
 	const near = - 1;
 	const far = 1;
 	const camera = new THREE.OrthographicCamera( left, right, top, bottom, near, far );

+ 2 - 2
src/geometries/ExtrudeGeometry.js

@@ -184,8 +184,8 @@ class ExtrudeGeometry extends BufferGeometry {
 						Math.abs( prevPos.x ),
 						Math.abs( prevPos.y )
 					);
-					const thesholdSqScaled = THRESHOLD_SQ * scalingFactorSqrt * scalingFactorSqrt;
-					if ( distSq <= thesholdSqScaled ) {
+					const thresholdSqScaled = THRESHOLD_SQ * scalingFactorSqrt * scalingFactorSqrt;
+					if ( distSq <= thresholdSqScaled ) {
 
 						points.splice( currentIndex, 1 );
 						i --;

+ 1 - 1
src/renderers/shaders/ShaderLib/background.glsl.js

@@ -23,7 +23,7 @@ void main() {
 
 	#ifdef DECODE_VIDEO_TEXTURE
 
-		// use inline sRGB decode until browsers properly support SRGB8_APLHA8 with video textures
+		// use inline sRGB decode until browsers properly support SRGB8_ALPHA8 with video textures
 
 		texColor = 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 );
 

粤ICP备19079148号