Can't import .glb/.gltf into Playground (from external sources like Github)

Pardon the noob question, I’m new to Babylon.js, how do I import a .glb or .gltf file from external sources? As the above screenshot, it’s not showing up in Playground. What did I do wrong, and how do I import .glb/.gltf files? Thanks

Try https://raw.githubusercontent.com/~~~

see https://doc.babylonjs.com/toolsAndResources/thePlayground/externalPGAssets#using-rawgithubusercontentcom

This will load the file correctly:

Babylon.js Playground - #QXWQ99#1

This uses Babylon.ImportMeshAsync instead of the deprecated SceneLoader. Hope it helps!

While the mesh shows, why no vertex color? Why doesn’t Babylon.js upload the default materials/textures along with the mesh when uploading?

Thanks, this definitely helps. That said, is there any way to upload the mesh together with its textures/materials/vertex colors without keying in other code?

Are you doing any extra steps? When I run the playground above it loads with materials. Maybe open the dev console by pressing f12 and see if there’s any errors.

You have removed the light from the playground scene

var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);

light.intensity = 0.7;

Thanks, on second thought, I just left in the light code, as @fuyutami mentioned, and it works

Thanks, your answer worked

Glad it helped! Welcome to the community :slight_smile: