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

Camera with Viewport has blocky lighting bugs (clustered forward rendering related?) #5946

Closed
jakobhellermann opened this issue Sep 11, 2022 · 0 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@jakobhellermann
Copy link
Contributor

Bevy version

main (6f2cc0b30e335f3084f7028498c0866279c78099)

Relevant system information

Linux 5.19.0-76051900-generic #202207312230~1660780566~22.04~9d60db1 SMP PREEMPT_DYNAMIC Thu A x86_64 x86_64 x86_64 GNU/Linux
2022-09-11T09:37:58.908452Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce 940MX", vendor: 4318, device: 4941, device_type: DiscreteGpu, backend: Vulkan }

What you did

I run the cornell example but the camera has a viewport set:

Screenshot from 2022-09-11 11-15-40

Output with CLUSTERED_FORWARD_DEBUG_CLUSTER_COHERENCY set:

Screenshot from 2022-09-11 11-31-59
Screenshot from 2022-09-11 11-32-05
Screenshot from 2022-09-11 11-32-09
Screenshot from 2022-09-11 11-32-14

@jakobhellermann jakobhellermann added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Sep 11, 2022
@bors bors bot closed this as completed in 503c2a9 Sep 15, 2022
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 19, 2022
# Objective

fixes bevyengine#5946

## Solution

adjust cluster index calculation for viewport origin.

from reading point 2 of the rasterization algorithm description in https://gpuweb.github.io/gpuweb/#rasterization, it looks like framebuffer space (and so @bulitin(position)) is not meant to be adjusted for viewport origin, so we need to subtract that to get the right cluster index.

- add viewport origin to rust `ExtractedView` and wgsl `View` structs
- subtract from frag coord for cluster index calculation
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective

fixes bevyengine#5946

## Solution

adjust cluster index calculation for viewport origin.

from reading point 2 of the rasterization algorithm description in https://gpuweb.github.io/gpuweb/#rasterization, it looks like framebuffer space (and so @bulitin(position)) is not meant to be adjusted for viewport origin, so we need to subtract that to get the right cluster index.

- add viewport origin to rust `ExtractedView` and wgsl `View` structs
- subtract from frag coord for cluster index calculation
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

fixes bevyengine#5946

## Solution

adjust cluster index calculation for viewport origin.

from reading point 2 of the rasterization algorithm description in https://gpuweb.github.io/gpuweb/#rasterization, it looks like framebuffer space (and so @bulitin(position)) is not meant to be adjusted for viewport origin, so we need to subtract that to get the right cluster index.

- add viewport origin to rust `ExtractedView` and wgsl `View` structs
- subtract from frag coord for cluster index calculation
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

Successfully merging a pull request may close this issue.

1 participant