GLFTImporter example added to VTKExamples


I’ve added a new example, GLFTImporter to the VTK Examples Project. glTF (derivative short form of GL Transmission Format) is a file format for 3D scenes and models using the JSON standard.

There are a few issues with this importer.

  1. Images are dark. There is no light extension loaded
  2. If run from the command line, the gltf filename must be a full path. Otherwise the .bin file is not found. I’m working on an MR for this.
  3. Some error and warning messages do not include the bad filename.

I’ve attached a few results.


Thanks @lorensen !

Can you share your MR ?

@Adrien_Boucaud @Michael

@lorensen thank you for doing this !

However, I do not seem to have any issues using relative file paths. Could you provide more information on how to reproduce this bug ?

Thank you @lorensen !
Indeed the images are dark but you can improve this using an environment lighting.
You can make any skybox contribute to lighting and this brings awesome reflections with glossy materials.
Have a look at this test.
You can also use projected texture for the environment (that you can download here for example). See here for the test.

This problem exists for .gltf files that reference .bin file. .glb files are fine. The tests use .glb files or .gltf file that do not reference .bin files.

Can you share a command line that works for you and verify that you are using .gltf files that reference a .bin file?


Well, using the example code and the FlightHelmet model:

./import FlighHelmet.gltf

Works perfectly.

Are you building with VTK master ?

That is not a relative path. Move away from the directory that contans FlightHelmet and use … relative path.

Yes, I use the master.

Here is what fails for me using the GLTFImporter example:

cd VTKExampes/build
./bin/GLTFImporter …/src/Testing/Data/glTF/FlightHelmet/gltf/FlightHelmet.gltf

fails to find the .bin file, while

cd VTKExamples
./build/bin/GLTFImporter src/Testing/Data/glTF/FlightHelmet/glTF/FlightHelmet.gltf


Try a similar experiment with your example.


After trying your example, there is definitely an issue. I misunderstood what you meant.

I pushed a fix for it at

Thank you for spotting this !