`ModelExperimental` - Default material
See original GitHub issueAccording to the glTF spec,
If material is
undefined
, then a default material MUST be used.
The “default material” is described here: https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#default-material
This should be easy to handle, there’s a couple things to check:
- Ensure that the
MaterialPipelineStage
doesn’t throw an error ifprimitive.material
is undefined. A no-op is probably okay - Ensure that the shader defaults match what is described in the spec
- find a model to test with
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
ModelExperimental - Cesium Documentation
Name, Type, Default, Description ... When true, back face culling is determined by the material's doubleSided property; when false, back face culling is ......
Read more >CustomShader - Cesium Documentation - Mars3D
A user defined GLSL shader used with ModelExperimental as well as Cesium3DTileset . ... If present, this overrides the default lighting for the...
Read more >CustomShader - Cesium Documentation
Name Type Default
mode CustomShaderMode CustomShaderMode.MODIFY_MATERIAL
lightingModel LightingModel
isTranslucent Boolean false
Read more >Changing all "In Model" materials to "default" material? - Reddit
I was wondering if anyone could help me with figuring this one out... I'm working with a large model (About 138 mb) of...
Read more >cesium/CHANGES.md - UNPKG
enableModelExperimental` so tilesets with `Model` and `ModelExperimental` can be ... This ensures Cesium rendering is fast and smooth by default across all ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh @jjhembd here’s A modified Sandcastle example that sets up the default material. Basically I (ab)used a
CustomShader
’sREPLACE_MATERIAL
mode so the material is set to the default rather than what was in the glTF.The relevant code is this part
EDIT: Also note that the lighting looks weird for the default material since the normal is set to a constant +z direction. This was mainly because we haven’t implemented #6506
Hi @jjhembd,
At this point I think it’s really just
ModelExperimentalFS.glsl
that needs to be updated since that’s hard-coding defaults in the shader.As far as the
ModelComponents.Material()
goes, I think we covered all the main cases in the above discussion, but I guess it doesn’t hurt to do a search through the code forModelComponents.Material
ModelComponents.MetallicRoughness
andModelComponents.SpecularGlossiness
to double check nothing is hard-coding an unexpected default.That’s a good question…
.pnts
not technically a glTF file in the first place (unlike .b3dm and .i3dm which wrap a.glb
file). So I don’t think this particular case has a correct answer, it’s more about what we think looks good as a default. Might be good to compareModel
vsModelExperimental
rendering the same.pnts
model and try to make them match.