Skip to content

Use SOG texture option#18475

Merged
RaananW merged 7 commits into
BabylonJS:masterfrom
CedricGuillemet:sogTextures
May 22, 2026
Merged

Use SOG texture option#18475
RaananW merged 7 commits into
BabylonJS:masterfrom
CedricGuillemet:sogTextures

Conversation

@CedricGuillemet
Copy link
Copy Markdown
Contributor

Option (off for now) to use SOG webp texture instead of decomposing them into individual components.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 19, 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 19, 2026

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

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 19, 2026

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

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

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

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18475/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/18475/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18475/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18475/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18475/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/18475/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 19, 2026

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

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 19, 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 19, 2026

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

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

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

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

# Conflicts:
#	packages/dev/core/src/Shaders/ShadersInclude/gaussianSplatting.fx
#	packages/dev/core/src/ShadersWGSL/ShadersInclude/gaussianSplatting.fx
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 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

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@CedricGuillemet CedricGuillemet marked this pull request as ready for review May 21, 2026 12:00
Copilot AI review requested due to automatic review settings May 21, 2026 12:00
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an (currently-off) loader/material/shader path to render SOG (Self-Organized Gaussians) assets by uploading the original WebP payloads as raw GPU textures and performing dequantization directly in the shader, aiming to reduce CPU decode work and improve load times.

Changes:

  • Added useSogTextures option to SPLAT loading options and routed SOG parsing through a new “raw texture pack” parser.
  • Introduced a SOG texture pack (sogTextures) plumbing path from loader → mesh → material → shaders, including new shader defines/uniforms/samplers.
  • Added a visualization test entry for a SOGS SH scenario.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/tools/tests/test/visualization/config.json Adds a new visualization test case for SOGS SH scenario.
packages/dev/loaders/src/SPLAT/splatLoadingOptions.ts Introduces useSogTextures loader option (default false).
packages/dev/loaders/src/SPLAT/splatFileLoader.ts Selects SOG parser based on option and feeds results into GS mesh via setSogTextureData.
packages/dev/loaders/src/SPLAT/splatDefs.ts Adds ISogTexturePack + sogTextures?: ... to parsed splat contract.
packages/dev/loaders/src/SPLAT/sog.ts Adds ParseSogMetaAsTextures to produce raw textures + dequant params instead of CPU-decoded buffers.
packages/dev/core/src/ShadersWGSL/ShadersInclude/gaussianSplatting.fx Adds USE_SOG path for in-shader dequant + SH reconstruction (WGSL include).
packages/dev/core/src/ShadersWGSL/gaussianSplatting.vertex.fx Declares extra SOG uniforms/textures for WGSL vertex shader.
packages/dev/core/src/Shaders/ShadersInclude/gaussianSplatting.fx Adds USE_SOG path for in-shader dequant + SH reconstruction (GLSL include).
packages/dev/core/src/Shaders/gaussianSplatting.vertex.fx Declares extra SOG uniforms/textures for GLSL vertex shader.
packages/dev/core/src/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.ts Adds mesh-side SOG mode, params storage, and setSogTextureData.
packages/dev/core/src/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.ts Adds USE_SOG/USE_SOG_V2 defines + binds SOG uniforms/textures.
Comments suppressed due to low confidence (1)

packages/dev/loaders/src/SPLAT/splatFileLoader.ts:245

  • The new Promise((resolve) => { sogParser(...).then(...).catch(() => { throw ... }) }) pattern can leave the outer Promise pending forever on failure: the .catch throws into the inner promise chain, but the outer promise is never rejected. Return the sogParser(...).then(...) promise directly or add a reject callback and call it from .catch (and propagate the original error).
                return new Promise((resolve) => {
                    sogParser(dataSOG, rootUrl, scene)
                        // eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then
                        .then((parsedSOG) => {
                            makeGSFromParsedSOG(parsedSOG);
                            resolve(babylonMeshesArray);
                        })
                        // eslint-disable-next-line github/no-then
                        .catch(() => {
                            throw new Error("Failed to parse SOG data.");
                        });
                });

Comment thread packages/dev/loaders/src/SPLAT/sog.ts
Comment thread packages/dev/loaders/src/SPLAT/sog.ts
Comment thread packages/dev/loaders/src/SPLAT/splatFileLoader.ts Outdated
Comment thread packages/dev/core/src/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.ts Outdated
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 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

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 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 21, 2026

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

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

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

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18475/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/18475/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18475/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18475/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18475/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/18475/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 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 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

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented May 21, 2026

⚡ Performance Test Results

🟢 All performance tests passed — no regressions detected.

@RaananW RaananW merged commit 0a9bf67 into BabylonJS:master May 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants