Interactive 3D Brain Visualization with Micro-Scenes
Cerebral Machine is a cutting-edge single-page web application featuring an interactive 3D brain visualization. Built with Three.js and React Three Fiber, it showcases three core business modules (SaaS, Automation, Integration) through immersive micro-scenes with GPU-accelerated particles, custom GLSL shaders, and scroll-driven animations.
Live Demo: http://152.67.2.20:3000
- Brain Core Model - Progressive LOD loading (lod0 β lod1 β lod2)
- Emissive Fiber Shaders - Custom GLSL with animated displacement
- GPU Particle Streams - InstancedBufferGeometry with thousands of particles
- Interactive Modules - Clickable hotspots for SaaS, Automation, Integration
- Adaptive Quality - Automatic adjustment based on device capabilities
- Progressive Loading - Low-res first, high-res streaming
- Asset Optimization - Draco compression, KTX2 textures
- Target: 30-60 FPS on mid-range devices, <200MB peak memory
- GSAP + ScrollTrigger - Scroll-driven state changes
- Micro-Scene Timelines - Smooth transitions for module details
- Camera Paths - Pre-baked rigs with cubic easing
- Keyboard Navigation - Full Tab/Enter support
- Screen Reader Compatible - ARIA attributes
- Static Fallback - SVG/CSS hero for low-end devices
- Skip 3D Toggle - Respect
prefers-reduced-motion
- Bloom - Thresholded emissive glow
- God-rays - Depth/occlusion-based
- Temporal AA - Smooth anti-aliasing
- Vite - Build tool & dev server
- React 18 - UI framework
- TypeScript - Type safety
- Three.js - WebGL rendering engine
- @react-three/fiber - React renderer for Three.js
- @react-three/drei - Useful helpers (OrbitControls, Html, etc.)
- @react-three/postprocessing - Effect composer
- GSAP - Animation library
- ScrollTrigger - Scroll-driven animations
- Leva - GUI controls for dev/debugging
- ESLint - Code linting
- Node.js 18+
- npm 9+
# Clone repository
git clone https://github.com/Pratyush150/Kairo_studio_website.git cerebral-machine
cd cerebral-machine
# Install dependencies
npm install
# Start development server
npm run devVisit http://localhost:3000 to see the application.
# Create production build
npm run build
# Preview production build
npm run previewcerebral-machine/
βββ docs/
β βββ IMPLEMENTATION_SPEC.md # Complete technical specification
β βββ PHASES.md # 14-phase development roadmap
βββ public/
β βββ draco/ # Draco decoder files
β βββ basis/ # KTX2 transcoder files
βββ src/
β βββ assets/
β β βββ models/ # GLTF models (brain core, modules)
β β βββ textures/ # KTX2 compressed textures
β βββ components/
β β βββ CanvasRoot.jsx # r3f Canvas wrapper
β β βββ BrainScene.jsx # Main 3D scene
β β βββ BrainCore.jsx # Brain core with LOD (TODO)
β β βββ ModuleMicroScene.jsx # Module detail views (TODO)
β β βββ HUDOverlay.jsx # HTML overlay (TODO)
β β βββ FallbackHero.jsx # Static fallback (TODO)
β βββ lib/
β β βββ loaders.js # DRACO, KTX2, GLTF loaders (TODO)
β β βββ shaders/
β β βββ fiberShader.glsl # Emissive fiber shader (TODO)
β β βββ particleShader.glsl # GPU particle shader (TODO)
β βββ utils/
β β βββ perf.js # Adaptive quality manager (TODO)
β β βββ analytics.js # Analytics tracking (TODO)
β βββ App.jsx # Root component
β βββ main.jsx # Entry point
β βββ index.css # Global styles
βββ scripts/
β βββ optimize-assets.js # Asset compression pipeline (TODO)
βββ index.html # HTML entry point
βββ vite.config.js # Vite configuration
βββ tsconfig.json # TypeScript config
βββ package.json # Dependencies
Current Phase: Phase 1 - Foundation & Setup β COMPLETED
- β
Phase 1: Foundation & Setup (100%)
- Clean project structure
- Vite + React + TypeScript configured
- All core dependencies installed
- Basic canvas rendering working
- Project documentation in place
- β³ Phase 2: Loaders & Asset Pipeline
- β³ Phase 3: Brain Core & LOD System
- β³ Phase 4: Shaders & Materials
- β³ Phase 5: Module Hotspots & Interaction
- β³ Phase 6: Micro-Scenes
- β³ Phase 7: GSAP & Scroll Integration
- β³ Phase 8: Postprocessing & Effects
- β³ Phase 9: Performance & Optimization
- β³ Phase 10: Accessibility & Fallbacks
- β³ Phase 11: Analytics & Monitoring
- β³ Phase 12: CI/CD & Deployment
- β³ Phase 13: Testing & QA
- β³ Phase 14: Polish & Launch
Overall Progress: 7% (1/14 phases complete)
See docs/PHASES.md for detailed roadmap.
- IMPLEMENTATION_SPEC.md - Complete technical specification (60+ pages)
- PHASES.md - 14-phase development roadmap with tasks
- High-level architecture
- Loader strategy & code patterns
- Shader architecture (GLSL examples)
- Micro-scenes implementation
- Performance budgets & targets
- Progressive enhancement strategy
- CI/CD pipeline
- Testing checklist
| Metric | Target |
|---|---|
| Initial JS Bundle | β€ 150 KB gzipped |
| First Meaningful Paint | < 1.5 MB total |
| First 3D Interactive | < 2.5 MB assets |
| Peak Memory (Mobile) | < 200 MB |
| FPS (Mid-range) | 30-60 FPS |
| FPS (Desktop) | 50-60 FPS |
Enforcement: CI with Lighthouse thresholds
npm run dev # Start development server (port 3000)
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintThe dev server runs on:
- Local: http://localhost:3000
- Network: http://0.0.0.0:3000 (accessible from other devices)
3D Rendering:
- Three.js (WebGL engine)
- react-three-fiber (React renderer)
- @react-three/drei (helpers)
Animation:
- GSAP (core animations)
- ScrollTrigger (scroll-driven)
Performance:
- Draco compression (models)
- KTX2/Basis textures
- LOD (Level of Detail)
- InstancedBufferGeometry
This project follows a phased development approach. See docs/PHASES.md for the current phase and tasks.
- Follow TypeScript strict mode
- Use functional React components
- Optimize for performance (draw calls, memory)
- Test on target devices (mid-range Android, iPhone)
- Document complex shaders and algorithms
MIT License - See LICENSE file for details
- Three.js Team - Powerful WebGL engine
- Poimandres - React Three Fiber & Drei
- GreenSock - GSAP animation platform
- Vite - Lightning-fast build tool
For questions or support:
- π Documentation: See
/docsfolder - π Issues: GitHub Issues
Status: β Phase 1 Complete - Foundation Ready Next: Phase 2 - Loaders & Asset Pipeline Live: http://152.67.2.20:3000
Built with β€οΈ using React Three Fiber
Last Updated: November 2025 Version: 1.0.0 (Phase 1) Framework: Vite + React + Three.js