https://github.com/adrien-ben/vulkan-examples-rs
Vulkan examples written in Rust
https://github.com/adrien-ben/vulkan-examples-rs
ash raytracing rust vulkan
Last synced: 11 months ago
JSON representation
Vulkan examples written in Rust
- Host: GitHub
- URL: https://github.com/adrien-ben/vulkan-examples-rs
- Owner: adrien-ben
- License: mit
- Created: 2022-08-14T08:06:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-07T12:17:20.000Z (over 1 year ago)
- Last Synced: 2025-04-06T22:38:05.056Z (about 1 year ago)
- Topics: ash, raytracing, rust, vulkan
- Language: Rust
- Homepage:
- Size: 7.38 MB
- Stars: 26
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vulkan-examples-rs
Collection of Vulkan examples that I make to learn stuff in Rust using [ash][ash].

## Examples
You can run one of the following example.
- rt_triangle: Ray-traced triangle.
- rt_shadows: Ray-traced gltf model with simulated sunlight shadow. It has one BLAS with multiple geometries. Light and camera controls with imgui.
- rt_reflections: Ray-traced iterative (not recursive) reflections.
- triangle: Rasterized triangle.
- gpu_particles: Particles simulated on the gpu using a compute shader.
- mandelbrot: Render mandelbrot set on gpu with expensive setting. The goal is to be gpu bound with a simple setup for some tests.
- [hdr_skybox](crates/examples/hdr_skybox/): Display a skybox from a environment HDRi image targetting an HDR surface.
- [wboit](crates/examples/wboit/): Weighted, Blended Order-Independent Transparency.
```ps1
# Powershell example (all scripts have a .sh version)
# Compile all glsl shaders to spir-v 1.4
.\scripts\compile_shaders.ps1
# Enable validation layers and set log level to debug
.\scripts\debug.ps1
# Compiles with --release and set log level to info
.\scripts\run.ps1
```
## Controls
For examples with interactive camera you can move the camera with
- WASD to move
- Ctrl and space to go up or down
- Right-click and move the mouse around to look
You can alse press R to cycle through the performance information.
## Requirements
- Rust 1.77
All examples use Vulkan 1.3 and the following features:
- dynamic_rendering
- synchronization2
Ray tracing examples use the following extensions and features:
- VK_KHR_ray_tracing_pipeline
- ray_tracing_pipeline
- VK_KHR_acceleration_structure
- acceleration_structure
- VK_KHR_deferred_host_operations
- Vulkan 1.2's features
- runtime_descriptor_array
- buffer_device_address
> RT is only enabled on examples using it, so other examples can run on hardware that does not support it.
## Useful links
- [NVidia tutorial](https://nvpro-samples.github.io/vk_raytracing_tutorial_KHR/)
- [SaschaWillems' Vulkan](https://github.com/SaschaWillems/Vulkan)
[ash]: https://github.com/MaikKlein/ash