Skip to content

Add vtkGLTFMapper

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

This adds vtkGLTFMapper, along with some vtkGLTFReader fixes to support it.

vtkGLTFMapper is a mapper for the rendering of glTF 2.0 datasets. It enables glTF 2.0 features that can not be exploited with standard mappers, such as:

  • Animated scene graph on the GPU
  • Animated model Skinning on the GPU
  • Animated model Morphing on the GPU
  • Automatic glTF 2.0 material application

How it works:

The vtkGLTFReader filter uses field data to save skinning, morphing and material information to its output dataset. vtkGLTFMapper will look for this field data in its input dataset, and render the models accordingly.

How to use:

  • Use vtkGLTFReader to read from a glTF 2.0 file.
  • Use vtkGLTFReader::GetGLTFTexture() to create the vtkTexture objects from the glTF model's images.
  • Pass these textures to this mapper, using vtkGLTFMapper::SetTextures(). It is important that the order of textures is identical to the order from vtkGLTFReader.
  • Use this mapper to render the reader's output dataset

Example animated glTF 2.0 model rendered in VTK with skinning, morphing and various materials:

drone

This merge request also fixes a bug with tangents not always being generated properly.

Edited by Adrien Boucaud

Merge request reports