Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hymm opened this issue Nov 10, 2022 · 12 comments
Open

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

hymm opened this issue Nov 10, 2022 · 12 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@hymm
Copy link
Contributor

hymm commented Nov 10, 2022

Bevy version

0.8, main 9b56b54 (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

@hymm hymm added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 10, 2022
@superdump
Copy link
Contributor

Could you test with this: #6543 ? I don't think it will affect this one but maybe...

@mockersf
Copy link
Member

this seems to be due to #6384

@superdump
Copy link
Contributor

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.

@mockersf mockersf added this to the Bevy 0.9 milestone Nov 10, 2022
@irate-devil
Copy link
Contributor

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
Copy link
Contributor

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

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Nov 11, 2022
@JMS55
Copy link
Contributor

JMS55 commented Nov 11, 2022

Can't reproduce. Both after the latest commit c4e791d, 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
Copy link

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
Copy link

Indy2222 commented Nov 12, 2022

My observations:

  • It happens already in commit 76829f9
  • c3c4088 is still affected
  • The shadows are off immediately after the example window is opened
  • It seems the the window size has to be "just right" for it to work properly
  • My system: bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 6700 XT (RADV NAVI22)", vendor: 4098, device: 29663, device_type: DiscreteGpu, backend: Vulkan } and Arch Linux

@cart cart removed this from the Bevy 0.9 milestone Nov 12, 2022
@Elabajaba
Copy link
Contributor

this seems to be due to #6384

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

@Elabajaba
Copy link
Contributor

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.

bors bot pushed a commit that referenced this issue Jan 23, 2023
# Objective

Shadows are broken on many_foxes on AMD GPUs. This seems to be due to rounding or floating point precision issues combined with the absolute unit of a plane that it's currently using.

Related: #6542

I'm not sure if we want to close that issue, as there's still the underlying issue of shadows breaking on overly large planes.

## Solution

Make the plane smaller.
@hymm
Copy link
Contributor Author

hymm commented Jan 28, 2023

fixed in above pr

@hymm hymm closed this as completed Jan 28, 2023
@hymm
Copy link
Contributor Author

hymm commented Jan 28, 2023

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

@hymm hymm reopened this Jan 28, 2023
@hymm hymm changed the title shadows on many_foxes move around when resizing the window. amd gpu make shadows are misplaced on a very large plane Jan 28, 2023
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
)

# Objective

Shadows are broken on many_foxes on AMD GPUs. This seems to be due to rounding or floating point precision issues combined with the absolute unit of a plane that it's currently using.

Related: bevyengine#6542

I'm not sure if we want to close that issue, as there's still the underlying issue of shadows breaking on overly large planes.

## Solution

Make the plane smaller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests