Skip to content

Conversation

@JMS55
Copy link
Contributor

@JMS55 JMS55 commented Nov 5, 2025

  • Fix overflow/nans in BRDF evaluation
  • Reduce jacobian rejection threshold to prevent light leaks (more aggressive cutoff now)

@JMS55 JMS55 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. labels Nov 5, 2025
@JMS55 JMS55 requested review from SparkyPotato and atlv24 November 5, 2025 02:55
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Nov 5, 2025
@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Nov 7, 2025
@JMS55 JMS55 requested a review from SparkyPotato November 7, 2025 15:10
let props = unpack4x8unorm(gpixel.b);
let reflectance = vec3(props.r);
let metallic = props.g;
let metallic = saturate(props.g); // TODO: Not sure why saturate is needed here to prevent NaNs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be something wrong with our gbuffer encoding? @DGriffin91

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like any bit pattern of gpixel.b should be valid in respect to metallic. It seems sus if unpack4x8unorm is returning something that's not 0.0..=1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah idk

Copy link
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

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

Tested and runs on my laptop. Subjectively seems good with the exception that when I turn off both light sources it takes an absurdly long time (5ish seconds) for the light to fade entirely, which seems wrong.

@tychedelia tychedelia 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 Nov 20, 2025
@JMS55
Copy link
Contributor Author

JMS55 commented Nov 21, 2025

Tested and runs on my laptop. Subjectively seems good with the exception that when I turn off both light sources it takes an absurdly long time (5ish seconds) for the light to fade entirely, which seems wrong.

That's a known issue with our radiance caching, not related to this PR.

It's very very hard to get something that's both stable and reacts quickly to lighting changes.

#21810 should improve things though.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 21, 2025
Merged via the queue into bevyengine:main with commit a32ffae Nov 21, 2025
36 checks passed
beicause pushed a commit to beicause/bevy that referenced this pull request Nov 26, 2025
* Fix overflow/nans in BRDF evaluation
* Reduce jacobian rejection threshold to prevent light leaks (more
aggressive cutoff now)
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 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