PBR Journey Part 2 : Anisotropy model with VTK

February 1, 2021
Figure 1. Cube rendered with VTK 9.0 using the PBR shader and Image Based Lighting with a HDR environment. The cube is textured using an anisotropic texture holding the strength of the anisotropy in the red channel and the rotation of the anisotropy direction in the green channel.


In our previous post on the new features of the PBR shading in VTK 9.0, we introduced the HDR environment and how to use it to enhance the realism of the rendering in VTK.

We are happy to announce that the PBR shader now supports rendering of anisotropic materials like brushed metals or compact disks. Anisotropic materials have different reflecting properties that depend on the direction of the anisotropy, which is defined by the tangent of the geometry and its rotation. The more anisotropic a material is, the more its lighting is influenced by its direction. Thus, it is necessary to have normals and tangents in order to have an anisotropic material.


This model adds two parameters to vtkProperty that can be used by the vtkPolyDataMapper to configure the anisotropy :

  • Anisotropy: The strength of the anisotropy (between 0.0 and 1.0). 0.0 means an isotropic material, 1.0 means a fully anisotropic material.
Figure 2. Spheres rendered with VTK 9.0 with anisotropy value from 0.0 (left) to 1.0 (right).
  • AnisotropyRotation: Rotates the direction of the anisotropy (ie. the tangent) around the normal counter-clockwise (between 0.0 and 1.0). A value of 1.0 corresponds to a rotation of 2 * PI.
Figure 3. Spheres rendered with VTK 9.0 with anisotropy set to 1.0 and anisotropy rotation from 0.0 (left) to 0.5 (right).

It is possible to define the anisotropy strength as well as the anisotropy rotation in a texture to create more complex materials. The red channel holds the anisotropy strength and the green channel holds the anisotropy rotation. The blue channel is discarded. One can add this anisotropy texture to the data by using vtkProperty::SetAnisotropyTexture(texture). We provide the anisotropy texture used to render the cube in figure 1 in the figure below.

Figure 4. Anisotropy texture used for the cube in figure 1. Red channel holds the anisotropy strength and green channel holds the anisotropy rotation. Blue channel is discarded.


In the example below, we render the same cube as depicted in figure 1, using the anisotropy texture in figure 4.

vtkNew<vtkCubeSource> cube;
vtkNew<vtkTriangleFilter> triangulation;

// Compute the data tangents needed for anisotropy
vtkNew<vtkPolyDataTangents> tangents;

vtkNew<vtkPolyDataMapper> mapper;

// Load the anisotropy texture
vtkNew<vtkPNGReader> anisotropyTexReader;
vtkNew<vtkTexture> anisotropyTex;

// Load the normal texture
vtkNew<vtkPNGReader> normalTexReader;
vtkNew<vtkTexture> normalTex;

// Create the actor
vtkNew<vtkActor> actor;
actor->SetMapper(mapper); actor->GetProperty()->SetInterpolationToPBR();

// Set anisotropy and anisotropyRotation
// to 1.0 as they act as multipliers with texture value

// Set the normal and anisotropy texture

// Finally, add the actor to the renderer

What’s next

Anisotropy model will be available in ParaView 5.10 and in nightly builds.

In the upcoming part III of our PBR journey we will introduce a clear coat model that simulates an isotropic layer on top of the object. Stay tuned !


This work is funded by an internal innovative effort of Kitware Europe.

Leave a Reply