rein
A three-d style 3D rendering library built on wgpu.
Features
- wgpu backend - Cross-platform graphics with WebGPU
- PBR materials - Physically-based rendering with Phong and PBR materials
- Shadow mapping - Directional light shadows
- Post-processing effects - FXAA, fog, and extensible effect chain
- Camera controls - Orbit, fly, and first-person controls
- URDF support - Load robot models from URDF files
- Text rendering - Optional GUI text rendering with glyphon
- Instanced rendering - Efficient rendering of many identical objects
Installation
Add to your Cargo.toml:
[]
= { = "https://github.com/MechanicalGirlDev/rein" }
Feature Flags
| Feature | Default | Description |
|---|---|---|
window |
Yes | Window management with winit |
gui |
No | Text rendering with glyphon |
Architecture
The library is organized into layers:
- context - Core wgpu wrapper (Device, Queue)
- core - Mid-level abstractions (buffers, textures, pipelines)
- renderer - High-level rendering (cameras, materials, objects, lights)
- window - Window management with winit (optional)
- gui - Text rendering (optional)
- urdf - URDF robot model support
Example
use ;
use ;
use RobotModel;
use ClearState;
use Vec3;
Acknowledgments
This project is heavily inspired by three-d, a fantastic 3D rendering library for Rust. The architecture, API design, and many implementation patterns in rein are based on three-d's excellent work. We are deeply grateful to the three-d authors and contributors for creating such a well-designed and educational codebase.
License
MIT License - see LICENSE for details.