Physically-based Rendering
Physically Based Rendering is a set of rendering techniques which simulate how light and surface materials interact in the natural world. The goal is to create images which are more realistic than traditional shading approaches. PBR relies on lighting - either from your scene, an environment map, or other sources. Visualize uses a preset environment map for rendering.
Since no two real-world materials are exactly alike, a segment with PBR attributes will allow you to set values for certain characteristics of the model’s materials in order to best simulate reality. To this end, HOOPS Visualize allows you to control the following properties:
base color
metalness
roughness
alpha
emission
normals
occlusion
In Visualize, PBR materials are distinct from conventional materials you would apply to a model using a HPS::MaterialKit
. PBR materials are set on the segment using a HPS::PBRMaterialKit
, and they inherit just like any other attribute.
HPS::PBRMaterialKit pbrKit;
pbrKit.SetBaseColorFactor(HPS::RGBAColor(1, 0.65f, 0, 1));
pbrKit.SetRoughnessFactor(0.5f);
pbrKit.SetMetalnessFactor(0.75f);
mySegmentKey.SetPBRMaterial(pbrKit);
PBRMaterialKit pbrKit = new PBRMaterialKit();
pbrKit.SetBaseColorFactor(new RGBAColor(1, 0.65f, 0, 1));
pbrKit.SetRoughnessFactor(0.5f);
pbrKit.SetMetalnessFactor(0.75f);
mySegmentKey.SetPBRMaterial(pbrKit);
PBR materials can be used with any model that can be loaded by Visualize. Additionally, Visualize’s native HSF file format will save out PBR data if it is present.
If you have access to HOOPS Exchange, GLTF files can be loaded using the Exchange importer.
PBR Base Properties
The main properties of PBR materials used in Visualize are base color, metalness, and roughness. These can be a general color or factor, and can also be specified with a texture map. Using these three properties you can better simulate plastics, metal, rubber, matte surfaces, and other materials. To truly produce realistic looking models you will need to use maps for the different channels available.
The metalness range runs from 0 (absolutely non-metal) to 1.0 (purely metallic). In reality there are very few materials which are purely 0 or 1.
Metalness
Roughness represents the glossiness or roughness of a model. A value of 1 represents a very rough object which will have little glossiness, while a value of 0 will represent a very shiny smooth object.
Roughness
See the image below for how metalness and roughness affect the rendering of the object. In the image, metalness ranges from 0 to 1 on the X-axis, and roughness ranges from 0 to 1 on the Y-axis.
Metalness and roughness
PBR Channels and Textures
In addition to these base properties you can add normal maps, emissive maps, and occlusion maps. All of these combine and interact with your scene’s lighting and environment.
To maximize PBR’s capabilities, you will want to use textures for mapping onto different properties. These include alpha, base color, emissive, metalness, normal, occlusion, and roughness. Using a map allows you to specify what values are represented on different areas of a model or shell.
Model with base color, metalness, normal, and emissive channels turned off
The base color map determines how material colors are applied on the surface. This is very similar to textures used for diffuse colors in non-PBR mode.
The model with only the base color map applied
The model with all channels on except base color map
A normal map is used to change how light reflects off a surface. Rather than representing holes with tessellated geometry a normal map can cause the shell to appear to have holes (from the way the light bounces off the model). It is also used to strongly define edges.
The model with only the normal mapping turned on
The model with all channels on except the normal map
Emissive maps are used to define parts of a shell that give off light. This will be used in the PBR calculations. They can also act as color channels (eg: they aren’t just used for emitting light). Note that if the base color map is unset and there is no base color factor the emissive map will have no effect.
The model with all channels on except the normal map
The model with all channels on except the emissive maps
PBR Highlighting
When using a model with PBR attributes, traditional highlighting doesn’t always make sense. This is because traditional highlighting replaces the geometry color with a flat filled color. With a PBR model, that would degrade the data, since bump maps, texturing, etc. would no longer be visible. Thus, Visualize will automatically use “tinting” in place of traditional highlighting whenever the segment has an associated HPS::PBRMaterialKit
. The highlight style itself is enabled the same way as traditional highlighting, and the face color will be used as the tinting color.
A normal wheel (top) and a wheel tinted with a PBR highlight (bottom)