A high-performance, real-time fractal flame generator powered by WebGPU technology. Create, customize, and share stunning fractal art with hardware-accelerated rendering and an intuitive React interface.
- WebGPU-accelerated rendering for smooth, real-time fractal computation
- Chaos game algorithm implementation with parallel GPU processing
- Interactive parameter control with instant visual feedback
- Multiple fractal variations including Linear, Sinusoidal, Spherical, and more
- Transform editing with visual overlay system
- Animation system with customizable speed controls
- Color palette selection from dozens of built-in colormaps
- Post-processing effects including gamma correction, hue/saturation shifts
- Zoom and pan with mouse/touch controls
- Symmetry settings with rotation and mirror options
- Control fractal transforms using MediaPipe hand tracking
- Gesture-based interaction for immersive creative sessions
- Real-time hand position mapping to transform parameters
- Works in fullscreen mode for distraction-free creation
- Public gallery powered by Supabase database
- Save and share your fractal creations with the community
- View statistics and browse popular fractals
- Filtering and sorting by creation date, popularity, and style
- High-quality PNG export at full resolution
- Animated GIF generation with customizable settings
- Batch processing for creating fractal sequences
- Progress tracking for long export operations
- Responsive design optimized for desktop and tablet
- Mobile detection with appropriate user guidance
- Progressive Web App (PWA) capabilities
- Touch-friendly controls for tablet users
- Node.js 18+
- WebGPU-compatible browser:
- Chrome 113+ (recommended)
- Edge 113+
- Firefox Nightly (with WebGPU enabled)
- Safari Technology Preview (macOS 13.3+)
-
Clone the repository
git clone https://github.com/your-username/electric-sheep-gpu.git cd electric-sheep-gpu
-
Navigate to the app directory
cd electric-sheep
-
Install dependencies
npm install
-
Set up environment variables (for gallery features)
cp .env.example .env.local
Edit
.env.local
with your Supabase credentials:VITE_SUPABASE_URL=your-supabase-project-url VITE_SUPABASE_ANON_KEY=your-supabase-anon-key
-
Start the development server
npm run dev
-
Open your browser to
http://localhost:5173
electric-sheep/
โโโ public/ # WebGPU Engine & Static Assets
โ โโโ main.js # Core WebGPU rendering engine
โ โโโ fractal_functions.js # Fractal math & variations
โ โโโ colourmaps.js # Color palette definitions
โ โโโ ...
โโโ src/
โ โโโ components/ # React UI Components
โ โ โโโ FractalViewer.tsx # Main fractal interface
โ โ โโโ Gallery.tsx # Community gallery
โ โ โโโ FullScreenViewer.tsx # Immersive mode
โ โ โโโ ui/ # Reusable UI components
โ โโโ hooks/ # Custom React hooks
โ โ โโโ useFractalStorage.ts # Supabase integration
โ โ โโโ useSEO.ts # SEO management
โ โ โโโ useMobileDetection.ts
โ โโโ types/ # TypeScript definitions
โโโ ...
- Frontend: React 19.1.0 + TypeScript
- Build Tool: Vite 6.3.5 with optimized config
- GPU Computing: WebGPU API with WGSL compute shaders
- UI Framework: Radix UI primitives with Tailwind CSS
- Backend: Supabase (PostgreSQL + Storage)
- Hand Tracking: MediaPipe Hands
- Deployment: Vercel with custom configuration
- Launch the app and wait for the WebGPU engine to initialize
- Generate your first fractal using the "Randomize" button
- Explore the controls in the tabbed interface:
- Controls: Playback, animation, and generation
- Visual: Colors, zoom, and visual effects
- Transforms: Edit individual fractal transforms
- Advanced: Symmetry, chain settings, and fine-tuning
- Export: Save and share your creations
- Click and drag on the canvas to pan
- Scroll wheel to zoom in/out
- Enable Transform Overlay to see and manipulate transforms visually
- Toggle animations for dynamic, evolving fractals
- Click "Add to Gallery" to save to the public database
- Add a title and description for your fractal
- Export as PNG for high-quality static images
- Create animated GIFs to capture fractal motion
For gallery functionality, set up a Supabase project:
-- Create fractals table
CREATE TABLE public.fractals (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
title TEXT NOT NULL DEFAULT 'Untitled Fractal',
description TEXT,
config JSONB NOT NULL,
transforms JSONB NOT NULL,
colormap TEXT NOT NULL DEFAULT 'gnuplot',
width INTEGER NOT NULL DEFAULT 1024,
height INTEGER NOT NULL DEFAULT 1024,
thumbnail_url TEXT,
full_image_url TEXT,
gif_url TEXT,
view_count INTEGER DEFAULT 0,
created_at TIMESTAMP WITH TIME ZONE DEFAULT TIMEZONE('utc'::text, NOW()) NOT NULL
);
-- Create indexes for performance
CREATE INDEX idx_fractals_created_at ON public.fractals(created_at DESC);
CREATE INDEX idx_fractals_view_count ON public.fractals(view_count DESC);
CREATE INDEX idx_fractals_config_gin ON public.fractals USING GIN (config);
CREATE INDEX idx_fractals_transforms_gin ON public.fractals USING GIN (transforms);
-- Enable public access
ALTER TABLE public.fractals DISABLE ROW LEVEL SECURITY;
- Connect your GitHub repository to Vercel
- Configure build settings:
- Build Command:
npm run build
- Output Directory:
electric-sheep/dist
- Build Command:
- Add environment variables in Vercel dashboard
- Deploy automatically on git push
The included vercel.json
handles:
- WebGPU required headers (COOP/COEP)
- Proper MIME types for ES modules
- Client-side routing configuration
# Build the project
cd electric-sheep
npm run build
# Deploy the dist/ folder to your preferred hosting service
This application implements the Fractal Flame algorithm developed by Scott Draves:
- Iterated Function Systems (IFS) with nonlinear variations
- Chaos game rendering with histogram accumulation
- Weighted variation blending for complex mathematical functions
- Color interpolation using curated palettes
- Real-time parameter animation for dynamic evolution
- Linear, Sinusoidal, Spherical, Swirl
- Horseshoe, Polar, Handkerchief, Heart
- Disc, Spiral, Hyperbolic, Diamond
- Ex, Julia, Bent, Waves, Fisheye
- And many more...
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and test thoroughly
- Commit with clear messages:
git commit -m 'Add amazing feature'
- Push to your branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow TypeScript best practices
- Test WebGPU functionality across browsers
- Maintain responsive design principles
- Document new features and APIs
This project is licensed under the MIT License - see the LICENSE file for details.
- Scott Draves - Creator of the original Electric Sheep and Fractal Flame algorithm
- WebGPU Working Group - For the amazing GPU computing standard
- React & Vite communities - For excellent development tools
- Supabase team - For the seamless backend solution
- WebGPU Specification
- Fractal Flame Algorithm Paper
- Electric Sheep Project
- MediaPipe Hands Documentation
Experience the beauty of mathematical art with real-time GPU acceleration โจ
Made with โค๏ธ for the creative coding community