webgl fractal browser
| debian | ||
| etc/apache2/conf-available | ||
| .gitignore | ||
| AGENTS.md | ||
| fractalus-screenshot.png | ||
| index.html | ||
| mandelbrot-renderer.js | ||
| README.md | ||
Fractalus WebGL Renderer
A high-performance WebGL-based fractal renderer supporting multiple fractal formulas, rotation, color cycling, and SVG export.
Supported Fractals
- Mandelbrot — classic z² + c escape-time fractal
- Burning Ship — uses absolute values: (|Re(z)| + i|Im(z)|)² + c
- Tricorn — conjugate variant: conj(z)² + c
- Julia — fixed c parameter, z starts at pixel position
- Phoenix — z² + Re(c) + Im(c)·z_{n-1} with memory of previous iteration
- Newton (z³−1) — Newton's method root-finding, colored by convergence
Features
- Multiple Fractal Types: Switch between 6 formulas via dropdown selector
- Rotation: Toggle auto-rotation with adjustable speed (0.1x–5.0x)
- WebGL Rendering: Hardware-accelerated fractal computation using GPU shaders
- Fullscreen Mode: Immersive full-screen exploration with F key toggle
- Intelligent Autopilot: Automatic exploration with smart navigation to interesting regions
- Mouse Wheel Navigation: Precise cursor-centered zooming
- Palette Control: Left/right mouse buttons for color palette stepping, hold for continuous cycling
- Color Cycling: Smooth automatic color transitions with adjustable speed
- SVG Export: Captures WebGL framebuffer as scalable SVG with metadata JSON
- Deep Linking: URL parameters for sharing specific views
- Mastodon Sharing: Client-side sharing via Web Intent with clipboard image copy and hashtags
Quick Start
Just open index.html in a browser, or serve the directory:
python3 -m http.server 8000
# Open http://localhost:8000
Interactive Controls
Navigation
- Mouse Wheel: Zoom in/out centered on cursor position
- Middle Mouse Drag: Pan around the fractal
- F Key: Toggle fullscreen
- Escape: Exit autopilot mode
Fractal Selection
- Fractal dropdown: Switch between formulas (view resets to optimal defaults per type)
Rotation
- 🔄 Rotation: Toggle auto-rotation on/off
- Speed slider: Adjust rotation speed (full revolution per 20s at 1.0x)
Color Palette
- Left Mouse Click: Step to previous palette (−25°)
- Right Mouse Click: Step to next palette (+25°)
- Hold Mouse: Continuously cycle through palettes
- Arrow Keys: Left/Right rotate colors (±15°), Shift for fine (±5°)
- R Key: Reset color palette
Autopilot
- 🚁 Start Autopilot: Automatic exploration with smart zoom, panning, and color changes
- Visits curated interesting locations (seahorse valleys, spiral areas, etc.)
- Smooth 2–5 second transitions, 2–8 second intervals
- Press Esc to stop
Screenshots & Sharing
- 📸 Take Screenshot: Save SVG + metadata JSON with file picker dialog
- 🐘 Share to Mastodon: Copy image to clipboard, open Mastodon with pre-filled post text and hashtags
URL Parameters
type— fractal type (0=Mandelbrot, 1=Burning Ship, 2=Tricorn, 3=Julia, 4=Phoenix, 5=Newton)cx,cy— center coordinatesz— zoom leveliter— max iterationsoffset,scale— color palette parametersrot— rotation angle (radians)jcx,jcy— Julia set c parameterpalette— named preset (default, fire, ocean, neon, pastel)
Technical Details
WebGL Shaders
- Single fragment shader with branching for all 6 fractal formulas
- Coordinate rotation via uniform angle applied before iteration
- Newton fractal uses convergence-based coloring (root detection via
atan) - Complex arithmetic helpers (
complexMul,complexDiv) for Newton's method - HSV to RGB conversion for vibrant color generation
SVG Generation
- Reads WebGL framebuffer pixel data
- Groups pixels by color and merges adjacent pixels into rectangles
- Includes fractal name and timestamps in SVG metadata
Browser Requirements
- WebGL support
- ES6 JavaScript support
Installation
Debian/Ubuntu
Packages are available. Please use the repo:
wget -qO- https://repo.vitexsoftware.com/KEY.gpg | sudo tee /etc/apt/trusted.gpg.d/vitexsoftware.gpg
echo "deb [signed-by=/etc/apt/trusted.gpg.d/vitexsoftware.gpg] https://repo.vitexsoftware.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
sudo apt update
sudo apt install fractalus
The installed package serves the app via Apache at /fractalus and provides a fractalus launcher command.
Building from Source
dpkg-buildpackage -us -uc -b
Enjoy exploring the infinite complexity of fractals!
