Ver Fonte

Examples: fix minor errors (#30799)

* Examples: fix minor errors

* Update webgl_mesh_batch.html

* Update webgpu_multisampled_renderbuffers.html

Revert.

---------

Co-authored-by: Samuel Rigaud <rigaud@gmail.com>
Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
Samuel Rigaud há 9 meses atrás
pai
commit
3285194a66

+ 1 - 1
examples/webgl_multiple_views.html

@@ -255,7 +255,7 @@
 					const view = views[ ii ];
 					const camera = view.camera;
 
-					view.updateCamera( camera, scene, mouseX, mouseY );
+					view.updateCamera( camera, scene, mouseX );
 
 					const left = Math.floor( windowWidth * view.left );
 					const bottom = Math.floor( windowHeight * view.bottom );

+ 2 - 2
examples/webgl_postprocessing_3dlut.html

@@ -106,14 +106,14 @@
 							} );
 
 					} else if ( /\LUT$/i.test( name ) ) {
-			
+
 						new LUTImageLoader()
 							.load( `luts/${name}.png`, function ( result ) {
 
 								lutMap[ name ] = result;
 
 							} );
-			
+
 					} else {
 
 						new LUT3dlLoader()

+ 17 - 17
examples/webgpu_compute_sort_bitonic.html

@@ -12,7 +12,7 @@
 			<br /> This example demonstrates a bitonic sort running step by step in a compute shader.
 			<br /> The left canvas swaps values within workgroup local arrays. The right swaps values within storage buffers.
 			<br /> Reference implementation by <a href="https://poniesandlight.co.uk/reflect/bitonic_merge_sort/">Tim Gfrerer</a>
-			<br /> 
+			<br />
 			<div id="local_swap" style="
 				position: absolute;
 				top: 150px;
@@ -112,14 +112,14 @@
 
 					effectController.highlight.value = 0;
 
-			
+
 				} else {
 
 					effectController.highlight.value = 1;
-			
+
 				}
 
-			
+
 			} );
 
 			if ( WebGPU.isAvailable() === false ) {
@@ -276,7 +276,7 @@
 					// Get ids of indices needed to populate workgroup local buffer.
 					// Use .toVar() to prevent these values from being recalculated multiple times.
 					const localOffset = uint( WORKGROUP_SIZE[ 0 ] ).mul( 2 ).mul( workgroupId.x ).toVar();
-			
+
 					const localID1 = invocationLocalIndex.mul( 2 );
 					const localID2 = invocationLocalIndex.mul( 2 ).add( 1 );
 
@@ -343,7 +343,7 @@
 						if ( forceGlobalSwap ) {
 
 							If( highestBlockHeight.equal( size * 2 ), () => {
-			
+
 								nextAlgo.assign( StepType.NONE );
 								nextBlockHeight.assign( 0 );
 
@@ -357,7 +357,7 @@
 						} else {
 
 							If( highestBlockHeight.equal( size * 2 ), () => {
-			
+
 								nextAlgo.assign( StepType.NONE );
 								nextBlockHeight.assign( 0 );
 
@@ -403,7 +403,7 @@
 				const computeResetBuffersFn = Fn( () => {
 
 					currentElementsStorage.element( instanceIndex ).assign( randomizedElementsStorage.element( instanceIndex ) );
-			
+
 				} );
 
 				const computeResetAlgoFn = Fn( () => {
@@ -487,7 +487,7 @@
 					renderer.domElement.style.left = '50%';
 
 					scene.background = new THREE.Color( 0x212121 );
-			
+
 				} else {
 
 					scene.background = new THREE.Color( 0x313131 );
@@ -509,9 +509,9 @@
 						if ( nextStepGlobal ) {
 
 							renderer.compute( computeAlignCurrent );
-			
+
 						}
-			
+
 						renderer.compute( computeSetAlgo );
 
 						currentStep ++;
@@ -522,16 +522,16 @@
 						renderer.compute( computeResetAlgo );
 
 						currentStep = 0;
-			
+
 					}
 
 					renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );
 
 
 					const algo = new Uint32Array( await renderer.getArrayBufferAsync( nextAlgoBuffer ) );
-					algo > StepType.DISPERSE_LOCAL ? ( nextStepGlobal = true ) : ( nextStepGlobal = false );
+					nextStepGlobal = algo[ 0 ] > StepType.DISPERSE_LOCAL;
 					const totalSwaps = new Uint32Array( await renderer.getArrayBufferAsync( counterBuffer ) );
-			
+
 					renderer.render( scene, camera );
 					renderer.resolveTimestampsAsync( THREE.TimestampQuery.RENDER );
 
@@ -545,17 +545,17 @@
 									&nbsp;to Region&nbsp;
 									<div style="background-color: ${ forceGlobalSwap ? globalColors[ 1 ] : localColors[ 1 ]}; width:12.5px; height: 1em; border-radius: 20%;"></div>
 								</div>`;
-			
+
 
 					if ( currentStep === MAX_STEPS ) {
 
 						setTimeout( stepAnimation, 1000 );
 
-			
+
 					} else {
 
 						setTimeout( stepAnimation, 50 );
-			
+
 					}
 
 				};

+ 4 - 4
examples/webgpu_tsl_halftone.html

@@ -152,7 +152,7 @@
 						.mul( mix( mixLow, mixHigh, orientationStrength ) );
 
 					return vec4( color, mask );
-			
+
 				} );
 
 				const halftones = Fn( ( [ input ] ) => {
@@ -202,7 +202,7 @@
 
 						const model = gltf.scene;
 						model.position.y = - 2;
-						model.scale.setScalar( 2.5, 2.5, 2.5 );
+						model.scale.setScalar( 2.5 );
 						model.traverse( ( child ) => {
 
 							if ( child.isMesh )
@@ -211,7 +211,7 @@
 						} );
 
 						scene.add( model );
-			
+
 					}
 				);
 
@@ -243,7 +243,7 @@
 			}
 
 			async function animate() {
-			
+
 				controls.update();
 
 				const time = clock.getElapsedTime();

粤ICP备19079148号