-
Notifications
You must be signed in to change notification settings - Fork 3.6k
gltfLoader: fully respect the skipMaterials flag #17199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
gltfLoader: fully respect the skipMaterials flag #17199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Maybe we can add a unit test for this case? Not sure it'll be worth it. |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17199/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/17199/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/17199/merge#BCU1XR#0 |
Devhost visualization test reporter: |
WebGL2 visualization test reporter: |
Visualization tests for WebGPU |
Not quite ready to merge, some discussion still under way. |
There were two issues with
skipMaterials
:skipMaterials
is on, no material is loaded (correct behavior). If a mesh in the glTF has no material assigned andskipMaterials
is on, the flag is ignored and a default material is still created and assigned.PBRMaterial
orOpenPBRMaterial
are dynamically loaded, depending onuseOpenPBR
flag. However, ifskipMaterials
is on, then we won't be loading any materials anyway, so we should skip this dynamic import.After these changes, I could see with some testing that when using
skipMaterials
(with either a glb with materials and material references and without), PBRMaterial was neither instantiated nor imported (statically or dynamically).