While loading a GLTF file using GLTFLoader, I noticed that loadGeometries
was trying to get from multiPassGeometryCache
before adding geometries to it. So it doesn't load them.
Here is a fiddle with logs illustrating the problem:
https://codesandbox.io/s/528q8o140p
I also noticed that cached
was accessed when not null
but is sometimes undefined
.
I precognize to test it with:
if ( geometry ) return [ geometry ];
instead of:
if ( geometry !== null ) return [ geometry ];
Promise
)Could you test this case on the “dev” branch? This multipass logic has been removed.
OK, nice! I don't have errors anymore (even if I can't see my model :( )
I think you can close this issue.
Don't forget you'll need at least one light. Add scene.add(new THREE.PointLight());
and you should see something.
Here's your project with a light in the scene:
https://codesandbox.io/s/924r9qq56r
Great! Why couldn't it display as flat solids?
Why couldn't it display as flat solids?
By default glTF uses physically-based (PBR) materials. These require at least an ambient light. It is possible to create an unlit material too (e.g. THREE.MeshBasicMaterial) that doesn't respond to or require light.
Most helpful comment
By default glTF uses physically-based (PBR) materials. These require at least an ambient light. It is possible to create an unlit material too (e.g. THREE.MeshBasicMaterial) that doesn't respond to or require light.