Version: 0.1.0
Renderlib: A wgpu/winit framework for graphics applications in Rust
This documentation provides comprehensive information about renderlib, including:
- Architecture: High-level system design and component interactions
- Guides: Step-by-step tutorials and best practices
- API Reference: Complete reference to all public types, functions, and methods
docs/
├── README.md # This file
├── architecture/ # Architecture documentation
│ ├── 01-OVERVIEW.md # High-level overview and design philosophy
│ ├── 02-MODULES.md # Detailed module documentation
│ └── 03-COMPONENT_INTERACTIONS.md # Component interactions and data flow
├── guides/ # How-to guides and tutorials
│ ├── GETTING_STARTED.md # Create your first renderlib application
│ └── RENDERING.md # Rendering pipelines guide
└── api/ # API reference
└── REFERENCE.md # Complete API documentation
Start with the Architecture Overview to understand renderlib's design and components.
Work through the Getting Started Guide to create your first application.
Study the included demos:
src/bin/triangle.rs- Simple triangle renderingsrc/bin/forward.rs- Forward rendering with lightingsrc/bin/deferred.rs- Deferred rendering with G-buffer
Use the API Reference for detailed information about all public types and functions.
| Document | Description |
|---|---|
| 01-OVERVIEW | Project summary, architecture layers, core components, design philosophy |
| 02-MODULES | Detailed documentation for each module |
| 03-COMPONENT_INTERACTIONS | How components interact during startup, rendering, resize, etc. |
| Document | Description |
|---|---|
| GETTING_STARTED | Create your first renderlib application, from setup to complete example |
| RENDERING | Deep dive into rendering pipelines, forward vs. deferred, advanced techniques |
| Document | Description |
|---|---|
| REFERENCE | Complete API documentation with all types, traits, and functions |
- Application Framework: Event loop, window management, renderer trait
- Graphics Context: wgpu device, surface, and swap chain management
- Device Helpers: Buffer, shader, and pipeline creation utilities
- Camera System: View, projection, and model matrices with orbit controls
- Geometry: Vertex types and primitive generators
- Mesh Loading: GLTF/GLB loading with automatic scaling and centering
- Deferred Rendering: G-buffer management for deferred shading
- Forward Rendering: Simple, single-pass rendering with lighting
- Deferred Rendering: Multi-pass rendering for efficient lighting
- Hot Reloading: Live shader reloading during development
- Depth Testing: Proper occlusion handling
- Multiple Lights: Support for up to 32 light sources
- Windows: Vulkan, DirectX 12
- macOS: Metal
- Linux: Vulkan, OpenGL
- Web: WebGPU (via wasm)
The repository includes three main demos:
| Demo | File | Description |
|---|---|---|
| Triangle | src/bin/triangle.rs |
Simple rotating triangle with shader hot-reload |
| Forward | src/bin/forward.rs |
Forward rendering with mesh loading and lighting |
| Deferred | src/bin/deferred.rs |
Deferred rendering with G-buffer and lighting |
Run demos with:
cargo run --bin triangle
cargo run --bin forward
cargo run --bin deferredrenderlib/
├── Cargo.toml # Project configuration
├── src/
│ ├── lib.rs # Library root, module exports
│ ├── app.rs # Application framework
│ ├── camera.rs # Camera, transforms, lighting
│ ├── context.rs # Graphics context
│ ├── deferred.rs # G-buffer for deferred rendering
│ ├── device_helpers.rs # wgpu utilities
│ ├── geometry/
│ │ ├── mod.rs # Vertex types
│ │ └── primitives.rs # Primitive generators
│ ├── mesh.rs # Mesh loading
│ └── bin/
│ ├── triangle.rs # Triangle demo
│ ├── forward.rs # Forward rendering demo
│ └── deferred.rs # Deferred rendering demo
├── assets/
│ └── README.md # Asset directory documentation
└── docs/
└── ... # This documentation
[dependencies]
wgpu = "30" # WebGPU implementation
winit = { version = "0.30", features = ["x11", "rwh_06"], default-features = false }
pollster = "1" # Async runtime
bytemuck = { version = "1.16", features = ["derive"] } # Buffer utilities
anyhow = "1.0.104" # Error handling
thiserror = "2.0.19" # Error handling
env_logger = "0.11.11" # Logging
cgmath = "0.18" # Math library
gltf = { version = "1.4.1", features = ["import"] } # GLTF loadingTo contribute to the documentation:
- Fork the repository
- Make changes to files in the
docs/directory - Ensure links between documents are correct
- Check that examples in documentation still work
- Submit a pull request
- Fork the repository
- Create a feature branch
- Make your changes
- Run
cargo testto ensure nothing breaks - Update documentation if needed
- Submit a pull request
- Use consistent Markdown formatting
- Include code examples where helpful
- Link to related documentation
- Keep examples simple and focused
- Document both the "what" and the "why"
- GitHub Issues: Report bugs and request features
- GitHub Discussions: Ask questions and share projects
- Rust Graphics Discord: Join the Rust graphics community
Renderlib is licensed under the MIT License. See the LICENSE file for details.
| Version | Date | Changes |
|---|---|---|
| 0.1.0 | Current | Initial release |
-
- Project Summary
- Architecture Layers
- Core Components
- Rendering Paradigms
- Data Flow
- Design Philosophy
-
- App Module
- Camera Module
- Context Module
- Device Helpers Module
- Deferred Module
- Geometry Module
- Mesh Module
- lib.rs
-
- Startup Sequence
- Render Loop
- Resize Handling
- Shader Hot-Reloading
- Mesh Loading Pipeline
- Deferred Rendering Pipeline
- Uniform Buffer Management
- Bind Group Hierarchy
-
- Prerequisites
- Project Setup
- Creating a Simple Application
- Understanding the App Structure
- Adding a Mesh
- Adding Camera Controls
- Adding Lighting
- Running Your Application
- Next Steps
-
- Rendering Fundamentals
- Forward Rendering
- Deferred Rendering
- Comparing Forward and Deferred
- Implementing Custom Pipelines
- Advanced Rendering Techniques
- Performance Considerations
- REFERENCE
- Crate Documentation
- Module Index
- Detailed API for all modules
- Type Index
- Trait Index
- Function Index
Happy rendering with renderlib! 🎮