GLTFLoader: multipass cache getting before adding

Description of the problem

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:

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 ];

Three.js version
  • 0.102.1
  • Chrome
  • Firefox
  • Internet Explorer (cannot load Promise)
  • Windows
Hardware Requirements (graphics card, VR Device, …)
  • GeForce GTX 1050

Author: Fantashit

2 thoughts on “GLTFLoader: multipass cache getting before adding

  1. OK, nice! I don’t have errors anymore (even if I can’t see my model 🙁 )
    I think you can close this issue.

  2. 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.

Comments are closed.