DLSS / MainPassResolutionOverride: point and spot lights are cut off in screen-aligned rectangles (cluster lookup uses the full viewport size)
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- computer-graphics
Research direction
Read bevy_pbr/src/render/clustered_forward.wesl at view_fragment_cluster_index and bevy_pbr/src/render/light.rs in prepare_lights. Compare the viewport used for fragment cluster lookup with the viewport used to calculate cluster_factors, then check how MainPassResolutionOverride supplies main_pass_viewport. Done means clustered lights align at reduced main pass resolution and the reported cutoff is gone; verify at both overridden and full resolution.
Written by the indexing model from the issue text.
Description
Bevy version and features
- 0.20.1
- Features: default +
dlss(bevy_anti_alias::dlss). The camera hasDlss::<DlssSuperResolutionFeature>withDlssPerfQualityMode::Quality.
[Optional] Relevant system information
cargo 1.99.1 (5f94df478 2026-08-27)- Windows 11
AdapterInfo { name: "NVIDIA GeForce RTX 5080", vendor: 4318, device: 11266, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "616.92", backend: Vulkan }
What you did
A night scene with a SpotLight (range 45 m, outer angle 0.5 rad, no shadows) attached to
the camera like a flashlight, pointed at the ground. DLSS Super Resolution in Quality mode, so
the main pass renders at a lower resolution than the output (MainPassResolutionOverride).
GPU clustering is on (the default).
What went wrong
- Expected: one continuous light spot on the ground.
- Actual: parts of the lit area are missing in screen-aligned rectangles, with stair-step
edges along the cluster tile grid. It happens mostly at the far end of the light's range.
With DLSS DLAA (render resolution = output resolution) or without DLSS, everything is fine.
Additional information
bevy_pbr/src/render/clustered_forward.wesl, view_fragment_cluster_index:
let xy = vec2<u32>(floor((frag_coord - bindings::view.viewport.xy) * bindings::lights.cluster_factors.xy));
cluster_factors.xy is set in prepare_lights (bevy_pbr/src/render/light.rs) from the full
viewport:
cluster_factors: Vec4::new(
clusters.dimensions.x as f32 / extracted_view.viewport.z as f32,
clusters.dimensions.y as f32 / extracted_view.viewport.w as f32,
...
With MainPassResolutionOverride, frag_coord is in the reduced main pass resolution
(view.main_pass_viewport), while cluster_factors.xy is "clusters per output pixel". So every
fragment looks up the cluster at (render scale × its real position), i.e. a cluster up and to
the left of its own. Close to the camera the light covers almost every cluster, so nothing is
visible. At the far end of the light's range the neighbouring clusters don't contain the light,
and the light is cut off along the tile edges.
Workaround / proposed fix (one line), which makes the rectangles disappear:
let xy = vec2<u32>(floor((frag_coord - bindings::view.main_pass_viewport.xy)
/ bindings::view.main_pass_viewport.zw * vec2<f32>(bindings::lights.cluster_dimensions.xy)));
Without a resolution override main_pass_viewport equals viewport, so nothing changes there.
Another option is to compute cluster_factors.xy from the main pass size in prepare_lights.
Any other user of MainPassResolutionOverride is probably affected the same way.
Tested on one machine. Screenshots (same frame, DLSS Quality): before, after, and a zoomed
crop of the cut-off area.
- Dominant language
- Rust
- Stars
- 50k
- Forks
- 5.1k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 129
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bevyengine/bevy
-
C-Bug S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bevyengine/bevy#26718 ·
Maintainers usually reply within 2 days
-
C-Bug S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bevyengine/bevy#26689 ·
Maintainers usually reply within 2 days
-
Volumetric fog: a `FogVolume` with `Visibility::Hidden` is still renderedPossibly taken @adityawrk claimed this 2 days ago. OpenC-Bug S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bevyengine/bevy#26688 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
bevyengine/bevy#26684 ·
Maintainers usually reply within 2 days
-
Create a bevy_fuzzy examplePossibly taken @Tatsuya0330 claimed this 1 day ago. OpenA-UI C-Examples C-Feature D-Straightforward S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy#26676 ·
Maintainers usually reply within 2 days
Similar issues
-
area:ui effort:medium enhancement P7 source:agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
documentation priority: low tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
nledford/Ladderback#1823 ·
Maintainers usually reply within 1 day
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)Possibly taken @ealwanlee claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
psmux/psmux-plugins#47 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day