Skip to content

Commit

Permalink
fix screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhhelgeson committed Aug 17, 2024
1 parent bbc3004 commit d687a0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Binary file modified examples/screenshots/webgpu_compute_water.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions examples/webgpu_compute_water.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
effectController = {
mousePos: uniform( new THREE.Vector2( 10000, 10000 ) ).label( 'mousePos' ),
mouseSize: uniform( 20.0 ).label( 'mouseSize' ),
viscosity: uniform( 0.98 ).label( 'viscosity' ),
viscosity: uniform( 0.9 ).label( 'viscosity' ),
spheresEnabled: true
};

Expand Down Expand Up @@ -199,7 +199,11 @@

const { north, south, east, west } = getNeighborValuesTSL( instanceIndex, heightStorage );

const newHeight = ( ( north.add( south ).add( east ).add( west ) ).mul( 0.5 ).sub( prevHeight ) ).mul( viscosity );
const neighborHeight = north.add( south ).add( east ).add( west );
neighborHeight.mulAssign( 0.5 );
neighborHeight.subAssign( prevHeight );

const newHeight = neighborHeight.mul( viscosity );

// Get 2-D compute coordinate from one-dimensional instanceIndex.
const x = float( instanceIndex.modInt( WIDTH ) ).mul( 1 / WIDTH );
Expand Down

0 comments on commit d687a0b

Please sign in to comment.