Add MSFT_screencoverage support for MSFT_lod
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.
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.
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
WebGL2 visualization test reporter:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html
Visualization tests for WebGPU
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html
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.
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.
WebGL2 visualization test reporter:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html
Visualization tests for WebGPU
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html
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.
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
WebGL2 visualization test reporter:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html
Visualization tests for WebGPU
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html
WebGL2 visualization test reporter:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html
Visualization tests for WebGPU
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html
Visualization tests for WebGPU
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html
WebGL2 visualization test reporter:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html
@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.
WebGL2 visualization test reporter:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgl2playwright/index.html
Visualization tests for WebGPU
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html
Visualization tests for WebGPU
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16736/merge/testResults/webgpuplaywright/index.html
@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.
Any news @miudit ?
Closing for now. Feel free to reopen