-
Paul Lafoix authored
Update PBR shader in vtkOpenGLPolyDataMapperNode to simulate a clear coat layer (upside layer on the material). This layer is supposed dielectric and with low roughness, so it adds only a specular lobe to the previous diffuse and specular parts of the base material. The specular BRDF model of the coat layer is a Cook-Torrance specular microfacet model, with a GGX normal distribution function, a Smith visibility function, and a Schlick Fresnel function. Notice that it uses the exact same specular microfacet model as the base layer specular BRDF. It adds multiples parameters to vtkProperty : * CoatStrength : [0-1], default to 0.0. Control the strength (0 means no layer) * CoatRoughness : [0-1], default to 0.0. 0 means smooth layer (high specular reflection) * CoatIOR : [0-4], default to 2.0. Define the material IOR of the layer. * CoatColor : Default to white. * CoatNormalScale : Scale the normal map (if present). Default is 1.0 * BaseIOR : the base material index of refraction, default to 1.5. When we add a coat layer, we need to recalculate the reflectance of the interface between the base material and the exterior, as the new exterior is now the coat layer. The precomputation of the reflecance is done in vtkOpenGLPolyDataMapperNode. It is possible to define a normal map for the coat layer. If not presents, we assume the layer has the same normal map as the base material.
5a481068