Physically Based Rendering Model
Trial provides a standard renderer that implements a Physically Based Rendering shading model and associated material. To use it, simply enter a pbr-render-pass
and ensure your objects provide a pbr-material
, or some appropriate conversion exists.
The model uses a Cook-Torrance BRDF to implement the shading behaviour, and it is recommended to use it in combination with an HDR pipeline.
Material Properties
Each material has the following properties:
Albedo
This is put together through thealbedo-texture
and thealbedo-factor
, both of which are 4-component. The alpha component allows you to make semi-transparent materials.Metalness, Roughness, Ambient Occlusion
This is put together through themetal-rough-occlusion-texture
and themetalness-factor
,roughness-factor
andocclusion-factor
. You may also specify the textures individually through themetal-rough-texture
ormetalness-texture
,roughness-texture
, andocclusion-texture
. If you specify them individually, they will be merged manually before upload, which may be expensive.Emission
Theemission-texture
andemission-factor
allow you to create materials that appear to emit light. In practise this will just cause the material to be very bright, causing bloom to take hold. This only works in combination with an HDR pipeline.Normal
Thenormal-texture
provides the standard normal mapping behaviour.Alpha-Cutoff
Thealpha-cutoff
designates a threshold below which the material is considered fully transparent.
Image Based Lighting
The PBR renderer supports an image based lighting workflow. For this purpose it provides a special light type, the environment-light
. The light requires an environment-map
instance as the :asset
initarg, which it uses to get the needed irradiance and prefiltered environment maps.
When the light is active in the scene it will provide ambient lighting for all objects based on the environment map. You can optionally control for its strength via the light's color
, which simply acts as a multiplier.
Tone Mapping
By default the PBR renderer outputs colour in high dynamic range. This will make it look odd, unless you tone map the colours back into low dynamic range. To do so, you should add an instance of a tone-mapping-pass
subclass and connect it to the color
output of the PBR pass. The following tone mappers are implemented:
hable
Accepts the following tuning parameters:shoulder-strength
linear-strength
linear-angle
toe-strength
toe-numerator
toe-denominator
linear-white-point
exposure-bias
hill-aces
narkowicz-aces
reinhard
reinhard-extended
Accepts the following tuning parameters:c-white
schlick
Accepts the following tuning parameters:p
hi-val
tumblin-rushmeier
Accepts the following tuning parameters:luminance-map
This should be connected to aluminance-pass
' output, with the luminance-pass' input being the same as the input to this pass.ld-max
c-max
uchimura
Accepts the following tuning parameters:max-brightness
contrast
linear-start
linear-length
black-tightness-shape
black-tightness-offset
ward
Accepts the following tuning parameters:ld-max
All tone mappers also include a gamma
factor that should be adjusted according to the user's screen.