Skip to content

Improve energy conservation in the solari BRDF#24246

Merged
mockersf merged 4 commits into
bevyengine:mainfrom
dylansechet:solari_brdf_mixing
May 21, 2026
Merged

Improve energy conservation in the solari BRDF#24246
mockersf merged 4 commits into
bevyengine:mainfrom
dylansechet:solari_brdf_mixing

Conversation

@dylansechet

@dylansechet dylansechet commented May 11, 2026

Copy link
Copy Markdown
Contributor

Objective

This PR is split off from #23818.
It depends on #24313, which is integrated as the first commit here.

There's an issue in the solari BRDF which causes partially metallic objects to lose energy in the white furnace test.

Solution

The current BRDF computes a blended F0 between metallic and dielectric materials, and then uses it it for calculations. It should be evaluating both the metallic and dielectric BRDFs separately and only blend them as a last step.

A similar issue used to be present for IBL and was fixed in the same way, see #23203.

Showcase

White furnace test

Main:
layering

This PR:
mixing

@kfc35 kfc35 added A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Shaders This code uses GPU shader languages labels May 11, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 11, 2026
@kfc35 kfc35 removed the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label May 11, 2026
@dylansechet dylansechet force-pushed the solari_brdf_mixing branch from aaf0c60 to 3a5b380 Compare May 15, 2026 23:38
@dylansechet

Copy link
Copy Markdown
Contributor Author

I've rebased on main now that #24243 has been merged.

@JMS55 JMS55 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm! Thank you for breaking the PR up, it really helped review.

One small nit: Probably better to use mix() here for blending between dielectric and metals.

@JMS55 JMS55 added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label May 17, 2026

@SparkyPotato SparkyPotato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, after the mix suggestion

@JMS55 JMS55 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 May 17, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch May 21, 2026
@alice-i-cecile

Copy link
Copy Markdown
Member

Merge conflicts sorry.

@dylansechet

Copy link
Copy Markdown
Contributor Author

Conflicts fixed :)

@mockersf mockersf added this pull request to the merge queue May 21, 2026
Merged via the queue into bevyengine:main with commit 5aa0d22 May 21, 2026
55 of 58 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering May 21, 2026
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 D-Shaders This code uses GPU shader languages 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