A production-ready WebXR viewer for 3D Gaussian Splats visualization built with Three.js and TypeScript. Supports immersive VR and AR experiences with touch and mouse controls.
NOTE: This project is a demo and uses AI heavily for code generation.
- WebXR Support: VR and AR immersive experiences
- 3D Gaussian Splats Rendering: Efficient visualization of 3DGS models
- Responsive Controls: Mouse, touch, and keyboard controls
- Performance Monitoring: Real-time FPS and rendering stats
- Production Build: Optimized webpack configuration for production deployments
- TypeScript: Full type safety and modern ES2020+ features
- High-Performance Rendering: Uses Three.js with optimized settings
- Node.js >= 18.0.0
- npm >= 9.0.0
- Modern browser with WebGL 2.0 support
- WebXR support for AR/VR features (optional)
npm installStart the development server with hot module reloading:
npm run devThe application will open at http://localhost:8080 with automatic reload on code changes.
Create an optimized production build:
npm run buildOutput will be in the dist/ directory, ready for deployment.
Create a development build with source maps:
npm run build:dev- Click "Load Model" to load a demo 3D Gaussian Splats model
- Use mouse or touch to rotate and zoom the model:
- Mouse: Click and drag to rotate, scroll to zoom
- Touch: Swipe to rotate, pinch to zoom
- Click "Reset View" to return to the default camera position
If your device supports WebXR:
- Click "Enter VR" to start an immersive VR session
- Click "Enter AR" to start an AR experience (on supported devices)
- Use your device's motion controllers or hand tracking (if available)
- Load Model: Load a demo 3DGS model
- Enter VR: Start immersive VR session (if supported)
- Enter AR: Start immersive AR session (if supported)
- Reset View: Reset camera to default position
- Fullscreen: Toggle fullscreen mode
src/
├── index.ts # Main application entry point
├── index.html # HTML template
├── renderer/
│ └── GaussianSplattingRenderer.ts # 3DGS rendering engine
├── xr/
│ └── WebXRController.ts # WebXR session management
├── controls/
│ └── CameraController.ts # Camera and input controls
├── ui/
│ └── UIManager.ts # UI state management
└── utils/
└── Stats.ts # Performance monitoring
dist/ # Build output (generated)
- webpack.config.js: Webpack bundler configuration
- tsconfig.json: TypeScript compiler options
- .eslintrc.json: ESLint linting rules
- .prettierrc.json: Code formatting rules
- .gitignore: Git ignore rules
npm run dev: Start development servernpm run build: Create production buildnpm run build:dev: Create development build with source mapsnpm run type-check: Run TypeScript type checkingnpm run lint: Run ESLintnpm run format: Format code with Prettiernpm run start: Alias fornpm run devnpm run serve: Serve dist folder (after building)
To load your own 3D Gaussian Splats model:
- Convert your model to a supported format (e.g., PLY, GLB)
- Place the file in the
public/directory - Modify
GaussianSplattingRenderer.tsto load your model
Example:
await this.gsSplattingRenderer.loadFromFile('./path/to/model.ply');The build is configured with:
- Code Splitting: Vendors and Three.js separated into chunks
- Minification: Terser for JavaScript compression
- Source Maps: Available in development, disabled in production
- Tree Shaking: Unused code removed during build
- Asset Optimization: Gzip compression for deployment
| Browser | Status |
|---|---|
| Chrome/Edge | ✓ Full support |
| Firefox | ✓ Full support |
| Safari | ✓ Partial support |
| Mobile Chrome | ✓ Full support (with AR/VR) |
| Mobile Safari | ⚠ Limited support |
For WebXR features to work:
- VR: Requires compatible headset (Meta Quest, HTC Vive, Valve Index, etc.)
- AR: Requires AR-capable device (Android with ARCore, iOS 12+)
npm run build
npm run serveAfter building, deploy the dist/ folder to your web server:
npm run build
# Upload dist/ folder to your serverWebXR features require HTTPS in production. Configure your server accordingly.
- Reduce Splat Count: For mobile devices, use models with fewer splats
- Enable WebGL Extensions: Use
EXT_color_buffer_floatfor better precision - Adjust LOD: Implement level-of-detail for large models
- Memory Management: Dispose of unused geometries and textures
- Check browser support at https://caniuse.com/webxr
- Ensure the page is served over HTTPS (except localhost)
- Verify device has WebXR support
- Reduce model complexity (splat count)
- Enable GPU acceleration in browser settings
- Check available GPU memory
- Use
npm run buildfor production performance
- Check browser console for errors
- Verify file path is correct
- Ensure file format is supported
- Check file size doesn't exceed browser limits
# Install dependencies
npm install
# Start development server
npm run dev
# Make code changes (hot reload enabled)
# Run type checking
npm run type-check
# Format code
npm run format
# Lint code
npm run lint
# Build for production
npm run build
# Serve production build
npm run serveMIT
Contributions are welcome! Please feel free to submit a Pull Request.
- Three.js Documentation
- WebXR Device API
- 3D Gaussian Splatting
- Webpack Documentation
- TypeScript Documentation
For issues, questions, or contributions, please open an issue or contact the maintainers.