Guide for using gfx-rs's wgpu library.

Overview

Introduction

What is wgpu?

Wgpu is a Rust implementation of the WebGPU API spec. WebGPU is a specification published by the GPU for the Web Community Group. It aims to allow web code access to GPU functions in a safe and reliable manner. It does this by mimicking the Vulkan API, and translating that down to whatever API the host hardware is using (ie. DirectX, Metal, Vulkan).

Wgpu is still in development, so some of this doc is subject to change.

Why Rust?

Wgpu actually has C bindings to allow you to write C/C++ code with it, as well as use other languages that interface with C. That being said, wgpu is written in Rust, and it has some convenient Rust bindings that don't have to jump through any hoops. On top of that, I've been enjoying writing in Rust.

You should be fairly familiar with Rust before using this tutorial as I won't go into much detail on Rust syntax. If you're not super comfortable with Rust you can review the Rust tutorial. You should also be familiar with Cargo.

I'm using this project to learn wgpu myself, so I might miss some important details, or explain things badly. I'm always open to constructive feedback.

Contribution and Support

  • I accept pull requests (GitHub repo) for fixing issues with this tutorial such as typos, incorrect information, and other inconsistencies.
  • Due to wgpu's rapidly changing api, I'm not accepting any new pull requests for showcase demos.
  • If you want to support me directly, check out my patreon!

Special thanks to these patrons!

In no particular order

  • Zeh Fernando
  • The toddling chaos
  • Jan Šipr
  • Bernard Llanos
  • Aron Granberg
  • Ian Gowen
  • Paul E Hansen
  • Lennart
  • Gunstein Vatnar
  • David Laban
Comments
  • Textures example in Instancing tutorial fails with segmentation fault

    Textures example in Instancing tutorial fails with segmentation fault

    Hi, I got segmentation fault with an example using textures in Instancing tutorial. Does this only happen on me? I'm using Wayland and GNOME3 on Manjaro Linux.

    Note that my window manager behaves a bit strangely in that it resizes windows after it is created. I suspect the resize is the cause, so I want to know whether this is reproducible on other environments or a very rare issue.

    What I did was adding this section to code/beginner/tutorial7-instancing/Cargo.toml

    [[example]]
    name = "tutorial7-texture"
    path = "examples/texture_instances.rs"
    

    and running the command below:

    $ cargo run --example tutorial7-texture
    warning: unused variable: `instance_buffer_size`
       --> code/beginner/tutorial7-instancing/examples/texture_instances.rs:393:13
        |
    393 |         let instance_buffer_size = instance_data.len() * std::mem::size_of::<cgmath::Matrix4<f32>>();
        |             ^^^^^^^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_instance_buffer_size`
        |
        = note: `#[warn(unused_variables)]` on by default
    
    warning: field is never read: `instances`
       --> code/beginner/tutorial7-instancing/examples/texture_instances.rs:278:5
        |
    278 |     instances: Vec<Instance>,
        |     ^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default
    
        Finished dev [unoptimized + debuginfo] target(s) in 0.09s
         Running `target/debug/examples/tutorial7-texture`
    Segmentation fault (core dumped)
    
    opened by yutannihilation 25
  • Code in Swapchain tutorial panics

    Code in Swapchain tutorial panics

    The code described in the SwapChain Tutorial panics with the following output:

    thread 'main' panicked at 'Failed to focus input context: XError { description: "BadDrawable (invalid Pixmap or Window parameter)", error_code: 9, request_code: 149, minor_code: 4 }', src/libcore/result.rs:1165:5
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
    

    Running with backtrace gives the following output:

    thread 'main' panicked at 'Failed to focus input context: XError { description: "BadDrawable (invalid Pixmap or Window parameter)", error_code: 9, request_code: 149, minor_code: 4 }', src/libcore/result.rs:1165:5
    stack backtrace:
       0:     0x5634fb192674 - backtrace::backtrace::libunwind::trace::hda41dbcdfba36aa0
                                   at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
       1:     0x5634fb192674 - backtrace::backtrace::trace_unsynchronized::h1a8d6e1f8cb3f5d4
                                   at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
       2:     0x5634fb192674 - std::sys_common::backtrace::_print_fmt::h610c4127487e10da
                                   at src/libstd/sys_common/backtrace.rs:76
       3:     0x5634fb192674 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0722dc552e01bd1d
                                   at src/libstd/sys_common/backtrace.rs:60
       4:     0x5634fb1b429c - core::fmt::write::h01edf6dd68a42c9c
                                   at src/libcore/fmt/mod.rs:1030
       5:     0x5634fb18fb77 - std::io::Write::write_fmt::hf15985f193f03c04
                                   at src/libstd/io/mod.rs:1412
       6:     0x5634fb194b85 - std::sys_common::backtrace::_print::hd8d5d08a1795e743
                                   at src/libstd/sys_common/backtrace.rs:64
       7:     0x5634fb194b85 - std::sys_common::backtrace::print::hf89a79e3921a2366
                                   at src/libstd/sys_common/backtrace.rs:49
       8:     0x5634fb194b85 - std::panicking::default_hook::{{closure}}::h3a8f42beb3bb8ae3
                                   at src/libstd/panicking.rs:196
       9:     0x5634fb194876 - std::panicking::default_hook::h8f803b0bc31a5c37
                                   at src/libstd/panicking.rs:210
      10:     0x5634fb195285 - std::panicking::rust_panic_with_hook::h825f041245da8739
                                   at src/libstd/panicking.rs:473
      11:     0x5634fb194e22 - std::panicking::continue_panic_fmt::hbe0378e33481e81b
                                   at src/libstd/panicking.rs:380
      12:     0x5634fb194d16 - rust_begin_unwind
                                   at src/libstd/panicking.rs:307
      13:     0x5634fb1b069a - core::panicking::panic_fmt::h527855ce0bc891f6
                                   at src/libcore/panicking.rs:85
      14:     0x5634fb1b0797 - core::result::unwrap_failed::ha8b77e6004f0ba38
                                   at src/libcore/result.rs:1165
      15:     0x5634fab0c981 - core::result::Result<T,E>::expect::ha3dc71e3c3df67a5
                                   at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/result.rs:960
      16:     0x5634fab1ca05 - winit::platform_impl::platform::x11::event_processor::EventProcessor<T>::process_event::h99f30c7b91bd4e01
                                   at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/x11/event_processor.rs:868
      17:     0x5634fab2a9f5 - winit::platform_impl::platform::x11::EventLoop<T>::drain_events::ha2600fbdf631ab40
                                   at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/x11/mod.rs:402
      18:     0x5634fab29500 - winit::platform_impl::platform::x11::EventLoop<T>::run_return::h09d5b07aee8bc6fe
                                   at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/x11/mod.rs:260
      19:     0x5634fab2ae0b - winit::platform_impl::platform::x11::EventLoop<T>::run::h3a8df3fe1aebdcb2
                                   at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/x11/mod.rs:386
      20:     0x5634fab2d57e - winit::platform_impl::platform::EventLoop<T>::run::h22021ac5f0e88e76
                                   at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/platform_impl/linux/mod.rs:644
      21:     0x5634faaf72c4 - winit::event_loop::EventLoop<T>::run::he611cc003761aeb0
                                   at /home/kunal/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.20.0/src/event_loop.rs:148
      22:     0x5634faaffd97 - try_wgpu::main::hf5dd9c0cb7449a73
                                   at src/main.rs:12
      23:     0x5634fab34ec0 - std::rt::lang_start::{{closure}}::h9e5098d20c41fd21
                                   at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
      24:     0x5634fb194cb3 - std::rt::lang_start_internal::{{closure}}::ha04574f12d97cbe2
                                   at src/libstd/rt.rs:49
      25:     0x5634fb194cb3 - std::panicking::try::do_call::h7c2a8488f72db90c
                                   at src/libstd/panicking.rs:292
      26:     0x5634fb19898a - __rust_maybe_catch_panic
                                   at src/libpanic_unwind/lib.rs:80
      27:     0x5634fb19577d - std::panicking::try::hc3a9b5da4250385d
                                   at src/libstd/panicking.rs:271
      28:     0x5634fb19577d - std::panic::catch_unwind::hf27600bf8c37809a
                                   at src/libstd/panic.rs:394
      29:     0x5634fb19577d - std::rt::lang_start_internal::h409d4f2fe51133b0
                                   at src/libstd/rt.rs:48
      30:     0x5634fab34e99 - std::rt::lang_start::haf1cb75fea9702a9
                                   at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
      31:     0x5634fab0045a - main
      32:     0x7f1645cf2b6b - __libc_start_main
      33:     0x5634faabb19a - _start
      34:                0x0 - <unknown>
    

    I am running it on Ubuntu 19.04

    opened by kunalmohan 13
  • Demo flickering and dark blue background

    Demo flickering and dark blue background

    Any idea why the example in this page is flickering and with a dark blue background?

    I'm on a Mac M1, and this is with Chrome Version 103.0.5060.134.

    https://user-images.githubusercontent.com/210002/181449852-83fcd1ba-be76-4199-abbf-ec0cdd6852aa.mov

    opened by beoboo 9
  • WGSL shaders

    WGSL shaders

    Now that almost all wgpu examples have been ported to WGSL, would you consider writing the tutorial shaders in WGSL too?

    I am aware of the existing discussion in #137, just wanted to bring this up again in the light of said reddit post.

    opened by F0Xde 8
  • add info about alignment

    add info about alignment

    thanks for your tutorial it helped me a lot

    I would be happy to contribute this info. I don't have a strong opinion on where the best place would be or what else would need to be added so feel free to request changes or if you want also modify it yourself.

    I would like to add a few code examples but I'm not sure how to best display the alignment/ memory regions in markdown.

    opened by benmkw 8
  • challange 3 - Cant seem to draw a triangle on Windows 11

    challange 3 - Cant seem to draw a triangle on Windows 11

    Hello, I have been trying to learn wgpu by following the examples and I have encountered a problem and I was not able to determine the issue. I'm on Windows 11 and using a NVIDIA graphics card (RTX 2060). I'm able to draw colors, but I'm unable to draw the triangle and I have done everything thats been done in the examples. I have used different backends like DX11 DX12 Vulkan GL and that didnt change anything. I have also tried to change the match arms order, as I thought it may be the cause. But still I was not able to understand it. What can be the issue ?

    As you can see, I have created a windows that has colors inside. issue_with_wgpu

    I have done everything in the examples and as you can see, I have attached my render_pipeline to my render_pass render_pass_wgpu

    as you may have guessed, I'm not very experienced in graphics programming, and If the question seems very basic, I'm sorry.

    opened by oguzBatur 7
  • Migrate to 0.8

    Migrate to 0.8

    Core tasks

    • [x] Migrate tutorial code
    • [x] Migrate showcases
    • [x] Add link to wasm compile steps
    • [x] Add link to element/matrix chat room

    Bonus tasks

    • [x] Evaluate switch to WGSL
    • [ ] Test out wasm build on tutorial 5
    opened by sotrh 7
  • collab with https://github.com/rust-tutorials/learn-wgpu ?

    collab with https://github.com/rust-tutorials/learn-wgpu ?

    Hi, I'm the maintainer of the rust-tutorials github org. I had a contributor who was starting on a wgpu tutorial, but they had some personal issues and essentially won't be able to continue the work.

    Luckily, I was pointed to your wgpu tutorial here!

    I'd love to know how we might work together. I could just have the rust-tutorials/learn-wgpu readme link to your repo, or if you want I can make you a maintainer of that repo and you can move your stuff in and merge the two projects, or however you feel is best.

    opened by Lokathor 7
  • Vulkan validation issues

    Vulkan validation issues

    [2021-04-17T21:23:10Z ERROR gfx_backend_vulkan] 
        VALIDATION [VUID-VkRenderPassBeginInfo-framebuffer-04627 (1158829633)] : Validation Error: [ VUID-VkRenderPassBeginInfo-framebuffer-04627 ] Object 0: handle = 0xb5f68b000000000e, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x45125641 | vkCmdBeginRenderPass(): Image view #0 created from an image with usage set as 0x11, but image info #0 used to create the framebuffer had usage set as 0x10 The Vulkan spec states: If framebuffer was created with a VkFramebufferCreateInfo::flags value that included VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the pAttachments member of a VkRenderPassAttachmentBeginInfo structure included in the pNext chain must be a VkImageView with an inherited usage equal to the usage member of the corresponding element of VkFramebufferAttachmentsCreateInfo::pAttachmentImageInfos used to create framebuffer (https://vulkan.lunarg.com/doc/view/1.2.170.0/windows/1.2-extensions/vkspec.html#VUID-VkRenderPassBeginInfo-framebuffer-04627)
        object info: (type: RENDER_PASS, hndl: 13111820197252038670)
    

    Getting a lot of these running tutorial 2 (not tutorial 1).

    cd code/beginner/tutorial2-swapchain
    cargo run --bin tutorial2-swapchain
    

    I saw another closed issue with another error message, where you requested a trace. I captured one, allowing the example to run ~5 seconds, attached: trace.zip.

    Also, vulkan configuration says I have (might help?):

    Vulkan Development Status:

    • Layers override: "Validation" configuration
    • $VULKAN_SDK SDK path: C:\VulkanSDK\1.2.170.0
    • Vulkan Loader version: 1.2.170
    • User-Defined Layers Paths from $VK_LAYER_PATH: None
    • User-Defined Layers Paths from Vulkan Configurator: None
    • Available Layers:
      • VK_LAYER_NV_optimus (1.2.168)
      • VK_LAYER_OBS_HOOK (1.2.131)
      • VK_LAYER_VALVE_steam_overlay (1.2.136)
      • VK_LAYER_VALVE_steam_fossilize (1.2.136)
      • VK_LAYER_EOS_Overlay (1.2.136)
      • VK_LAYER_EOS_Overlay (1.2.136)
      • VK_LAYER_LUNARG_override (1.2.170)
      • VK_LAYER_LUNARG_api_dump (1.2.170)
      • VK_LAYER_LUNARG_device_simulation (1.2.170)
      • VK_LAYER_LUNARG_gfxreconstruct (1.2.170)
      • VK_LAYER_KHRONOS_synchronization2 (1.2.170 - BETA)
      • VK_LAYER_KHRONOS_validation (1.2.170)
      • VK_LAYER_LUNARG_monitor (1.2.170)
      • VK_LAYER_LUNARG_screenshot (1.2.170)
    • Physical Devices:
      • NVIDIA GeForce RTX 2080 Ti (Discrete GPU) with Vulkan 1.2.168
    opened by Grindv1k 6
  • Cannot access diffuse_texture.view while working through the beginner tutorial on textures

    Cannot access diffuse_texture.view while working through the beginner tutorial on textures

    https://sotrh.github.io/learn-wgpu/beginner/tutorial5-textures/#loading-an-image-from-a-file

    Basically just following along but I'm getting an error while working through the subsections. I just noticed it when I was at the shader section, but in the tutorial steps the variable diffuse_texture seems to be used for two separate things.

    No matter if diffuse_texture is a Texture or DynamicImage I can't seem to access the view or sampler fields.

    Not sure if I'm just missing something obvious here, but wanted to bring it up!

    opened by corjohnson 6
  • Outdated contents in Markdown website, compared to Github repo/directory

    Outdated contents in Markdown website, compared to Github repo/directory

    In the "The Swapchain" section of the tutorial, the State::new() block calls let size = window.inner_size(); twice. I don't think both calls are needed. Was the call intended to go at the beginning or end of the code block?

    https://github.com/sotrh/learn-wgpu/blob/master/docs/beginner/tutorial2-swapchain/README.md#statenew


    Actually I've noticed multiple differences between the .md code and your repo. State::new() writes the adapter field into Self = State, which doesn't exist. This field was removed in the repo at https://github.com/sotrh/learn-wgpu/blob/master/code/beginner/tutorial2-swapchain/src/main.rs .


    Also the code doesn't compile on wgpu 0.6.


    https://github.com/sotrh/learn-wgpu/blob/master/code/beginner/tutorial6-uniforms/src/main.rs#L466 self.queue.write_buffer(&self.uniform_buffer, 0, &bytemuck::cast_slice(&[self.uniforms])); I suspect the & in &bytemuck::cast_slice is redundant and gets silently discarded.

    opened by nyanpasu64 6
  • More details on geometry shader

    More details on geometry shader

    I added a slightly personal instruction when mentioning geometry shader that they should in general not be used. They dramatically reduce performance and in the industry, most people are not using them.

    Also I had previously tried to fix some code formating which I had no time to pursue. Those commits can be reverted if you will

    opened by erwanvivien 1
  • Discuss use of unsafe for `create_surface`

    Discuss use of unsafe for `create_surface`

    The code in the State::new section of the introductory tutorial includes a call to the unsafe create_surface method. I think it would be useful to include a discussion of what is required for this call to be valid and why the usage shown meets these requirements, preferably also with a comment in the source code at that line.

    opened by ajtribick 1
  • Bump qs from 6.5.2 to 6.5.3

    Bump qs from 6.5.2 to 6.5.3

    Bumps qs from 6.5.2 to 6.5.3.

    Changelog

    Sourced from qs's changelog.

    6.5.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] utils.merge: avoid a crash with a null target and a truthy non-array source
    • [Fix] correctly parse nested arrays
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Refactor] utils: reduce observable [[Get]]s
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [Refactor] parse: only need to reassign the var once
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clean up license text so it’s properly detected as BSD-3-Clause
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] always use String(x) over x.toString()
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 298bfa5 v6.5.3
    • ed0f5dc [Fix] parse: ignore __proto__ keys (#428)
    • 691e739 [Robustness] stringify: avoid relying on a global undefined (#427)
    • 1072d57 [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 12ac1c4 [meta] fix README.md (#399)
    • 0338716 [actions] backport actions from main
    • 5639c20 Clean up license text so it’s properly detected as BSD-3-Clause
    • 51b8a0b add FUNDING.yml
    • 45f6759 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • f814a7f [Dev Deps] backport from main
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump decode-uri-component from 0.2.0 to 0.2.2

    Bump decode-uri-component from 0.2.0 to 0.2.2

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
sotrh
Working on sotrh.github.io/learn-wgpu
sotrh
State of the art "build your own engine" kit powered by gfx-hal

A rendering engine based on gfx-hal, which mimics the Vulkan API. Building This library requires standard build tools for the target platforms, except

Amethyst Foundation 801 Dec 28, 2022
3d Cellular Automata using WGPU in Rust (for the web and using compute shaders)

3D-Cellular-Automata-WGPU 3d Cellular Automata using WGPU in Rust (for the web and using compute shaders) The branches are very messy... I recommend y

null 18 Dec 18, 2022
Simple profiler scopes for wgpu using timer queries

wgpu-profiler Simple profiler scopes for wgpu using timer queries Features Easy to use profiler scopes Allows nesting! Can be disabled by runtime flag

null 41 Dec 5, 2022
Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Raphael Van Hoffelen 110 Dec 22, 2022
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

Khalid 20 Jan 5, 2023
game engine built in rust, using wgpu and probably other stuff too

horizon game engine engine for devpty games, made in 99.9% rust and 0.1% shell. this is our main project currently. the engine will be used for most i

DEVPTY 2 Apr 12, 2022
Scion is a tiny 2D game library built on top of wgpu, winit and legion.

Scion is a 2D game library made in rust. Please note that this project is in its first milestones and is subject to change according to convience need

Jérémy Thulliez 143 Dec 25, 2022
A modern 3D/2D game engine that uses wgpu.

Harmony A modern 3D/2D game engine that uses wgpu and is designed to work out of the box with minimal effort. It uses legion for handling game/renderi

John 152 Dec 24, 2022
A curated list of wgpu code and resources.

Awesome wgpu A curated list of wgpu code and resources. PRs welcome. About wgpu https://github.com/gfx-rs/wgpu-rs matrix chat https://matrix.to/#/#wgp

Roman Frołow 283 Jan 3, 2023
Tic-Tac-Toe on the GPU, as an example application for wgpu

Tic-Tac-GPU A simple (cough cough) example on a tic-tac-toe game with wgpu. Why? Because I didn't find that many small applications which use wgpu as

multisn8 2 Oct 7, 2022
🍖A WGPU graphics pipeline, along with simple types used to marshal data to the GPU

renderling ?? This library is a collection of WGPU render pipelines. Shaders are written in GLSL. shaderc is used to compile shaders to SPIR-V. Defini

Schell Carl Scivally 5 Dec 20, 2022
🦅🦁 Fast, simple 2D text renderer for wgpu

?? glyphon ?? Fast, simple 2D text rendering for wgpu What is this? This crate provides a simple way to render 2D text with wgpu by: rasterizing glyph

Josh Groves 60 Nov 5, 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 simple space shooter game. Runs in the terminal using characters-based UI. Fully written in Rust, using the "ruscii" library.

Thrust - a terminal shooter game Originally created as a project for the "Missing Semester" course at JKU Linz (338.006). The game is entirely written

Mathias Wöß 3 Jan 16, 2023
Using bevy and custom render pipelines in order to render many objects in a forest using chunks for performance.

bevy_efficient_forest_example Using bevy and custom render pipelines in order to render many objects in a forest using chunks for performance. Grass i

Henrik Djurestål 43 Jan 5, 2023
Using USBPcap to side-step anticheat in games, in order to reroute rumble packets to sex toys via The Buttplug Sex Toy Control Library

Using USBPcap to side-step anticheat in games, in order to reroute rumble packets to sex toys via The Buttplug Sex Toy Control Library.

qDot 23 Jan 3, 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
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

Ossama Hjaji 67 Dec 10, 2022
Show puffin profiler flamegraph in-game using egui

Show puffin profiler flamegraph in-game using egui puffin is an instrumentation profiler where you opt-in to profile parts of your code: fn my_functio

Emil Ernerfeldt 44 Jun 3, 2022