bevyengine / bevy

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

amd gpu make shadows are misplaced on a very large plane #6542

Open hymm opened 1 year ago

hymm commented 1 year ago

Bevy version

0.8, main 9b56b549ad866ee200b890216b2d6dd39cfa34ad (Nov 10, 2022)

Relevant system information

Windows 11 AdapterInfo { name: "AMD Radeon RX 6600", vendor: 4098, device: 29695, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "22.9.2", backend: Vulkan }

What you did

Ran cargo run --release --example many_foxes and resized the window by grabbing the bottom right with the mouse.

What went wrong

Shadows on the foxes are misplaced sometimes.

image

image

superdump commented 1 year ago

Could you test with this: https://github.com/bevyengine/bevy/pull/6543 ? I don't think it will affect this one but maybe...

mockersf commented 1 year ago

this seems to be due to https://github.com/bevyengine/bevy/pull/6384

superdump commented 1 year ago

this seems to be due to #6384

Ah... I think it was weird stuff like this which was why I didn't use the light's translation and commented as such. And when I made an attempt to achieve the same kind of thing, I instead adjusted the left/right/top/bottom/near/far.

irate-devil commented 1 year ago

I can't reproduce this on Manjaro with a 2070 SUPER.

this seems to be due to #6384

Looking at the code, I wouldn't expect that behavior to change on different hardware, but it would be great if people could test that. Otherwise, a git disect would be smart

greytdepression commented 1 year ago

I can't reproduce it either on Fedora with an Intel integrated GPU

JMS55 commented 1 year ago

Can't reproduce. Both after the latest commit c4e791d62890cc02773564bad7592345d2b8f05c, or going back ~5 commits.

Windows 11 AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8710, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "526.47", backend: Vulkan }

haike0513 commented 1 year ago

It can be reproduce in my computer, It's seems about AMD GPU

Windows 11 AdapterInfo { name: "AMD Radeon(TM) Graphics", vendor: 4098, device: 5761, device_type: IntegratedGpu, driver: "AMD proprietary driver", driver_info: "22.20.28", backend: Vulkan }

Indy2222 commented 1 year ago

My observations:

Elabajaba commented 1 year ago

this seems to be due to https://github.com/bevyengine/bevy/pull/6384

Tried the commit before that one was merged, still broken.

Elabajaba commented 1 year ago

After a bunch of back and forth on discord, this seems to be some sort of rounding or floating point precision issue with the absolutely massive plane that the many_foxes example uses.

@robtfm reproduced the issues on a 3070 with a 500000000 sized plane, while the current 500000 plane causes issues on AMD GPUs.

Changing it to a 5000 sized plane seems to fix it.

hymm commented 1 year ago

fixed in above pr

hymm commented 1 year ago

reopening issue as we should triage why nvidia and amd are different.