All Projects → adrien-ben → imgui-rs-vulkan-renderer

adrien-ben / imgui-rs-vulkan-renderer

Licence: MIT license
A Vulkan renderer for imgui-rs using Ash

Programming Languages

rust
11053 projects
GLSL
2045 projects

Projects that are alternatives of or similar to imgui-rs-vulkan-renderer

bgfx-python
Python 3.7+ wrapper for the BGFX library. 🐍
Stars: ✭ 99 (+125%)
Mutual labels:  vulkan, imgui
MoravaEngine
2D/3D graphics engine written in C++ language. It currently supports the following graphics APIs: OpenGL 3.3+, Vulkan 1.2, DirectX 11. Its current purpose is to experiment with various CG concepts and techniques.
Stars: ✭ 129 (+193.18%)
Mutual labels:  vulkan, imgui
pilka
Another live-coding tool for creating shader demos, Vulkan+Wgpu powered.
Stars: ✭ 84 (+90.91%)
Mutual labels:  vulkan, ash
VulkanRenderer
Personal repo for learning the vulkan graphics api
Stars: ✭ 42 (-4.55%)
Mutual labels:  vulkan, imgui
Spartanengine
Game engine with an emphasis on architectual quality and performance
Stars: ✭ 869 (+1875%)
Mutual labels:  vulkan, imgui
Imguizmo.quat
ImGui GIZMO widget - 3D object manipulator / orientator
Stars: ✭ 187 (+325%)
Mutual labels:  vulkan, imgui
demos
OpenGL and Vulkan graphics experiments and samples
Stars: ✭ 34 (-22.73%)
Mutual labels:  vulkan, imgui
Lumos
Cross-Platform C++ 2D/3D game engine
Stars: ✭ 343 (+679.55%)
Mutual labels:  vulkan, imgui
Code Red
A Graphics Interface for DirectX12 and Vulkan
Stars: ✭ 27 (-38.64%)
Mutual labels:  vulkan, imgui
Vktk
Vulkan Toolkit
Stars: ✭ 32 (-27.27%)
Mutual labels:  vulkan, imgui
Nimgl
NimGL is a Nim library that offers bindings for popular libraries used in computer graphics
Stars: ✭ 218 (+395.45%)
Mutual labels:  vulkan, imgui
imgui entt entity editor
A drop-in entity editor for EnTT with Dear ImGui
Stars: ✭ 146 (+231.82%)
Mutual labels:  imgui
wgpu-mc
Rust-based replacement for the default Minecraft renderer
Stars: ✭ 254 (+477.27%)
Mutual labels:  vulkan
Fractal Engine
WIP 3D game engine with editor and other stuff
Stars: ✭ 152 (+245.45%)
Mutual labels:  imgui
virtualGizmo3D
Virtual GIZMO - 3D object manipulator / orientator, via mouse, with pan and dolly/zoom features
Stars: ✭ 36 (-18.18%)
Mutual labels:  vulkan
AngryEngine
Game Engine for Windows by Vulkan SDK
Stars: ✭ 20 (-54.55%)
Mutual labels:  vulkan
CrossWindow-Demos
🥪 Examples of how to use CrossWindow for things like rendering graphics, listening to events, etc.
Stars: ✭ 48 (+9.09%)
Mutual labels:  vulkan
ImStudio
Real-time GUI layout designer for Dear ImGui
Stars: ✭ 285 (+547.73%)
Mutual labels:  imgui
drivers-linux-firmware
MOVED: https://gitlab.com/q3aql/drivers-linux-firmware
Stars: ✭ 28 (-36.36%)
Mutual labels:  vulkan
Syndra
3D Game Engine/Renderer
Stars: ✭ 40 (-9.09%)
Mutual labels:  imgui

imgui-rs-vulkan-renderer

Version Docs.rs Build Status Publish Status

A Vulkan renderer for imgui-rs using Ash.

screenshot

Compatibility

crate imgui ash gpu-allocator (feature) vk-mem (feature)
1.5.0 0.8 [0.34, 0.37] 0.19 0.2.3 (forked)
1.4.0 0.8 [0.34, 0.37] 0.18 0.2.3 (forked)
1.3.0 0.8 [0.34, 0.37] 0.18 0.2.3 (forked)
1.2.0 0.8 0.36 0.17 0.2.3 (forked)
1.1.x 0.8 0.35 0.15 0.2.3 (forked)
1.0.0 0.8 0.35 0.14 0.2.3 (forked)

How it works

The renderer records drawing command to a command buffer supplied by the application. Here is a little breakdown of the features of this crate and how they work.

  • Vertex/Index buffers

The renderer creates a vertex buffer and a index buffer that will be updated every time Renderer::cmd_draw is called. If the vertex/index count is more than what the buffers can actually hold then the buffers are resized (actually destroyed then re-created).

  • Frames in flight

The renderer support having multiple frames in flight. You need to specify the number of frames during initialization of the renderer. The renderer manages one vertex and index buffer per frame.

  • No draw call execution

The Renderer::cmd_draw only record commands to a command buffer supplied by the application. It does not submit anything to the gpu.

  • Custom textures

The renderer supports custom textures. See Renderer::textures for details.

  • Custom Vulkan allocators

Custom Vulkan allocators are not supported for the moment.

Features

gpu-allocator

This feature adds support for gpu-allocator. It adds Renderer::with_gpu_allocator which takes a Arc<Mutex<gpu_allocator::vulkan::Allocator>>. All internal allocator are then done using the allocator.

vk-mem

This feature adds support for vk-mem-rs. It adds Renderer::with_vk_mem_allocator which takes a Arc<Mutex<vk_mem::Allocator>>. All internal allocator are then done using the allocator.

Since we cannot publish a crate with patched dependencies you'll need to patch it on your end by adding this to your Cargo.toml file

[patch.crates-io]
vk-mem = { git = "https://github.com/adrien-ben/vk-mem-rs", tag = "0.2.3-ash-0.34-0.37" }

I'm still not sure with the Arc<Mutex<...>> stuff. It works for me but i'm unsure it'a the best way to go. Any suggestion is welcome.

dynamic-rendering

This feature is useful if you want to integrate the library in an app making use of Vulkan's dynamic rendering. When enabled, functions that usually takes a vk::RenderPass as argument will now take a DynamicRendering which contains the format of the color attachment the UI will be drawn to and an optional depth attachment format.

Integration

You can find an example of integration in the common module of the examples.

// Example with default allocator
let renderer = Renderer::with_default_allocator(
    &instance,
    physical_device,
    device.clone(),
    graphics_queue,
    command_pool,
    render_pass,
    &mut imgui,
    Some(Options {
        in_flight_frames: 1,
        ..Default::default()
    }),
).unwrap();

Examples

You can run a set of examples by running the following command:

# If you want to enable validation layers
export VK_LAYER_PATH=$VULKAN_SDK/Bin
export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation

# Or with Powershell
$env:VK_LAYER_PATH = "$env:VULKAN_SDK\Bin"
$env:VK_INSTANCE_LAYERS = "VK_LAYER_KHRONOS_validation"

# If you changed the shader code (you'll need glslangValidator on you PATH)
# There is also a PowerShell version (compile_shaders.ps1)
./compile_shaders.sh

# Run an example
cargo run --example <example>

# Example can be one of the following value:
# - collapsing_header
# - color_button
# - custom_textures
# - disablement
# - draw_list
# - hello_world
# - keyboard
# - long_list
# - multiple_fonts
# - progress_bar
# - radio_button
# - slider : TODO: crashes
# - tables_api
# - test_drawing_channels_split
# - test_window_impl
# - test_window
# - text_callbacks
# - text_input
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].