<guide type="general" title="Physically Based Rendering">

<step title="What is PBR?">

<p>The idea behind Physically Based Rendering (PBR) is to use realistic shading/lighting models to accurately represent real world materials. To do so, PBR maps store information about how a real world surface reacts to the laws of of physics, in particular its interaction with light. Being a close approximation to the laws of physics, PBR is as realistic as possible.</p>

<p>Besides its realism, PBR has another great advantage over previous 3D workflows: it is consistent under different lighting, which permits reuse across different scenes and lighting conditions, something that was not previously possible.</p>

<p>To see how each map contributes to PBR, click the New Maps button located above the Editor area.</p>

<p>In the New Maps window that appears, click Select All, so that all maps will be created. Actually for PBR we'll only need Base Color, Metallic and Roughness, but no harm in also creating the other maps.</p>

<p>Let's choose a preset that defines the initial map values: from the Presets... drop menu at the top-right, select the Gold preset, near the top of the list.</p>

<p>Click Create and a physically accurate Gold material is created. Rotate the model in the 3D Preview to see how it reflects the environment.</p>

</step>


<step title="Diffusion and Reflection">
<cmd ed="color" type="activate"/>

<p>In physical reality, the light hitting a surface splits in two parts:</p>

<ul>
<li>Reflection: part of the incoming light is reflected out of the surface, bouncing off like a ball hitting a wall. Reflection is what gives surfaces their shininess or specularity. For example, a mirror is an extreme case of reflection: all light is reflected.</li>
<li>Diffusion: another part of the incoming light is absorbed and scattered in the surface, with some later escaping out. This escaped light is what gives surfaces their color.</li>
</ul>

<p>Because PBR models the behavior of real light, the energy that enters an object must be the same as the sum of Reflection and Diffusion parts, so that total energy is conserved, or the laws of physics would be violated. Because of this, surfaces with high reflection will not usually have a strong color (like the mirror). On the other hand, a bright colored surface cannot be much reflective.</p>

<p>By the way, an idea related to Reflection is the Fresnel effect: a surface reflects more when you look at it in a low angle (grazing) than when looking directly at it (at a 90 degrees angle). You can verify this in many real world surfaces: when seen from a low angle they become more reflective, some almost mirror-like. Fresnel is automatically handled by PBR, so as to keep things as realistic as possible.</p>

<p>In the PBR Metallic-Roughness Workflow that we use, the Base Color map defines both the reflected and the diffused light that comes out of the surface. The gold preset we chose set this map with a yellow color, but what does it mean? Check the next step to see how it works.</p>

</step>



<step title="Metals and Dielectrics">

<cmd ed="metal" type="activate"/>
<cmd tool="paint" type="activate"/>

<p>Metallic areas of a surface are usually more reflective than non-metallic areas. We'll call these non-metallic areas dielectrics. This useful property is the base of the Metallic-Roughness Workflow, the most widely used PBR model.</p>

<p>If we can specify which parts of a surface behave as a metal or as a dielectric, we can then use a Base Color map to specify:</p>
<ul>
<li>Reflection tint for metallic areas: for example the yellow tint of gold.</li>
<li>Diffuse color for dielectric areas: for example the red in an apple.</li>
</ul>

<p>And this is what we use a Metallic map for: metallic pixels are marked with the value 1 (white), dielectric with value 0 (black). In this way, PBR knows if those pixels should be treated as metallic and tint the light's reflection, or as dielectric thus coloring their diffused light.</p>

<p>Mostly, only 1 and 0 values are used, because a pixel can either be metallic or dielectric. In practice other values can be used to create surfaces like rust or a thin dirt layer.</p>

<p>To see this in action, select the Paint Tool at the right. Choose its Paint operation and set the Metallicness slider to 0 (meaning dielectric) and the Hardness to 100% (no brush smoothness, to avoid blurred middle values). Apply some strokes at the bottom of the Metallic map by clicking in the Editor with the left mouse button and dragging.</p>

<p>You'll notice that the mirror-like characteristics of gold are gone and the painted area behaves more like plastic: more light is now being diffused and hence the strong color, and little light is being reflected so you can no longer see the environment reflection.</p>


</step>




<step title="Microsurface">

<cmd ed="rough" type="activate"/>
<cmd tool="adjust" type="activate"/>

<p>Also very important to model realistic surfaces is their behavior at very small scale, which strongly affects light reflection and diffusion. Roughness, tiny imperfections and cracks in a surface naturally have a strong effect in incoming light.</p>

<p>If a surface is smooth, incoming light rays are reflected in parallel with each other, the same way as a mirror reflects in a coherent way. But if a surface is rough, the rays will be reflected in a chaotic manner and the visible result will be a blurred reflection, because light rays will bounce in random directions, rarely parallel to each other.</p>

<p>To model this microsurface behavior, we use the Roughness map: pixels with value 1 (white) are rough, with value 0 (black) are smooth.</p>

<p>Let's see this in action: open the Adjust tool and slowly increase the Intensity slider to the right, while giving attention to the reflections in the model at the 3D Preview. Reflections become blurred as we increase surface roughness. At the same time, the area we painted as dielectric doesn't change much: being a dielectric, it doesn't directly reflect much light.</p>

<p>Play a bit with the Intensity slider and rotate the 3D model. Because of energy conservation you'll notice that rougher surfaces (roughness near 1 or white) reflect light with larger but dimmer highlights, as light bounces in all directions, while smooth surfaces (roughness near 0 or black) have smaller and sharper highlights, since light bounces in a more coherent way.</p>

<p>Before we continue, please set the intensity slider back to 0%. An easy way to do this is by clicking the "Intensity" label, which resets the setting.</p>

</step>




<step title="Color and Tint">

<cmd ed="color" type="activate"/>
<cmd tool="paint" type="activate"/>

<p>Back into the Base Color editor, let's see how its color information is used by Metallic or Dielectric pixels that we set before in the Metallic map. Remember that the Metallic map defines how the Base Color pixels are used: either to tint metallic reflections or to define dielectric diffuse colors.</p>

<p>Select the Paint tool and choose its Paint operation. In the Color picker choose a bright whitish blue. Now paint a few vertical strokes, top to bottom.</p>

<p>Rotate the model in the 3D Preview, to see how it reflects the environment.</p>

<ul>
<li>In the strokes painted at the top, where the pixels were set to Metallic in the Metallic map, the blue is just tinting the environment reflection.</li>
<li>But strokes at the bottom, painted over the painted dielectric appear instead like a solid color with little reflection.</li>
</ul>

<p>To fully respect technical PBR restrictions, there are a few rules that we should to take care. For example, metallic areas should always have bright color values due to their high reflectance, while dielectric areas should avoid being too bright. The PBR Validate setting is available at the bottom of both the Base Color and Metallic editors, which displays a red-green overlay for invalid-valid values, to help identify any issues. To learn more about this, see the PBR Validate guide.</p>


<br/>

<p>
You may want to see the following video tutorial about PBR validation:
</p>

<p>
<a href="https://www.pixplant.com/support.php#pbrvalidation">PBR Validation</a>
</p>





</step>




</guide>