Skip to content

Conversation

@aevyrie
Copy link
Member

@aevyrie aevyrie commented Jan 4, 2026

Objective

Solution

  • Apply the modified (a_prime) specular roughness instead of the base roughness. This allows specular to correctly broaden and fade with distance per Karis 2013.
  • The only downside of this approach is that specular reflections on smooth materials are over-attenuated. This is a known issue of Karis 2013, and the solution is to implement a popular solution like Linearly Transformed Cosines to handle area lights more correctly.
  • In the meantime, I've applied a correction that lerps between the base roughness and the modified area light roughness, to retain sharpness and brightness for glossy materials. This was tuned from the reference renders.

Testing

Reference (Blender)

image

Before

image

After

image

Sharp Reference (Blender)

image

Sharp Before

image

Sharp After

image

Showcase

image image image image image image image image image image

@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Jan 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 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-22372

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.

@alice-i-cecile alice-i-cecile modified the milestones: 0.18, 0.19 Jan 4, 2026
@aevyrie
Copy link
Member Author

aevyrie commented Jan 4, 2026

Before

Screen.Recording.2026-01-04.at.2.11.09.AM.mov

After

Screen.Recording.2026-01-04.at.2.11.44.AM.mov

@aevyrie aevyrie added the M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered label Jan 4, 2026
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen X-Controversial There is active debate or serious implications around merging this PR labels Jan 4, 2026
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jan 4, 2026
@alice-i-cecile
Copy link
Member

Yay! Progress towards finally fixing our specular highlights is huge. I've marked this as Controversial because I want SME-Rendering to decide whether we ship this as a stop-gap, or wait for a better fix (probably Linear Transformed Cosines) to avoid altering the appearance of this twice for our users.

@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon and removed X-Controversial There is active debate or serious implications around merging this PR labels Jan 4, 2026
@alice-i-cecile
Copy link
Member

Per discussion in the Discord thread I opened to discuss this, consensus seems to be that is safest to ship in 0.19, but a last minute 0.18 fix would be tolerable. Leaving out of the 0.18 milestone, but @cart or @mockersf can overrule me if they feel strongly.

The assorted experts feel strongly that we should ship this, and not wait for LTC to further improve things.

@pcwalton
Copy link
Contributor

pcwalton commented Jan 5, 2026

Can you link me Karis 2013 (ideally the part of it where it says to do what you're doing)?

Also it'd probably be good to mention that linearly transformed cosines is a better solution in the comment you left, preferably with a link so that people who want to contribute the right solution know where to look.

@janhohenheim
Copy link
Member

janhohenheim commented Jan 5, 2026

@pcwalton looks like page 14 of https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf

image This is the reason why the commented out code is... commented out.

The pages after that deal with the sphere light formula used here:
image
image

with the exception of the custom modification cc_lerp = 1.0 - (1 - a)^4.

@JMS55
Copy link
Contributor

JMS55 commented Jan 5, 2026

Copy link
Member

@janhohenheim janhohenheim left a comment

Choose a reason for hiding this comment

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

I don't have thaaaaat much knowledge here, but from comparing it with the paper it looks correct, and the manual tweak on top looks good in your test scenes :)

Copy link
Contributor

@pcwalton pcwalton left a comment

Choose a reason for hiding this comment

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

Awesome, let's get this in. Big improvement that addresses a long-standing problem.

@alice-i-cecile
Copy link
Member

I'm leaning toward landing this in 0.18 as well. The current visuals are so clearly broken and so clearly a "quality perception liability", both for Bevy games and for Bevy generally, that any immediate forward progress would be welcome. But this (partially) has literature to back up the changes / seems well motivated.

Re-triaging to 0.18 per @cart's latest comments :) YOLO, 🚀, etc. etc.

@alice-i-cecile alice-i-cecile modified the milestones: 0.19, 0.18 Jan 5, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 6, 2026
@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 C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 6, 2026
Merged via the queue into bevyengine:main with commit 1384bcb Jan 6, 2026
42 checks passed
@github-project-automation github-project-automation bot moved this to Done in Rendering Jan 6, 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 C-Bug An unexpected or incorrect behavior C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. M-Deliberate-Rendering-Change An intentional change to how tests and examples are rendered S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Specular from area lights is disproportionately bright

6 participants