Skip to content

Conversation

@superdump
Copy link
Contributor

@superdump superdump commented Jan 6, 2026

Objective

  • Reduce aliasing and Moiré patterns in temporal shadow filtering

Solution

  • Use interleaved gradient noise based on screen UV not light local UV

NOTE: It only affects ShadowFilteringMethod::Temporal or non-temporal PCSS

Testing

Tested with pcss and shadow_biases examples. The latter was more useful - see showcase section.

NOTE: It only affects ShadowFilteringMethod::Temporal or non-temporal PCSS

However, this touches more code paths and all combinations need testing:

  • Light types:
    • Point
    • Spot
    • Directional
  • Shadow mapping
  • Soft shadows (PCSS)
  • Transmission
  • Distance fog

Showcase

main:
Screenshot 2026-01-06 at 01 12 48

PR:
Screenshot 2026-01-06 at 01 12 26

It also makes the full temporal mode where the noise patterns change each frame look much better, especially with TAA enabled. That is however a bit difficult to illustrate due to the animation aspect.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-22400

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

Use interleaved gradient noise based on screen UV not light local UV
@superdump superdump mentioned this pull request Jan 6, 2026
@greeble-dev greeble-dev added A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. labels Jan 6, 2026
Copy link
Contributor

@JMS55 JMS55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Might need a migration guide though? I'm not sure about our policy for shader stuff like this, where the general advice is "copy and re-apply your changes each time you update bevy".

@pcwalton
Copy link
Contributor

pcwalton commented Jan 6, 2026

Historically we haven't really included shader guts in the migration guides. naga_oil doesn't have privacy really, so technically every change to any function anywhere is a breaking change, which would be too aggressive of a policy. Maybe with WESL we can start marking functions as private, which would let us come up with a migration guide policy for shader functions?

@JMS55
Copy link
Contributor

JMS55 commented Jan 6, 2026

Generally I agree, e.g. it makes no sense to have migrations for random SSR functions or whatever, but specifically for our material/lighting code, a lot of people copy paste or import that.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 6, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 6, 2026
Merged via the queue into bevyengine:main with commit 2489879 Jan 6, 2026
46 checks passed
@github-project-automation github-project-automation bot moved this to Done in Rendering Jan 6, 2026
@mockersf
Copy link
Member

mockersf commented Jan 6, 2026

This PR broke examples atmospheric_fog and color_grading and a few others

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-Refinement Improves output quality, without fixing a clear bug or adding new functionality. S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants