ASH Renderer
[!IMPORTANT] Version Stability Notice The following versions are strictly verified as STABLE and USABLE:
- v0.4.0 (Latest, Featured with UE5-inspired tech)
- v0.3.9 (Previous stable)
- v0.1.2
All other versions/variants may contain critical bugs or instability. Stability is guaranteed only for recommended versions. Please stay on the recommended versions for a production-ready experience.
A production-quality Vulkan renderer built with ASH (Vulkan bindings) and VMA (GPU memory allocator).
ECS-free, pure rendering engine - decoupled camera and input handling, ready for any game engine.
Features
- 🎨 PBR Materials - Physically-based rendering with metallic/roughness workflow
- 🌑 Shadow Mapping - Cascaded shadow maps with PCF filtering
- ✨ VSR (Vulkan Super Resolution) - Next-gen temporal upscaling for high-fidelity performance
- 💡 SSGI (Screen-Space Global Illumination) - Dynamic, high-performance indirect lighting
- 👁️ Hi-Z Occlusion Culling - Hierarchy-based visibility testing for massive scenes
- ⚡ Indirect Draw & GPU Culling - Compute-based draw call optimization and frustum culling
- 📊 GPU Profiling - Built-in timing queries and performance diagnostics
- 🔌 Feature System - Extensible plugin architecture for rendering features
- 🚀 High Performance - 60+ FPS @ 4K with VSR enabled
- 🔧 LOD System - Automatic level-of-detail management
- ⚡ GPU Instancing - Efficient batch rendering
- 🔄 Hot Reloading - Automatic shader recompilation and pipeline recreation on file change
- 🛡️ Robust Validation - GPU-assisted validation with automatic fallback
- 📦 Bindless Textures - Efficient bindless texture management (1024+ textures)
- 🖥️ Headless Support - Decoupled rendering via
SurfaceProvidertrait - 🎞️ Motion Vectors - Dedicated G-Buffer pass for high-quality temporal effects
Quick Start
Add to your Cargo.toml:
[]
= "0.4.0"
= "0.30" # Required for math types
Basic Usage
use *;
use ;
// use winit::window::Window; // Assumed available from context
// 1. Initialization (inside your winit event loop)
// Wraps the window to provide a Vulkan surface
let surface_provider = new;
// Renderer::new handles Vulkan instance, device, and swapchain creation.
let mut renderer = new?;
// 2. Resource Setup
// Create a built-in primitive mesh
let cube = create_cube;
// Define PBR material properties
let material = Material ;
// Assign resources to the renderer
renderer.set_mesh;
*renderer.material_mut = material;
// 3. Render Loop (e.g., inside RedrawRequested)
let aspect_ratio = width as f32 / height as f32;
// Camera Setup
let camera_pos = new;
let target = ZERO;
let view = look_at_rh;
// Projection Setup (Note: Vulkan requires Y-flip)
let mut proj = perspective_rh;
proj.y_axis.y *= -1.0;
// Render the frame with the current camera state
renderer.render_frame?;
// 4. Resize Handling
// Call this when the window is resized to recreate the swapchain
renderer.request_swapchain_resize;
Mesh Creation
// Built-in primitives
let cube = create_cube;
let sphere = create_sphere;
let plane = create_plane;
// Custom mesh
let mesh = new;
Materials
let material = Material ;
Examples
Run the provided examples to see the renderer in action:
# Simple triangle
# Textured cube with materials (Basic Usage)
# GLTF model loading
Architecture
ash_renderer/
├── src/
│ ├── vulkan/ # Low-level Vulkan abstractions
│ │ ├── device.rs # Logical device management
│ │ ├── pipeline.rs # Graphics/compute pipelines
│ │ ├── shader.rs # Shader loading & reflection
│ │ └── ...
│ ├── renderer/ # High-level rendering API
│ │ ├── renderer.rs # Main Renderer struct
│ │ ├── resources/ # GPU resources (mesh, texture, material)
│ │ ├── features/ # Extensible feature system
│ │ └── diagnostics/ # Profiling & debugging
│ └── shaders/ # GLSL shader sources
└── examples/ # Usage examples
Performance
| Metric | Target | Achieved |
|---|---|---|
| FPS @ 1080p | 60+ | ✅ |
| Objects | 1000+ | ✅ |
| Memory (idle) | < 200MB | ✅ |
| Frame time | < 16.6ms | ✅ |
Feature Flags
| Feature | Description | Default |
|---|---|---|
validation |
Vulkan validation layers | ✅ |
gltf_loading |
GLTF model loading | ✅ |
shader_compilation |
Runtime shader compilation | ❌ |
profiling |
GPU profiling queries | ❌ |
parallel |
Parallel command recording | ❌ |
Requirements
- Rust: 1.70+
- Vulkan: 1.2+ capable GPU
- Vulkan SDK: For validation layers (optional)
Author
Saptak Santra
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Made with ❤️ and Vulkan