Babylon.js icon indicating copy to clipboard operation
Babylon.js copied to clipboard

Add MSFT_screencoverage support for MSFT_lod

Open miudit opened this issue 6 months ago • 6 comments

This PR introduces MSFT_screencoverage support to MSFT_lod extension, enabling LOD switching based on screen coverage.

A previous implementation of screen coverage based LOD was submitted in https://github.com/BabylonJS/Babylon.js/pull/10509 but reverted in https://github.com/BabylonJS/Babylon.js/pull/11840 due to its reliance on a very specific model structure. This update removes the structural constraints and broadens support for arbitrary glTF models.

miudit avatar Jun 09 '25 16:06 miudit

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 avatar Jun 09 '25 16:06 bjsplat

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

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

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

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

Links to test babylon tools with this snapshot:

https://playground.babylonjs.com/?snapshot=refs/pull/16736/merge https://sandbox.babylonjs.com/?snapshot=refs/pull/16736/merge https://gui.babylonjs.com/?snapshot=refs/pull/16736/merge https://nme.babylonjs.com/?snapshot=refs/pull/16736/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/16736/merge#BCU1XR#0

bjsplat avatar Jun 09 '25 16:06 bjsplat

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html

bjsplat avatar Jun 09 '25 16:06 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Jun 09 '25 17:06 bjsplat

Hi @bghgary, thank you for the feedback. Could you please clarify what specific cases need to be covered to fully address the issue noted in #11840? I’d like to confirm this to determine if it’s feasible for me to implement.

Regarding the intended use, I’m working on rendering several high-poly meshes at once within a large scene in my project, and I want to improve rendering performance.

miudit avatar Jun 10 '25 00:06 miudit

Hi @bghgary, thank you for the feedback. Could you please clarify what specific cases need to be covered to fully address the issue noted in #11840? I’d like to confirm this to determine if it’s feasible for me to implement.

MSFT_lod operates on a node of a scene hierarchy as opposed to on a single mesh. The glTF can have a completely different node hierarchy per LOD. For example, the high LOD of one hierarchy may have 10 nodes with 3 meshes but the low LOD may have only 2 nodes with 1 mesh.

bghgary avatar Jun 10 '25 19:06 bghgary

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html

bjsplat avatar Jun 20 '25 12:06 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Jun 20 '25 12:06 bjsplat

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 avatar Jun 21 '25 15:06 bjsplat

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

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

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

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

Links to test babylon tools with this snapshot:

https://playground.babylonjs.com/?snapshot=refs/pull/16736/merge https://sandbox.babylonjs.com/?snapshot=refs/pull/16736/merge https://gui.babylonjs.com/?snapshot=refs/pull/16736/merge https://nme.babylonjs.com/?snapshot=refs/pull/16736/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/16736/merge#BCU1XR#0

bjsplat avatar Jun 21 '25 15:06 bjsplat

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html

bjsplat avatar Jun 21 '25 16:06 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Jun 21 '25 16:06 bjsplat

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html

bjsplat avatar Jun 23 '25 02:06 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Jun 23 '25 02:06 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Jun 23 '25 09:06 bjsplat

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html

bjsplat avatar Jun 23 '25 09:06 bjsplat

@bghgary I’ve pushed an update that addresses the issue and added a visualization test that covers cases where each LOD has a different hierarchy (Playground id: #ZSTNSI#3). Please let me know if anything else looks off.

miudit avatar Jun 24 '25 04:06 miudit

WebGL2 visualization test reporter:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html

bjsplat avatar Jun 24 '25 04:06 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Jun 24 '25 05:06 bjsplat

Visualization tests for WebGPU

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html

bjsplat avatar Jun 24 '25 20:06 bjsplat

@bghgary I’ve pushed an update that addresses the issue and added a visualization test that covers cases where each LOD has a different hierarchy (Playground id: #ZSTNSI#3). Please let me know if anything else looks off.

Thanks for the updates. It seems you are making changes to the core scene rendering code. It would be good to get input from @sebavan @deltakosh @Popov72 to review the approach.

bghgary avatar Jun 26 '25 18:06 bghgary

Any news @miudit ?

deltakosh avatar Jul 15 '25 15:07 deltakosh

Closing for now. Feel free to reopen

deltakosh avatar Aug 04 '25 23:08 deltakosh