Skip to content

Interactive hardware accelerated Mandelbrot set viewer

Notifications You must be signed in to change notification settings

bohjak/mandelbrot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandelbrot Set Explorer

Interactive (as in one can zoom and move around) Mandelbrot set viewer. GPU-rendered with wgpu.

Mandelbrot Fractal

How To Run

Prerequisites: cargo (rustc version >= 1.56.0), for WASM build wasm-pack, and for dev server go.

It's possible to run either natively or in the browser. It's now only possible to run in the browser.

First step is to clone the repository.

git clone https://github.com/bohjak/mandelbrot
cd mandelbrot

For running in the browser:

  1. build with wasm-pack;
    wasm-pack build --target web
  2. run server;
    go run server.go
  3. open in browser.
    open http://localhost:3000

Note
The server uses server-sent events to reload the page when receiving a request to /sse/reload. It's possible to automatically build the project and reload the page for development convenience.
E.g. with entr: ls src/*.rs | entr -cs 'wasm-pack build --dev --target=web && curl http://localhost:3000/sse/reload'

Controls

  • Mouse: left-click and drag to move around, scroll-wheel to zoom;
  • ArrowLeft / H / A: pan left;
  • ArrowDown / J / S: pan down;
  • ArrowUp / K / W: pan up;
  • ArrowRight / L / D: pan right;
  • Ctrl + Direction: pan faster;
  • Shift + Direction: pan slower;
  • Plus / Equals: zoom in;
  • Minus: zoom out;
  • R: reset position and zoom level.

Warning
Controls are being reworked, only mouse and R for reset are functional currently.