Instantiating a SceneObject from GltfAsset using tryInstantiate()
Harrison Shapley
Posts: 8
The documentation for tryInstantiate is quite lacking: https://docs.snap.com/api/lens-studio/Classes/Assets/#GltfAsset
What is the purpose of the material parameter? I'd like to just instantiate the model as-is, without overriding any material.
0
Best Answer
-
The gltf asset doesn't have the full shader code for a material inside of it,
instead it has the textures and the material parameters stored with their respective names (like 'baseTex', 'baseColor', 'materialParamsTex', etc).A standard PBR material in Lens Studio should catch these parameters and render the object correctly!
1
Answers
-
Thanks so much Max! I used the "GLTF" material and it worked perfectly.
0 -
@Harrison Shapley , @Max I'm struggling with this as well. Any insights you can share to the solution here?
0