... | ... | @@ -54,12 +54,12 @@ The typical workflow in the editor is to modify the model in order to make it co |
|
|
|
|
|
The visual properties of a Nomad 3D model are stored as [Phong materials](https://en.wikipedia.org/wiki/Phong_shading), one for each component. However the viewer uses [Physically based Rendering (PBR)](https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/) to get a more realistic result. The conversion between the two illumination models is not usual so a simple and arbitrary conversion is applied :
|
|
|
|
|
|
```math
|
|
|
pbr.color = phong.diffuse
|
|
|
pbr.metalness = cap(length(phong.specular), 0, 1)
|
|
|
pbr.roughness = 1 - cap(phong.shininess / maxShininess, 0, 1)
|
|
|
```
|
|
|
$`pbr.color = phong.diffuse `$
|
|
|
|
|
|
where `maxShininess = 250`.
|
|
|
$`pbr.metalness = cap \left( ||phong.specular||, 0, 1 \right) `$
|
|
|
|
|
|
$`pbr.roughness = 1 - cap \left( \frac{phong.shininess}{maxShininess}, 0, 1 \right) `$
|
|
|
|
|
|
where $`maxShininess = 250`$.
|
|
|
|
|
|
The Phong diffuse color defines the base color of the object. The specular color (which is usually a shade of gray) defines the metalness of the object : white for metallic components, black for non-metal ones. The shininess defines the roughness of the object : the more it is shiny the less it is rough (with an arbitrary maximum shininess). |