Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SHARP-Metal

Platform Swift Metal License

A macOS native 3D Gaussian Splatting viewer with Metal rendering and smooth camera animations.


✨ Features

🎨 High-Performance Rendering

  • Metal-accelerated real-time 3D Gaussian Splatting rendering
  • Support for .ply and .splat file formats
  • Optimized for Apple Silicon (M1/M2/M3) and Intel Macs

🎮 Interactive Camera Controls

  • Left Mouse Drag - Orbit rotation around the model
  • Right Mouse Drag - Pan the view
  • Scroll Wheel - Zoom in/out with unlimited range
  • WASD Keys - First-person style movement
  • Q/E Keys - Vertical movement (up/down)

🎬 Smooth Cinematic Animations

  • Z Key - Slow dolly zoom in (5 seconds, ease-out curve)
  • X Key - Smooth 180° rotation (3 seconds, ease-in-out curve)
  • R Key - Reset camera to default position

🖥️ Modern UI Design

  • Beautiful aurora background animation
  • Glowing orb effects
  • ReactBits-inspired minimalist design
  • Dark theme optimized for 3D content viewing

📸 Screenshots

Main Interface 3D Model Viewer
Modern UI with aurora effects Real-time Gaussian Splatting rendering

🚀 Quick Start

Prerequisites

  • macOS 13.0+ (Ventura or later)
  • Xcode 15.0+
  • Metal-compatible GPU

1. Clone the Repository

git clone https://github.com/Furinaaa-Cancan/SHARP-Metal.git
cd SHARP-Metal

2. Build the macOS App

cd MetalSplatter/SampleApp
xcodebuild -project MetalSplatter_SampleApp.xcodeproj \
    -scheme "MetalSplatter SampleApp" \
    -configuration Release build

3. Run the Application

After building, the app is located at:

~/Library/Developer/Xcode/DerivedData/MetalSplatter_SampleApp-xxx/Build/Products/Release/MetalSplatter SampleApp.app

Or open directly:

open ~/Library/Developer/Xcode/DerivedData/MetalSplatter_SampleApp-*/Build/Products/Release/MetalSplatter\ SampleApp.app

4. Get PLY Files

You can use SHARP to generate 3D Gaussian Splat .ply files from any image:

sharp predict -i your_image.jpg -o output.ply

📁 Project Structure

SHARP-Metal/
├── MetalSplatter/                    # Metal Renderer (macOS App)
│   ├── SampleApp/                    # macOS/visionOS Sample Application
│   │   ├── App/
│   │   │   ├── SampleApp.swift       # App entry point
│   │   │   └── Constants.swift       # Global constants
│   │   ├── Scene/
│   │   │   ├── ContentView.swift     # Main UI with aurora effects
│   │   │   ├── MetalKitSceneView.swift    # Metal view wrapper
│   │   │   └── MetalKitSceneRenderer.swift # Core rendering logic
│   │   ├── Model/
│   │   │   ├── ModelIdentifier.swift
│   │   │   └── ModelRenderer.swift
│   │   └── Util/
│   │       └── MatrixMathUtil.swift  # Matrix math utilities
│   ├── MetalSplatter/                # Core rendering library
│   ├── PLYIO/                        # PLY file I/O library
│   ├── SplatIO/                      # Splat format processing
│   └── SampleBoxRenderer/            # Debug box renderer
│
├── ml-sharp/                         # SHARP Algorithm (Python)
│   ├── src/sharp/
│   │   ├── cli/                      # Command-line interface
│   │   ├── models/                   # Neural network models
│   │   └── utils/                    # Utility functions
│   └── requirements.txt
│
├── .gitignore
└── README.md

⌨️ Keyboard Shortcuts

Key Action Description
W / Move Forward Move camera forward
S / Move Backward Move camera backward
A / Move Left Strafe left
D / Move Right Strafe right
Q Move Up Raise camera position
E Move Down Lower camera position
Z Dolly Zoom Smooth 5-second zoom in animation
X 180° Rotate Smooth 3-second rotation to view backside
R Reset View Reset camera to default position

Mouse Controls

Action Effect
Left Click + Drag Orbit rotation
Right Click + Drag Pan view
Scroll Wheel Zoom in/out

🛠️ Technical Details

Rendering Pipeline

  • Uses Metal's tile-based deferred rendering
  • Supports both single-stage and multi-stage render paths
  • Dynamic near/far clipping plane adjustment for unlimited zoom

Camera System

  • Orbit camera with yaw/pitch controls
  • Smooth animation interpolation using easing curves
  • Support for both mouse and keyboard input

File Format Support

  • PLY - Standard 3D Gaussian Splat format from SHARP
  • SPLAT - Optimized binary format for faster loading

📦 Dependencies

macOS App (MetalSplatter)

  • SwiftUI
  • MetalKit
  • simd (for matrix operations)

SHARP Algorithm (Python)

  • Python 3.10+
  • PyTorch
  • NumPy
  • Pillow

🙏 Acknowledgements

This project is built upon the following amazing open-source projects:

  • SHARP - Single-image to 3D Gaussian Splatting prediction
  • MetalSplatter - Metal-based Gaussian Splat renderer

Special thanks to the authors for their incredible work in making 3D Gaussian Splatting accessible.


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🤝 Contributing

Contributions are welcome! Feel free to:

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

Made with ❤️ by Furinaaa-Cancan

About

A macOS native 3D Gaussian Splatting viewer built on SHARP with Metal rendering and smooth camera animations.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages