Skip to content

Scale transmission roughness by IOR#24453

Merged
alice-i-cecile merged 3 commits into
bevyengine:mainfrom
issam3105:scale_transmission_roughness_by_IOR
Jun 2, 2026
Merged

Scale transmission roughness by IOR#24453
alice-i-cecile merged 3 commits into
bevyengine:mainfrom
issam3105:scale_transmission_roughness_by_IOR

Conversation

@issam3105

@issam3105 issam3105 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Objective

  • Scale transmission roughness by IOR.
  • In the Khronos TransmissionRoughnessTest sample, Khronos' comment explains the core case:
    With IOR = 1.0, light vectors do not change regardless of how strong the microfacet angles become. When this happens, transmission will be sharp and non-blurred, regardless of the material's roughness, because the microfacets cannot alter the direction of transmitted light.

Solution

Testing

  • Tested visually with the Khronos TransmissionRoughnessTest glTF sample: the 1.0 - Air row should remain sharp across roughness values.

Showcase

  • Before:
image
  • After:
image
  • Blender Cycles
image

@issam3105 issam3105 force-pushed the scale_transmission_roughness_by_IOR branch from 43f60ba to da8318a Compare May 26, 2026 12:36
@issam3105 issam3105 force-pushed the scale_transmission_roughness_by_IOR branch from da8318a to 6e8fe4e Compare May 26, 2026 14:25
@issam3105 issam3105 marked this pull request as ready for review May 26, 2026 14:27
@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 26, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 26, 2026
@kfc35 kfc35 added D-Straightforward Simple bug fixes and API improvements, docs, test and examples C-Bug An unexpected or incorrect behavior labels May 26, 2026

@goodartistscopy goodartistscopy 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 sensible to me and in line with refraction occurring on microfacets.

Comment thread crates/bevy_pbr/src/transmission/transmission.wgsl Outdated

@dylansechet dylansechet 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.

Main This PR Cycles reference
ior_bevy_main ior_bevy_pr ior_cycles

Looks good to me! The Khronos formula doesn't correct for IOR>1.5, but that was already an issue before this PR.

Co-authored-by: Christophe Dehais <christophe.dehais@gmail.com>
@goodartistscopy

Copy link
Copy Markdown
Contributor

Looks good to me! The Khronos formula doesn't correct for IOR>1.5, but that was already an issue before this PR.

Indeed, this could be tweaked by changing the upper bound on the clamp() I believe.

@kfc35 kfc35 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 Jun 1, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 2, 2026
Merged via the queue into bevyengine:main with commit 2d9c0a0 Jun 2, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Jun 2, 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 D-Shaders This code uses GPU shader languages D-Straightforward Simple bug fixes and API improvements, docs, test and examples 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