Skip to content

Commit

Permalink
enabling seed, disabling negative speed
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuulala committed Dec 21, 2024
1 parent 0cb82a6 commit c1e5fed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions example/src/shaders/metaballs-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const MetaballsExample = () => {
color3="#f5d03b"
scale={11}
speed={1}
seed={0}
visibilityRange={0}
dotSize={1}
style={{ position: 'fixed', width: '100%', height: '100%' }}
Expand All @@ -37,10 +38,11 @@ export const MetaballsWithControls = () => {
color1: { value: defaults.color1, order: 1 },
color2: { value: defaults.color2, order: 2 },
color3: { value: defaults.color3, order: 3 },
speed: { value: defaults.speed, order: 4, min: -2, max: 2 },
scale: { value: defaults.scale, order: 5, min: 1, max: 20 },
dotSize: { value: defaults.scale, order: 6, min: 0, max: 1 },
visibilityRange: { value: defaults.scale, order: 7, min: 0, max: 1 },
speed: { value: defaults.speed, order: 4, min: 0, max: 2 },
seed: { value: defaults.speed, order: 5, min: 0, max: 1 },
scale: { value: defaults.scale, order: 6, min: 1, max: 20 },
dotSize: { value: defaults.scale, order: 7, min: 0, max: 1 },
visibilityRange: { value: defaults.scale, order: 8, min: 0, max: 1 },
},
{ order: 1 }
),
Expand Down
2 changes: 1 addition & 1 deletion packages/shaders/src/shader-mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class ShaderMount {

/** Set a seed to get a deterministic result */
public setSeed = (newSeed: number): void => {
this.totalAnimationTime = newSeed;
this.totalAnimationTime = 10000 * newSeed;
this.render(performance.now());
};

Expand Down

0 comments on commit c1e5fed

Please sign in to comment.