Skip to content

Add OpenPBR support to Viewer#18432

Open
MiiBond wants to merge 13 commits into
BabylonJS:masterfrom
MiiBond:mbond/openpbr-in-viewer
Open

Add OpenPBR support to Viewer#18432
MiiBond wants to merge 13 commits into
BabylonJS:masterfrom
MiiBond:mbond/openpbr-in-viewer

Conversation

@MiiBond
Copy link
Copy Markdown
Contributor

@MiiBond MiiBond commented May 7, 2026

This adds support for the useOpenPBR flag. It also adds a material dropdown in the test viewer that triggers a reload of the model. I had to add some tracking for the current model so that it didn't keep reloading the default UFO model. Similarly for the Viewer Configurator.

@Popov72
Copy link
Copy Markdown
Contributor

Popov72 commented May 7, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

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.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

Reviewer - this PR has made changes to the build configuration file.

This build will release a new package on npm

If that was unintentional please make sure to revert those changes or close this PR.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

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

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

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

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18432/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/18432/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18432/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18432/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18432/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/18432/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
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 7, 2026

🟢 Memory Leak Test Results

13 passed, 0 leaked out of 13 scenarios

🟢 All memory leak tests passed — no leaks detected.

Passed Scenarios (13)
Scenario Package
Core Feature Stack @babylonjs/core
Core Rendering Materials Shadows Stack @babylonjs/core
Core Textures Render Targets PostProcess Stack @babylonjs/core
GUI Fullscreen UI Controls @babylonjs/gui
GUI Mesh ADT Controls @babylonjs/gui
Loaders Boombox Import @babylonjs/loaders
Loaders OBJ Direct Load @babylonjs/loaders
Loaders STL Direct Load @babylonjs/loaders
Materials Library Stack @babylonjs/materials
Serializers glTF Export @babylonjs/serializers
Serializers GLB Export @babylonjs/serializers
PostProcesses Digital Rain Stack @babylonjs/post-processes
Procedural Textures Stack @babylonjs/procedural-textures

Copy link
Copy Markdown
Member

@ryantrem ryantrem left a comment

Choose a reason for hiding this comment

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

We'll also need to update the Viewer docs and Configurator.

Comment thread packages/tools/viewer/src/viewer.ts Outdated
@MiiBond
Copy link
Copy Markdown
Contributor Author

MiiBond commented May 7, 2026

@ryantrem, I've updated the configurator but I'm having trouble running it locally to test. I repeatedly get an error about const SSAOOptions being declared multiple times.

@ryantrem
Copy link
Copy Markdown
Member

ryantrem commented May 8, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 8, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 8, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 8, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 8, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 8, 2026

🟢 Memory Leak Test Results

13 passed, 0 leaked out of 13 scenarios

🟢 All memory leak tests passed — no leaks detected.

Passed Scenarios (13)
Scenario Package
Core Feature Stack @babylonjs/core
Core Rendering Materials Shadows Stack @babylonjs/core
Core Textures Render Targets PostProcess Stack @babylonjs/core
GUI Fullscreen UI Controls @babylonjs/gui
GUI Mesh ADT Controls @babylonjs/gui
Loaders Boombox Import @babylonjs/loaders
Loaders OBJ Direct Load @babylonjs/loaders
Loaders STL Direct Load @babylonjs/loaders
Materials Library Stack @babylonjs/materials
Serializers glTF Export @babylonjs/serializers
Serializers GLB Export @babylonjs/serializers
PostProcesses Digital Rain Stack @babylonjs/post-processes
Procedural Textures Stack @babylonjs/procedural-textures

@ryantrem
Copy link
Copy Markdown
Member

ryantrem commented May 8, 2026

@MiiBond I pushed a fix for the SSAOOptions issue and added a couple of tests, but in doing so, I see that it is not working with WebGPU. There are runtime errors and the model is not rendered.

@MiiBond
Copy link
Copy Markdown
Contributor Author

MiiBond commented May 11, 2026

Thank you. How do I run the viewer tests in WebGPU? I don't see an option for that.

The default model in "Viewer Test App" doesn't load with OpenPBR because it uses the legacy spec-gloss extension for glTF. That is a known issue and I've added spec-gloss support in #18430

@Popov72
Copy link
Copy Markdown
Contributor

Popov72 commented May 11, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 11, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 11, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 11, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 11, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 11, 2026

🟢 Memory Leak Test Results

13 passed, 0 leaked out of 13 scenarios

🟢 All memory leak tests passed — no leaks detected.

Passed Scenarios (13)
Scenario Package
Core Feature Stack @babylonjs/core
Core Rendering Materials Shadows Stack @babylonjs/core
Core Textures Render Targets PostProcess Stack @babylonjs/core
GUI Fullscreen UI Controls @babylonjs/gui
GUI Mesh ADT Controls @babylonjs/gui
Loaders Boombox Import @babylonjs/loaders
Loaders OBJ Direct Load @babylonjs/loaders
Loaders STL Direct Load @babylonjs/loaders
Materials Library Stack @babylonjs/materials
Serializers glTF Export @babylonjs/serializers
Serializers GLB Export @babylonjs/serializers
PostProcesses Digital Rain Stack @babylonjs/post-processes
Procedural Textures Stack @babylonjs/procedural-textures

@ryantrem
Copy link
Copy Markdown
Member

I believe when you run the tests locally they should be WebGPU by default.

I think the errors I was seeing were with the ufo model the test app uses (or it might have been the boombox), but I was only seeing errors with WebGPU, not WebGL.

Do we just need to wait for the other PR you mentioned then to verify everything is working correctly with this PR?

@MiiBond
Copy link
Copy Markdown
Contributor Author

MiiBond commented May 12, 2026

The errors with the UFO should be with OpenPBR only, not strictly WebGPU.
But, yes, let's get the other PR in first so that the UFO loads with OpenPBR.

@MiiBond
Copy link
Copy Markdown
Contributor Author

MiiBond commented May 13, 2026

Okay, I've merged my changes from master and the WebGPU errors are gone and spec-gloss models also load properly with OpenPBR. So, I think this PR is good now.

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