An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# vulkan-examples-rs

Collection of Vulkan examples that I make to learn stuff in Rust using [ash][ash].

![screenshot](media/screenshot.png "Screenshot")

## 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