Skip to content

Handle anisotropy in the PBR shader

Paul Lafoix requested to merge paul.lafoix/vtk:AnisotropyPBR into master

Add two options to vtkProperty, and link them to OSPray:

  • anisotropy (between 0 and 1) that controls the strength of the anisotropy.

  • anisotropyRotation (between 0 and 1) that rotate the direction of the anisotropy (ie. the tangent) around the normal counter-clockwise. A value of 1.0 correspond to a rotation of 2*PI. If needed, the rotation is done is the fragment shader (in order to use a texture to hold the anisotropy rotation).

anisotropy

Spheres with anisotropy values from 0 (left) to 1 (right).

anisotropyRotation

Spheres with anisotropy set to 1.0 and anisotropy rotation from 0 (left) to 0.5 (right)

You can pass both anisotropy strength and anisotropy rotation in a texture. The Red channel corresponds to the anisotropy strength and the Green channel corresponds to the anisotropy rotation.

anisotropy

Example with a textured anisotropy angle.

Edited by Paul Lafoix

Merge request reports