bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.52k stars 3.52k forks source link

Document how to set the rendering backend #3406

Open alice-i-cecile opened 2 years ago

alice-i-cecile commented 2 years ago

Graphics backend compatibility issues are one of our most common sources of configuration pain still, and trying out different backends is one of the common recommended troubleshooting steps.

I believe you can set the WGPU_BACKEND environment variable to do so, but I'm not familiar enough with rendering to be entirely sure if that's true, or how to verify that it worked.

We should a) verify that this works b) decide where to put this sort of troubleshooting information c) document this approach.

rparrett commented 2 years ago

As for A, this definitely works.

linux/mac

WGPU_BACKEND=vulkan cargo run --example breakout

windows

set WGPU_BACKEND=vulkan
cargo run --example breakout
davehorner commented 2 years ago

I was having troubles with the examples not working and exiting. It was reporting vulkan in the info line, i'm on a win10 machine. This issue helped me get my machine working by doing a set WGPU_BACKEND=dx12

in case someone else runs into the issue on windows... thanks!

MrThanlon commented 1 year ago

I was having troubles with the examples not working and exiting. It was reporting vulkan in the info line, i'm on a win10 machine. This issue helped me get my machine working by doing a set WGPU_BACKEND=dx12

in case someone else runs into the issue on windows... thanks!

powershell env command is

$Env:WGPU_BACKEND="dx12"
jrmoserbaltimore commented 5 months ago

There should be a way to do this in code, yes? In case the game wants to also expose a setting to the user, or otherwise.