Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Aug 8, 2024
1 parent 213bf02 commit 5b39722
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
Binary file modified examples/screenshots/webgpu_postprocessing_motion_blur.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 3 additions & 16 deletions examples/webgpu_postprocessing_motion_blur.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
controls.minDistance = 1;
controls.maxDistance = 10;
controls.maxPolarAngle = Math.PI / 2;
//controls.autoRotate = true;
controls.autoRotate = true;
controls.autoRotateSpeed = 1;
controls.target.set( 0, 1, 0 );
controls.enableDamping = true;
Expand All @@ -173,7 +173,7 @@

// post-processing

const blurAmount = uniform( 2 );
const blurAmount = uniform( 1.5 );
const showVelocity = uniform( 0 );

const scenePass = pass( scene, camera );
Expand Down Expand Up @@ -204,20 +204,7 @@
gui.add( controls, 'autoRotate' );
gui.add( blurAmount, 'value', 0, 4 ).name( 'blur amount' );
gui.add( params, 'speed', 0, 2 );

const uiVelocity = gui.add( showVelocity, 'value', 0, 1 ).name( 'show velocity' );

function guiAnimation() {

showVelocity.value = 1 - Math.max( Math.min( ( performance.now() / 1000 ) - 1, 1 ), 0 );

uiVelocity.updateDisplay();

if ( showVelocity.value > 0 ) requestAnimationFrame( guiAnimation );

}

requestAnimationFrame( guiAnimation );
gui.add( showVelocity, 'value', 0, 1 ).name( 'show velocity' );

//

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/display/MotionBlurNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const motionBlur = /*#__PURE__*/ Fn( ( [ inputNode, velocity ] ) => {

const sampleColor = ( uv ) => inputNode.uv( uv );

const NUM_SAMPLES = int( 30 );
const NUM_SAMPLES = int( 16 );

const uvs = uv();

Expand Down

0 comments on commit 5b39722

Please sign in to comment.