Skip to content

neurabytelabs/lithosphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Lithosphere

Procedural WebGPU Shader Studio

HAL 9000 inspired glowing orb with real-time controls

Live Demo GitHub License


Live Demo ยท Watch Video ยท Report Bug


https://github.com/mrsarac/lithosphere/raw/main/videos/lithosphere5.mp4


About

Lithosphere is a real-time procedural shader playground built with WebGPU. It features a dual-mesh rendering system with an inner glowing core inspired by HAL 9000 and a transparent outer gel shell with advanced light transmission.

The project includes a professional Shader Studio debug panel (inspired by Substance Designer) that allows real-time manipulation of every shader parameter, plus Gemini AI integration for natural language shader suggestions.


Features

Feature Description
WebGPU Rendering Next-gen graphics API with Three.js TSL (Three Shading Language)
Dual-Mesh System Inner glowing core + transparent outer gel shell with light bleeding
HAL 9000 Aesthetic Menacing red glow with pulsing animations
Shader Studio Panel Professional debug panel with 70+ real-time parameters
Post-Processing Bloom, chromatic aberration, vignette with WebGPU-native TSL
HDR Environment Load .hdr/.exr files for realistic reflections and backgrounds
Capture Studio Screenshot (PNG/JPEG) + video recording (WebM up to 60fps)
GLTF Import Load custom 3D models with auto-normalization
10 Built-in Presets HAL 9000, Blue Crystal, Toxic Green, Golden Sun, Purple Void + 5 more
AI Integration Gemini-powered natural language shader suggestions
TSL Code Export Copy or download your shader code for external use
60 FPS Performance Optimized procedural noise with MaterialX functions

Tech Stack

React TypeScript Three.js WebGPU Vite Tailwind

Technology Purpose
React 19 UI framework with concurrent features
Three.js r182 3D rendering with WebGPU backend
TSL Three Shading Language for node-based materials
MaterialX Noise mx_fractal_noise_float, mx_noise_float for procedural textures
Vite Blazing fast development and HMR
Tailwind CSS Utility-first styling for debug panel
Gemini API AI-powered shader suggestions

Quick Start

# Clone the repository
git clone https://github.com/mrsarac/lithosphere.git
cd lithosphere

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

Open http://localhost:5173 in a WebGPU-compatible browser.


Browser Support

WebGPU is required. Check caniuse.com/webgpu for current support.

Browser Version Status
Chrome 113+ โœ… Supported
Edge 113+ โœ… Supported
Safari 18+ (macOS Sonoma) โœ… Supported
Firefox Nightly โš ๏ธ Experimental

Shader Studio Controls

Open the SHADER STUDIO panel at the bottom of the screen:

Tab Controls
Core Geometry size, base/glow colors, metalness, roughness, pulse intensity, noise scale
Gel Transmission, thickness, IOR, clearcoat, attenuation color/distance
Light Key light, fill light, rim light, HAL core point light
Anim Auto-rotate speed, breathing amplitude, wobble intensity
Shape Geometry type (Sphere, Icosahedron, Torus), mesh visibility
Presets One-click style presets with instant preview
AI Natural language shader modification via Gemini

Presets

HAL 9000
Classic menacing red
Blue Crystal
Icy cold glow
Toxic Green
Radioactive energy
Golden Sun
Warm solar plasma
Purple Void
Deep space anomaly
White Dwarf
Stellar remnant

Changelog

v5.0.0-alpha.1 (2025-12-19) - Three-Body Problem

Physics Engine Sprint 1 - Foundation Complete!

  • ๐ŸŒŒ Physics Engine - Full N-body gravity simulation (Newton's F = Gmโ‚mโ‚‚/rยฒ)
  • โšก Gravity Modes - Newton (realistic), Artistic (exaggerated), Magnetic (attract/repel)
  • ๐Ÿ“ฆ Boundary System - Bounce, Wrap, or Contain objects within world boundaries
  • ๐Ÿ’Ž Gel Interaction - Collision, Deformation, and Merge modes (UI ready)
  • ๐ŸŽจ Orbit Trails - Trail visualization for object paths (UI ready)
  • ๐ŸŒ€ Three-Body Chaos - Chaotic dynamics with 3+ cores
  • โš–๏ธ Mass System - Auto (scale-based) or manual mass for each instance
  • โฑ๏ธ Time Scale - Control simulation speed from 0.1x slow-mo to 3x fast-forward

v4.0.0-rc1 (2025-12-19) - Multiverse

Multi-Core & Gel System

  • ๐ŸŒ Multi-Core System - Create and manage up to 10 core instances
  • ๐Ÿ’Ž Multi-Gel System - Create and manage up to 10 gel instances
  • ๐Ÿ“ Instance Transforms - Position, rotation, and scale for each instance
  • ๐Ÿ”— Core-Gel Linking - Gels follow linked core position automatically
  • โœจ Arrangement Presets - 6 presets: Single, Binary, Orbital, Triangle, Stack, Cluster
  • ๐Ÿ“‹ Duplicate Instances - Clone any core or gel with one click
  • ๐ŸŽญ Animation Sync - Synchronized, independent, or staggered modes
  • ๐Ÿ‘๏ธ Instance Visibility - Toggle each instance on/off independently

v3.7.x (2025-12-19) - Master Light Control

Light & Shader Toggles

  • ๐Ÿ’ก 9 Light Toggles - On/off for every light: Key, Fill, Top, Rim 1&2, HAL Core/Back, Red Rim, Ambient
  • ๐ŸŽญ Shader Effect Toggles - Fresnel, Specular, Red Bleed, Sheen, Env Reflection
  • ๐Ÿ”† Fresnel/Specular Control - Adjustable power & intensity for edge glow and highlights

v3.6 (2025-12-19) - Sprint 5: Right-Side Panel

New Features:

  • ๐Ÿ“ฑ Right-Side Panel - Panel moved from bottom to right side for better UX
  • ๐ŸŽ›๏ธ Vertical Tab Sidebar - Icon + label tabs in a vertical layout
  • ๐Ÿ“œ Scrollable Content - Full-height scrollable content area
  • โŒ No Camera Zoom - Removed camera zoom-out when panel opens (not needed with right layout)
  • ๐ŸŽจ Compact UI - Optimized all controls for narrow panel width

v3.5 (2025-12-18) - Sprint 3 & 4: Camera Control + UX

Sprint 4 - UX & Versioning:

  • ๐Ÿ“‹ Dropdown Menus - Config (Import/Export/Reset) and Code (TSL) actions consolidated
  • ๐Ÿท๏ธ Version Strategy - Single Source of Truth (version.ts) for all version references
  • ๐ŸŽฅ Improved Camera Sync - More aggressive zoom (+3 units) and target shift (+1.5 Y)

Sprint 3 - Camera Control:

  • ๐ŸŽฅ Panel-Camera Sync - Camera zooms out and shifts up when panel opens (no overlap)
  • ๐ŸŽฌ Smooth Camera Animation - easeOutCubic easing with 60fps transitions
  • ๐ŸŽฏ Camera Presets - Default, Close-Up, Wide Shot, Top-Down instant switching
  • ๐Ÿ”’ Lock Camera - Toggle to prevent user camera interaction
  • ๐Ÿ“ Orbit Target Y - Control vertical position of orbit center
  • ๐Ÿ“ Distance Slider - Direct camera distance control

v3.0 (2025-12-18) - Sprint 2: Visual Capture

New Features:

  • ๐Ÿ”ฒ Vignette Effect - Custom TSL vignette with UV-based distance calculation and smoothstep falloff
  • ๐Ÿ“ธ Screenshot Capture - PNG (lossless) or JPEG with quality control
  • ๐ŸŽฌ Video Recording - WebM with VP9/VP8 codec, configurable bitrate (1-15 Mbps) and FPS (24-60)
  • ๐ŸŒ HDR Environment Maps - RGBELoader for .hdr/.exr files with realistic reflections
  • ๐Ÿ–ผ๏ธ HDR Background - Optional environment background with blur control
  • โฑ๏ธ Recording Timer - Real-time duration display during video capture
  • ๐Ÿ“Š New Capture Tab - Dedicated tab for all capture controls

v2.5 (2025-12-18) - Sprint 1: Visual Evolution

New Features:

  • โœจ Post-Processing Pipeline - WebGPU-native bloom, chromatic aberration, vignette
  • ๐ŸŽจ TSL Bloom Effect - Configurable intensity, threshold, and radius
  • ๐ŸŒˆ Chromatic Aberration - RGB color separation effect
  • ๐Ÿ“ฆ GLTF Import - Load custom 3D models with automatic centering and normalization
  • ๐Ÿ“ค TSL Code Export - Copy/download shader code for external use
  • ๐ŸŽฏ Effects Tab - Centralized post-processing controls

v2.0 (2025-12-18)

Shader Studio Update:

  • โœจ Shader Studio Panel - Professional debug interface inspired by Substance Designer
  • ๐ŸŽฌ Camera Tab - FOV, distance limits, damping controls
  • ๐Ÿ’ก Advanced Lighting - Key light position (X/Y/Z), dynamic lighting toggle, orbit speed
  • ๐ŸŽก Animation Controls - Mesh rotation speed, breathing sync, wobble intensity
  • ๐ŸŽฒ Random Button - One-click color randomization
  • โŒจ๏ธ Keyboard Shortcuts - ~ toggle panel, 1-8 switch tabs, Esc close
  • ๐Ÿ“Š FPS Counter - Real-time performance monitoring
  • ๐ŸŒˆ 10 Presets - HAL 9000, Blue Crystal, Toxic Green, Golden Sun, Purple Void, White Dwarf + 4 new
  • ๐Ÿค– Gemini AI Integration - Natural language shader suggestions
  • ๐Ÿ“ฆ Import/Export - Save and share configurations as JSON

v1.0 (2025-12-17)

Initial Release:

  • ๐ŸŒ WebGPU Rendering - Three.js with TSL (Three Shading Language)
  • ๐Ÿ”ฎ Dual-Mesh System - Inner core + outer gel shell
  • ๐ŸŽญ HAL 9000 Aesthetic - Iconic glowing red orb
  • ๐ŸŒŠ MaterialX Noise - Procedural displacement
  • ๐Ÿ”„ Auto-Rotation - Smooth orbital animation
  • ๐Ÿ’จ 60 FPS - Optimized performance

Roadmap

  • WebGPU rendering with Three.js TSL
  • Dual-mesh system (core + gel shell)
  • Real-time shader parameter controls
  • 10 built-in presets
  • Import/Export configurations
  • Gemini AI integration
  • Camera controls (FOV, distance)
  • Advanced animation controls
  • Keyboard shortcuts
  • GLTF import (custom meshes)
  • Post-processing effects (bloom, chromatic aberration, vignette)
  • TSL shader code export
  • Screenshot capture (PNG/JPEG)
  • Video recording (WebM)
  • HDR environment maps
  • Camera presets & panel-camera sync
  • Audio reactivity (microphone/audio file input)
  • VR/AR support via WebXR
  • Community preset gallery
  • Mobile touch controls

Project Structure

lithosphere/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ RockScene.tsx      # Main WebGPU scene with dual-mesh system
โ”‚   โ”‚   โ””โ”€โ”€ DebugPanel.tsx     # Shader Studio control panel
โ”‚   โ”œโ”€โ”€ index.tsx              # App entry point
โ”‚   โ””โ”€โ”€ index.css              # Global styles
โ”œโ”€โ”€ videos/
โ”‚   โ””โ”€โ”€ lithosphere5.mp4       # Demo video
โ”œโ”€โ”€ index.html                 # HTML template
โ”œโ”€โ”€ nixpacks.toml              # Deployment config
โ””โ”€โ”€ package.json

Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE for details.


Author

Mustafa Sarac

Website GitHub Twitter


Part of mustafasarac.com/labs experimental projects.


If you like this project, please give it a โญ

About

๐ŸŒ Lithosphere โ€” Procedural WebGPU Shader Studio

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors