/dotz

GPU-accelerated Particle Terrains

Primary LanguageJavaScriptMIT LicenseMIT

dotz

dotz

GPU-accelerated Particle Terrains

version download size

dotz demo


Usage

Open in CodePen

import { Dotz } from 'https://esm.sh/dotz';

let my_dotz = new Dotz(
  // canvas element
  document.getElementById('#myCanvas'),
  // URL for terrain image (dudv map)
  "https://m4r.sh/terrains/spiral.png",
  // options
  { 
    speed: 0.5,
    fade: 0.8,
    particles: 4e5,
    colors: {
      "0.0": "transparent",
      "0.1": "hsl(240,100%, 50%)",
      "0.5": "hsl(300,100%, 50%)",
      "1.0": "hsl(60 ,100%, 50%)"
    }
  }
)

API

Coming soon

Terrains

Coming soon

Details

Coming soon

References

Heavily inspired by other code. TODO: add references to blog post and original codebase

License

MIT © Marshall Brandt