Skip to content

Commit 3285194

Browse files
s-rigaudSamuel RigaudMugen87
authored
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 <[email protected]> Co-authored-by: Michael Herzog <[email protected]>
1 parent 3cf407d commit 3285194

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

examples/webgl_multiple_views.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
const view = views[ ii ];
256256
const camera = view.camera;
257257

258-
view.updateCamera( camera, scene, mouseX, mouseY );
258+
view.updateCamera( camera, scene, mouseX );
259259

260260
const left = Math.floor( windowWidth * view.left );
261261
const bottom = Math.floor( windowHeight * view.bottom );

examples/webgl_postprocessing_3dlut.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@
106106
} );
107107

108108
} else if ( /\LUT$/i.test( name ) ) {
109-
109+
110110
new LUTImageLoader()
111111
.load( `luts/${name}.png`, function ( result ) {
112112

113113
lutMap[ name ] = result;
114114

115115
} );
116-
116+
117117
} else {
118118

119119
new LUT3dlLoader()

examples/webgpu_compute_sort_bitonic.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<br /> This example demonstrates a bitonic sort running step by step in a compute shader.
1313
<br /> The left canvas swaps values within workgroup local arrays. The right swaps values within storage buffers.
1414
<br /> Reference implementation by <a href="https://poniesandlight.co.uk/reflect/bitonic_merge_sort/">Tim Gfrerer</a>
15-
<br />
15+
<br />
1616
<div id="local_swap" style="
1717
position: absolute;
1818
top: 150px;
@@ -112,14 +112,14 @@
112112

113113
effectController.highlight.value = 0;
114114

115-
115+
116116
} else {
117117

118118
effectController.highlight.value = 1;
119-
119+
120120
}
121121

122-
122+
123123
} );
124124

125125
if ( WebGPU.isAvailable() === false ) {
@@ -276,7 +276,7 @@
276276
// Get ids of indices needed to populate workgroup local buffer.
277277
// Use .toVar() to prevent these values from being recalculated multiple times.
278278
const localOffset = uint( WORKGROUP_SIZE[ 0 ] ).mul( 2 ).mul( workgroupId.x ).toVar();
279-
279+
280280
const localID1 = invocationLocalIndex.mul( 2 );
281281
const localID2 = invocationLocalIndex.mul( 2 ).add( 1 );
282282

@@ -343,7 +343,7 @@
343343
if ( forceGlobalSwap ) {
344344

345345
If( highestBlockHeight.equal( size * 2 ), () => {
346-
346+
347347
nextAlgo.assign( StepType.NONE );
348348
nextBlockHeight.assign( 0 );
349349

@@ -357,7 +357,7 @@
357357
} else {
358358

359359
If( highestBlockHeight.equal( size * 2 ), () => {
360-
360+
361361
nextAlgo.assign( StepType.NONE );
362362
nextBlockHeight.assign( 0 );
363363

@@ -403,7 +403,7 @@
403403
const computeResetBuffersFn = Fn( () => {
404404

405405
currentElementsStorage.element( instanceIndex ).assign( randomizedElementsStorage.element( instanceIndex ) );
406-
406+
407407
} );
408408

409409
const computeResetAlgoFn = Fn( () => {
@@ -487,7 +487,7 @@
487487
renderer.domElement.style.left = '50%';
488488

489489
scene.background = new THREE.Color( 0x212121 );
490-
490+
491491
} else {
492492

493493
scene.background = new THREE.Color( 0x313131 );
@@ -509,9 +509,9 @@
509509
if ( nextStepGlobal ) {
510510

511511
renderer.compute( computeAlignCurrent );
512-
512+
513513
}
514-
514+
515515
renderer.compute( computeSetAlgo );
516516

517517
currentStep ++;
@@ -522,16 +522,16 @@
522522
renderer.compute( computeResetAlgo );
523523

524524
currentStep = 0;
525-
525+
526526
}
527527

528528
renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );
529529

530530

531531
const algo = new Uint32Array( await renderer.getArrayBufferAsync( nextAlgoBuffer ) );
532-
algo > StepType.DISPERSE_LOCAL ? ( nextStepGlobal = true ) : ( nextStepGlobal = false );
532+
nextStepGlobal = algo[ 0 ] > StepType.DISPERSE_LOCAL;
533533
const totalSwaps = new Uint32Array( await renderer.getArrayBufferAsync( counterBuffer ) );
534-
534+
535535
renderer.render( scene, camera );
536536
renderer.resolveTimestampsAsync( THREE.TimestampQuery.RENDER );
537537

@@ -545,17 +545,17 @@
545545
&nbsp;to Region&nbsp;
546546
<div style="background-color: ${ forceGlobalSwap ? globalColors[ 1 ] : localColors[ 1 ]}; width:12.5px; height: 1em; border-radius: 20%;"></div>
547547
</div>`;
548-
548+
549549

550550
if ( currentStep === MAX_STEPS ) {
551551

552552
setTimeout( stepAnimation, 1000 );
553553

554-
554+
555555
} else {
556556

557557
setTimeout( stepAnimation, 50 );
558-
558+
559559
}
560560

561561
};

examples/webgpu_tsl_halftone.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
.mul( mix( mixLow, mixHigh, orientationStrength ) );
153153

154154
return vec4( color, mask );
155-
155+
156156
} );
157157

158158
const halftones = Fn( ( [ input ] ) => {
@@ -202,7 +202,7 @@
202202

203203
const model = gltf.scene;
204204
model.position.y = - 2;
205-
model.scale.setScalar( 2.5, 2.5, 2.5 );
205+
model.scale.setScalar( 2.5 );
206206
model.traverse( ( child ) => {
207207

208208
if ( child.isMesh )
@@ -211,7 +211,7 @@
211211
} );
212212

213213
scene.add( model );
214-
214+
215215
}
216216
);
217217

@@ -243,7 +243,7 @@
243243
}
244244

245245
async function animate() {
246-
246+
247247
controls.update();
248248

249249
const time = clock.getElapsedTime();

0 commit comments

Comments
 (0)