Handle anisotropy in the PBR shader
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).
Spheres with anisotropy values from 0 (left) to 1 (right).
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.
Example with a textured anisotropy angle.