Skip to content

glTF reader and importer

Adrien Boucaud requested to merge adrien.boucaud/vtk:vtkGLTF into master

This branch adds a reader and an importer for the glTF format, as well as utility for these classes.

Both the reader and importer support:

  • .gltf (glTF), .glb (binary glTF), and inlined .gltf (with base64 encoding for buffers and images) files.
  • All types of geometry and draw modes.
  • All standard attributes are loaded (including 2 texture coordinates, 4 sets of joints/weights).
  • Non-standard attributes are also loaded and included in the geometry.
  • Node transformations.

Reader:

  • Supports skinning, morphing, animations.
  • Materials, cameras are not supported as they don't make sense for vtk readers.

Note: Transformations, skinning and morphing in gltf are intended to be done in a shader. However, the vtkGLTFReader applies those deformations directly to the output geometry, using CPU calculations.

An option is available to disable those deformations, in which case the information required for animations, skinning and morphing will be included in the reader's output in vtkFieldData arrays.

In the future, materials and GPU transforms/skinning/morphing would be supported thanks to a custom mapper that would apply animations, skins, morphing and materials in shaders.

Importer:

  • Node transformations are applied directly to the corresponding vtkActor, not to the geometry.
  • Texture filtering and wrapping options are adapted to vtkTexture's functionality.
  • Skinning, Morphing, and Animations are not supported by the importer.
  • Cameras are supported.
  • Partial material support (textures, baseColorFactor).

Note: PBR features such as Metallic-roughness values, normal maps, emissive maps are not supported yet.

Edited by Adrien Boucaud

Merge request reports