Skip to content

Avoid excess F_ab sampling in solari#24313

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
dylansechet:solari_brdf_fab_perf
May 21, 2026
Merged

Avoid excess F_ab sampling in solari#24313
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
dylansechet:solari_brdf_fab_perf

Conversation

@dylansechet

Copy link
Copy Markdown
Contributor

Objective

Avoid sampling the F_AB LUT more times than necessary.

Solution

Make the caller compute F_AB and pass it down to the brdf functions.

Testing

The solari example runs in rt and pathtracing mode.

@JMS55

JMS55 commented May 15, 2026

Copy link
Copy Markdown
Contributor

I'll also measure perf when I get a chance.

@JMS55

JMS55 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Ever so slightly faster (tbh could just be noise), but still worth doing imo.

@mnmaita mnmaita added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 16, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 16, 2026
@mnmaita mnmaita added the D-Shaders This code uses GPU shader languages label May 16, 2026
@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
Merged via the queue into bevyengine:main with commit df7cb20 May 21, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering May 21, 2026
greeble-dev pushed a commit to greeble-dev/bevy that referenced this pull request May 21, 2026
# Objective

This PR is split off from bevyengine#23818.
It depends on bevyengine#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 bevyengine#23203.

## Showcase

### White furnace test

Main:
<img width="1280" height="720" alt="layering"
src="https://github.com/user-attachments/assets/5c7abaac-93ac-4a35-be76-e81681094232"
/>


This PR:
<img width="1280" height="720" alt="mixing"
src="https://github.com/user-attachments/assets/d0c32bab-c880-4222-a255-1f9a5c2e3f6a"
/>
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-Performance A change motivated by improving speed, memory usage or compile times D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes 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.

5 participants