Vulkan rendering sandbox for raytracing

Overview

sol-rs

sol-rs is a small rendering toolkit for Vulkan, with a focus on real-time raytracing (which is not currently available via other APIs such as WebGPU). It hosts convenience wrappers but also exposes ash directly. Tested on Windows/NVIDIA, but the non-raytracing samples also work on Mac via MoltenVK.

However, this remains a personal sandbox for learning and experimentation so use at your own risk!

Requirements

LunarG Vulkan SDK installation.

On Windows, setting a VULKAN_SDK environment variable to the 1.2.162.0 SDK installation folder should prevent the need for building shaderc from source. Otherwise, additional installations such as Ninja may be required. Please refer to the following instructions if you run into shaderc-related issues.

Examples

screenshot cargo run --release --example 5-pathtrace -- --model models/tunnel.gltf --sky

screenshot cargo run --release --example 5-pathtrace -- --model models/cornell.gltf

screenshot cargo run --release --example 4-ray-ao

screenshot cargo run --release --example 1-cube

References

You might also like...
grr and rust-gpu pbr rendering
grr and rust-gpu pbr rendering

grr-gltf Barebone gltf viewer using grr and rust-gpu. Currently only supports a single gltf model! Assets These files need to be downloaded and placed

Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering.
Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering.

Provok Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering. Input Provok is fed with a JSON

A tilemap rendering crate for bevy which is more ECS friendly.
A tilemap rendering crate for bevy which is more ECS friendly.

bevy_ecs_tilemap A tilemap rendering plugin for bevy which is more ECS friendly by having an entity per tile. Features A tile per entity Fast renderin

Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions
Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions

Introduction Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions. (hand interaction with boxes missing

Self Study on developing a game engine using wgpu as the rendering API. Learning as I go.
Self Study on developing a game engine using wgpu as the rendering API. Learning as I go.

Fabled Engine Any issues, enhancement, features, or bugs report are always welcome in Issues. The obj branch is where frequent development and up to d

🤹‍ 2D sprite rendering extension for the specs ECS system

specs-blit 2D sprite rendering extension for the Specs ECS system. All sprites are loaded onto a big array on the heap. Example // Setup the specs wor

Collection of rust crates providing rendering abstractions.

render-rs License Licensed under either of Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) MIT license (LIC

Cross platform rendering in Rust
Cross platform rendering in Rust

Miniquad Miniquad is a manifestation of a dream in a world where we do not need a deep dependencies tree and thousands lines of code to draw things wi

A 3D modeling and rendering programming language utilizing SDFs.
A 3D modeling and rendering programming language utilizing SDFs.

ForgedThoughts is a modeling and rendering programming language utilizing SDFs and is in early development. For documentation and examples see the Web

Comments
  • Update dependencies and fix compile

    Update dependencies and fix compile

    • also checked in Cargo.lock as it's recommended to check in for applications. I tried to compile the master branch, but it fails because seems some dependency is not using correct version
    opened by molikto 1
  • `cmd_bind_descriptor_sets` crash in `raytracing_khr` branch

    `cmd_bind_descriptor_sets` crash in `raytracing_khr` branch

    The cmd_bind_descriptor_sets call in the raytracing samples crashes only when the VK_LAYER_KHRONOS_validation layer is enabled (automatically in debug mode currently). Using nvidia driver (v516.59), but confirmed with earlier versions too.

    Exception: Exception 0xc000041d encountered at address 0x7ff8ea4c1bde

    [nvoglv64.dll] <unknown> 0x00007ff8ea4c1bde
    [nvoglv64.dll] <unknown> 0x00007ff8ea4c22a4
    [VkLayer_khronos_validation.dll] DispatchCmdBindDescriptorSets(VkCommandBuffer_T *,VkPipelineBindPoint,VkPipelineLayout_T *,unsigned int,unsigned int,VkDescriptorSet_T *const *,unsigned int,const unsigned int *) 0x00007ff8e3c220ff
    [VkLayer_khronos_validation.dll] vulkan_layer_chassis::CmdBindDescriptorSets(VkCommandBuffer_T *,VkPipelineBindPoint,VkPipelineLayout_T *,unsigned int,unsigned int,VkDescriptorSet_T *const *,unsigned int,const unsigned int *) 0x00007ff8e3b8c20b
    [3-ray-debug.exe] ash::vk::features::DeviceFnV1_0::cmd_bind_descriptor_sets(CommandBuffer,PipelineBindPoint,PipelineLayout,unsigned int,unsigned int,ash::vk::definitions::DescriptorSet *,unsigned int,unsigned int *) features.rs:4661
    [3-ray-debug.exe] ash::device::Device::cmd_bind_descriptor_sets(CommandBuffer,PipelineBindPoint,PipelineLayout,unsigned int,slice$<ash::vk::definitions::DescriptorSet>,slice$<u32>) device.rs:1643
    [3-ray-debug.exe] 3_ray_debug::render(sol::App *,3_ray_debug::AppData *) 3-ray-debug.rs:237
    [3-ray-debug.exe] sol::main_loop::closure$0<3_ray_debug::AppData>(sol::main_loop::closure_env$0<3_ray_debug::AppData> *,enum$<winit::event::Event<tuple$<> > >,winit::event_loop::EventLoopWindowTarget<tuple$<> > *,enum$<winit::event_loop::ControlFlow> *) lib.rs:227
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::impl$2::run_return::closure$0<tuple$<>,sol::main_loop::closure_env$0<3_ray_debug::AppData> >(winit::platform_impl::platform::event_loop::impl$2::run_return::closure_env$0<tuple$<>,sol::main_loop::closure_env$0<3_ray_debug::AppData> > *,enum$<winit::event::Event<tuple$<> > >,enum$<winit::event_loop::ControlFlow> *) event_loop.rs:206
    [3-ray-debug.exe] alloc::boxed::impl$45::call_mut<tuple$<enum$<winit::event::Event<tuple$<> > >,ref_mut$<enum$<winit::event_loop::ControlFlow> > >,dyn$<core::ops::function::FnMut<tuple$<enum$<winit::event::Event<tuple$<> > >,ref_mut$<enum$<winit::event_loop::ControlFlow> > >,assoc$<Output,tuple$<> > > >,alloc::alloc::Global>(alloc::boxed::Box<dyn$<core::ops::function::FnMut<tuple$<enum$<winit::event::Event<tuple$<> > >,ref_mut$<enum$<winit::event_loop::ControlFlow> > >,assoc$<Output,tuple$<> > > >,alloc::alloc::Global> *,enum$<winit::event::Event<tuple$<> > >,enum$<winit::event_loop::ControlFlow> *) boxed.rs:1879
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<tuple$<> >(closure_env$0<tuple$<> >) runner.rs:245
    [3-ray-debug.exe] core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > >(AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > >) unwind_safe.rs:271
    [3-ray-debug.exe] std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > >,tuple$<> >(unsigned char *) panicking.rs:492
    [3-ray-debug.exe] <unknown> 0x00007ff66d4211c3
    [3-ray-debug.exe] std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > > >(AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > >) panicking.rs:456
    [3-ray-debug.exe] std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > >,tuple$<> >(AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > >) panic.rs:137
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple$<> >::catch_unwind<tuple$<>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<tuple$<> > >(closure_env$0<tuple$<> >) runner.rs:152
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple$<> >::call_event_handler<tuple$<> >(enum$<winit::event::Event<tuple$<> > >) runner.rs:239
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple$<> >::move_state_to<tuple$<> >(RunnerState) runner.rs:341
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple$<> >::main_events_cleared<tuple$<> >() runner.rs:227
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::flush_paint_messages<tuple$<> >(enum$<core::option::Option<ptr_mut$<enum$<winapi::shared::windef::HWND__> > > >,winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple$<> > *) event_loop.rs:726
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$0<tuple$<> >(winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > *) event_loop.rs:941
    [3-ray-debug.exe] core::ops::function::FnOnce::call_once<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> >,tuple$<> >(closure_env$0<tuple$<> >) function.rs:248
    [3-ray-debug.exe] core::panic::unwind_safe::impl$23::call_once<isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > >(AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > >) unwind_safe.rs:271
    [3-ray-debug.exe] std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > >,isize>(unsigned char *) panicking.rs:492
    [3-ray-debug.exe] <unknown> 0x00007ff66d1002b3
    [3-ray-debug.exe] std::panicking::try<isize,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > > >(AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > >) panicking.rs:456
    [3-ray-debug.exe] std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > >,isize>(AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > >) panic.rs:137
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple$<> >::catch_unwind<tuple$<>,isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<tuple$<> > >(closure_env$0<tuple$<> >) runner.rs:152
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::public_window_callback_inner<tuple$<> >(enum$<winapi::shared::windef::HWND__> *,unsigned int,unsigned long long,long long,winit::platform_impl::platform::event_loop::WindowData<tuple$<> > *) event_loop.rs:2030
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::public_window_callback<tuple$<> >(enum$<winapi::shared::windef::HWND__> *,unsigned int,unsigned long long,long long) event_loop.rs:846
    [user32.dll] <unknown> 0x00007ff9631ae858
    [user32.dll] <unknown> 0x00007ff9631ae4ee
    [opengl32.dll] <unknown> 0x00007ff94257f990
    [user32.dll] <unknown> 0x00007ff9631ae858
    [user32.dll] <unknown> 0x00007ff9631ae3dc
    [user32.dll] <unknown> 0x00007ff9631c0bc3
    [ntdll.dll] <unknown> 0x00007ff964770ba4
    [win32u.dll] <unknown> 0x00007ff9622c1704
    [user32.dll] <unknown> 0x00007ff9631ae2ea
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::EventLoop<tuple$<> >::run_return<tuple$<>,sol::main_loop::closure_env$0<3_ray_debug::AppData> >(closure_env$0<3_ray_debug::AppData>) event_loop.rs:221
    [3-ray-debug.exe] winit::platform_impl::platform::event_loop::EventLoop<tuple$<> >::run<tuple$<>,sol::main_loop::closure_env$0<3_ray_debug::AppData> >(EventLoop<tuple$<> >,closure_env$0<3_ray_debug::AppData>) event_loop.rs:191
    [3-ray-debug.exe] winit::event_loop::EventLoop<tuple$<> >::run<tuple$<>,sol::main_loop::closure_env$0<3_ray_debug::AppData> >(EventLoop<tuple$<> >,closure_env$0<3_ray_debug::AppData>) event_loop.rs:154
    [3-ray-debug.exe] sol::main_loop<3_ray_debug::AppData>(AppBuilder<3_ray_debug::AppData>) lib.rs:174
    [3-ray-debug.exe] sol::AppBuilder<3_ray_debug::AppData>::run<3_ray_debug::AppData>(AppBuilder<3_ray_debug::AppData>) lib.rs:154
    [3-ray-debug.exe] 3_ray_debug::main() 3-ray-debug.rs:271
    [3-ray-debug.exe] core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >(void (*)()) function.rs:248
    [3-ray-debug.exe] std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >(void (*)()) backtrace.rs:122
    [3-ray-debug.exe] std::rt::lang_start::closure$0<tuple$<> >(std::rt::lang_start::closure_env$0<tuple$<> > *) rt.rs:145
    [Inlined] [3-ray-debug.exe] core::ops::function::impls::impl$2::call_once() function.rs:280
    [Inlined] [3-ray-debug.exe] std::panicking::try::do_call() panicking.rs:492
    [Inlined] [3-ray-debug.exe] std::panicking::try() panicking.rs:456
    [Inlined] [3-ray-debug.exe] std::panic::catch_unwind() panic.rs:137
    [Inlined] [3-ray-debug.exe] std::rt::lang_start_internal::closure$2() rt.rs:128
    [Inlined] [3-ray-debug.exe] std::panicking::try::do_call() panicking.rs:492
    [Inlined] [3-ray-debug.exe] std::panicking::try() panicking.rs:456
    [Inlined] [3-ray-debug.exe] std::panic::catch_unwind() panic.rs:137
    [3-ray-debug.exe] std::rt::lang_start_internal() rt.rs:128
    [3-ray-debug.exe] std::rt::lang_start<tuple$<> >(void (*)(),long long,unsigned char **) rt.rs:144
    [3-ray-debug.exe] <unknown> 0x00007ff66d0572a6
    [Inlined] [3-ray-debug.exe] invoke_main() 0x00007ff66d83f090
    [3-ray-debug.exe] __scrt_common_main_seh() 0x00007ff66d83f06e
    [kernel32.dll] <unknown> 0x00007ff962ce7034
    [ntdll.dll] <unknown> 0x00007ff964722651
    opened by num3ric 0
Releases(v1.0)
Owner
Éric Renaud-Houde
Éric Renaud-Houde
Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

小鳥 11 Dec 4, 2022
The study of a simple path tracer implementation (image raytracing in shorts)

The study of a simple path tracer implementation (generate a raytraced image, in shorts).

Leonardo Vieira 1 Apr 2, 2022
A real-time raytracing engine, with extra Bevy integration

strolle Strolle (from strålspårning) is a real-time raytracing engine written entirely in Rust, running on CPU & GPU: It comes integrated with Bevy, b

Patryk Wychowaniec 72 Jan 1, 2023
Sandbox is a pixel physics simulator inspired by other such like Sandspiel and Noita

Sandbox Sandbox is a pixel physics simulator inspired by other such like Sandspiel and Noita. It's also a precursor for an ongoing game project. Sandb

Okko Hakola 76 Nov 3, 2022
A sandbox library for making FAST voxel games

voxelize WIP A well-optimized web-based voxel engine. Development Before starting, make sure to install the following: rust node.js cargo-watch # clon

Ian Huang (Shaoru) 146 Dec 30, 2022
Manage light-weight sandbox environments for development

Cubicle development container manager Cubicle is a program to manage containers or sandbox environments. It is intended for isolating development envi

Diego Ongaro 8 Nov 29, 2022
An online judge sandbox server in Rust, inspired by go-judge, for SAST OJ.

RsJudge An online judge sandbox server in Rust, inspired by go-judge, for SAST OJ. Table of Contents Features Build from source Prerequisites Build Fe

NJUPT SAST 4 Dec 10, 2023
GFA visualizer, GPU-accelerated using Vulkan

gfaestus - Vulkan-accelerated GFA visualization Demo: https://youtu.be/TOJZeeCqatk gfaestus is a tool for visualizing and interacting with genome grap

Christian Fischer 46 Nov 29, 2022
A barebones example of how to integrate OpenXR with wgpu (Vulkan-only)

wgpu-openxr-example a barebones example of how to integrate OpenXR with wgpu (Vulkan-only) It has four modes: cargo run --no-default-features: desktop

Philpax 21 Dec 15, 2022
A vulkan library.

Docs.rs vkvk A vulkan library. Running The Example The shaders aren't compiled as part of the build script. Instead, run shader_build.bat (or copy the

Lokathor 7 Mar 13, 2023