Skip to content

Fractals in WebGPU compute shaders, with a twist! Make infinite never-seen variations of famous fractals and more.

License

Notifications You must be signed in to change notification settings

joshbrew/webgpu_fractals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebGPU Fractals

Screenshot 2025-11-20 224655-min

See also: 3D point cloud fractals (earlier non-WebGPU version)

This is a comprehensive WebGPU fractal rendering system built on compute shaders. It features a lot of well known fractals plus a bunch of custom ones that mostly build off of newton's fractals. It is written in pure javascript and WGSL with zero dependencies.

There are 71 fractal formulas to mess around with plus dozens of modifiers that alter the coordinates per-iteration in combinable ways. There are infinite possibilites, you might be surprised what you find.

You can:

  • Control pan, zoom, iteration count, resolution (up to 8K!), escape radius, convergence...
  • Modify the per-iteration math with a variety of cumulative effects.
  • Add displacement mapping and lighting with flexible mesh resolution.
  • Control which parts of the fractal are visible.
  • Change color and hue in a very wide range, plus a simple optional lighting and specular model.
  • Edit in real time with instantaneous updates to fine tune your favorite images.
  • Click on the canvas to get camera control with WASD support. Press esc to quit.
  • Download the image at full resolution (use reset camera if you moved so you can get the full image!). 8K images can be up to 50MB raw

Some limits:

  • No deep zoom as we rely on base 32 bit float precision. We make up for it with the modifiers. It bottoms out around 7 decimals of precision.
  • Julia sets don't work well with the modifiers so they're excluded, but you can still mess with the classic one.

Build and run

With tinybuild installed globally (npm i -g tinybuild): npm start

Configuration

See ./tinybuild.config.js for settings.

Add build:true for build-only, add serve:true for serve-only, or set bundle or server to false alternatively.

Click to go to youtube: Video1 Click to go to youtube: Video2 Click to go to youtube: Video3

More screenshots:

image fractal-2560-kmrb67 fractal-2048-6w645p-min fractal-1536-jltvae-min fractal-3968-jjxvep-min fractal-3968-vv22hy-min fractal-4096-pl3iog-min fractal-4096-4mfwjr-min fractal-4096-1xos3i-min 19image 18image 17image 13image 11image 9image 7image 6image 3image 2image 14image

About

Fractals in WebGPU compute shaders, with a twist! Make infinite never-seen variations of famous fractals and more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published