Visitar URL original
Fix HDR texture support in volumetric light scattering by BarthPaleologue · Pull Request #19036 · BabylonJS/Babylon.js · GitHub
Skip to content

Fix HDR texture support in volumetric light scattering - #19036

Open
BarthPaleologue wants to merge 1 commit into
BabylonJS:masterfrom
BarthPaleologue:fix/volumetric-light-scattering-hdr
Open

BarthPaleologue wants to merge 1 commit into
BabylonJS:masterfrom
BarthPaleologue:fix/volumetric-light-scattering-hdr

Conversation

@BarthPaleologue

@BarthPaleologue BarthPaleologue commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Hey there!

I noticed VolumetricLightScatteringPostProcess does not allow to change its internal texture format, forcing unsigned byte.

This is a problem for an HDR pipelines since it will result in white clipping.

I am adding a new an optional textureType constructor parameter and forwards it to both render targets to make it changeable. The default is still Constants.TEXTURETYPE_UNSIGNED_BYTE.

Let me know if that works for you!

Validation:

  • All 59 post-process unit tests pass, including the 7 volumetric-light-scattering tests.
  • Core TypeScript build, formatting and focused ESLint checks pass.
  • A temporary DevHost scene was checked in Chromium/WebGL2 with SwiftShader. With scene RGB (4, 2, 0.5), scattering RGB (8, 4, 1), exposure 1 and weight 0, half-float preserves both inputs and produces approximately (7.602, 3.801, 0.950) as expected. Unsigned-byte textures clip both inputs and produce (1.5, 1.5, 0.952).

Prepared with assistance from OpenAI Codex.

@BarthPaleologue
BarthPaleologue marked this pull request as ready for review October 22, 2026 17:51
@Popov72

Popov72 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@bjsplat

bjsplat commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

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

Approve. The optional trailing texture-type parameter preserves the existing default and reaches both render targets. The complete review found no actionable issues in the HDR allocation, shader sampling, lifecycle or existing caller paths. CI is running; no CI definitions or binary assets are changed.

@bjsplat

bjsplat commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Snapshot stored with reference name:
refs/pull/19036/merge

Test environment:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/19036/merge/index.html

To test a playground add it to the URL, for example:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/19036/merge/index.html#WGZLGJ#4600

Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves):

https://playground.babylonjs.com/?snapshot=refs/pull/19036/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/19036/merge
https://gui.babylonjs.com/?snapshot=refs/pull/19036/merge
https://nme.babylonjs.com/?snapshot=refs/pull/19036/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/19036/merge#BCU1XR#0

If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools.

@bjsplat

bjsplat commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

@bjsplat

bjsplat commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

🟢 Memory Leak Test Results

4 passed, 0 leaked out of 4 scenarios

🟢 All memory leak tests passed — no leaks detected.

Passed Scenarios (4)
Scenario Package
Core Playground #2FDQT5#1508 @babylonjs/core
Core Playground #T90MQ4#14 @babylonjs/core
Core Playground #8EDB5N#2 @babylonjs/core
Core Playground #LL5BIQ#636 @babylonjs/core

@bjsplat

bjsplat commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

@bjsplat

bjsplat commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

@bjsplat

bjsplat commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

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

Hello @BarthPaleologue,

Good to go from my side.

Thanks!

@deltakosh
deltakosh enabled auto-merge (squash) October 26, 2026 17:00
@BarthPaleologue

Copy link
Copy Markdown
Contributor Author

Thanks @deltakosh would it be possible to run again the CI? Seems is was caught in a flake and can't be merged until it's green again 🤔

@deltakosh

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@bjsplat

bjsplat commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

@bjsplat

bjsplat commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

🟢 Memory Leak Test Results

4 passed, 0 leaked out of 4 scenarios

🟢 All memory leak tests passed — no leaks detected.

Passed Scenarios (4)
Scenario Package
Core Playground #2FDQT5#1508 @babylonjs/core
Core Playground #T90MQ4#14 @babylonjs/core
Core Playground #8EDB5N#2 @babylonjs/core
Core Playground #LL5BIQ#636 @babylonjs/core

@bjsplat

bjsplat commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

@bjsplat

bjsplat commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@bjsplat

bjsplat commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

@BarthPaleologue

Copy link
Copy Markdown
Contributor Author

An audio unit test seems to timeout, seems unlikely to be caused by this PR's diff

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants