Hedgehog Engine 2 - Physically Based Rendering (PBR)
Physically based rendering is used in HE2 games and mostly associated with "PRM" textures. By combining several textures of various properties, you can create a wide range of materials to render physically accurate looking surfaces.
Components
Albedo
Albedo is the base color of a surface and is used with “diffuse” lighting.

Smoothness
Smoothness determines how reflective a surface is. The lower the smoothness, the blurrier the reflection. This is represented by a value between 0 and 1.

Specular
Seperately from diffuse lighting, specular lighting controls the visibility of specular lighting and reflections. You can imagine it as a “layer” on top of the diffuse lighting, with the specularity acting as the “layer transparency”. Hedgehog Engine 2 specifically makes use of “F0 reflectance”.
It’s represented by a value between 0 and 1; Usually a specular value of 0.125 is considered the “default”.

PBRFactor
shader parameter, the specular value is used as is.
In PRM textures however, it is divided by 4. Thus, the highest specular value achievable with a standard image format is 0.25.
This can be circumvented by using using an HDR image format such asR16G16B16A16_FLOAT.
Metallic
Metallic is similar to specular, with the 2 differences:
- The albedo color affects the color of reflection
- A more linear value progression
Similarly to specular, it also can be seen as a seperate “layer” that is placed above the specular lighting.
It too is represented by a value between 0 and 1. Usually a metallic value of 0 is considered the “default”.

Combining Specular and Metallic
While rarely done, it is possible to use specular and metallic lighting together.

Emission
Emission is essentially the colored “glow” of the surface, like the light coming from a lamp. This is unaffected by any lighting that may hit the surface.

Unlike the other surface values, emission supports high-dynamic-range images, and can use values beyond the 0-1 range, which the rendering engine may process in various ways.
Additionally, emission is often accompanied by a “Luminance” parameter that changes how bright the emission texture appears.

Ambient Occlusion / Cavity
Ambient occlusion (often abbrivated with “AO” or “A/O”) is, as the name implies, responsible for occluding/removing ambient lighting. There are several types of ambient lighting, but this part solely focusses on the material surface AO, sometimes also referred to as "Cavity".
In Hedgehog Engine 2 games, ambient lighting consists of
- Global illumination (GI)
- Environment reflections (“Image based lighting”; IBL)
- Screen space reflections (SSR)
Ambient occlusion too is represented by a value between 0 and 1. However, unlike the other values, where a higher greater value “increases” the effect, here a lower value increases the occlusion of ambient lighting.
Thus the default value, at which no ambient light is occluded, is 1.
