Breaking down Physically Based Rendering (PBR) with Dominique Buttiens

2nd Mar 2023 Game Stories

Have you ever introduced lighting to your scene in game and
felt like things were too dark despite there being plenty of light? Or maybe
there’s an asset which feels like it wasn’t fitting into the scene, but you
couldn’t figure out why it wasn’t matching its reference? Introducing: the PBR
Value Checker 2.0.

Dominique Buttiens, Principal Environment Artist at
Brighton-based The Chinese Room, has been delving into the theory of PBR (Physically
Based Rendering) and, from his findings, has created his own universal texture
value checker. Here, he shares an in-depth look into PBR, the tool created and
how it can help artists create realistic looking assets that look good in any
lighting conditions.

What is Physically Based Rendering?

Physically Based Rendering (PBR) is a method of shading and
rendering which provides a true-to-life representation of how light interacts
with physical items. In video games, it can create a more realistic lighting
environment and can better model how light interacts with a surface or object.

Recently, I started to re-read a lot of the theory around
PBR and specifically its implementation into Unreal Engine. One of the reasons
was that I wanted to help myself and other artists have an easier time checking
texture values in a scene, but also to help lighting artists find the cause of
bad dark/light values in a scene. Often artists will still ‘eyeball’ (estimate
based on what they can see) the values, which can work fine until the same
textures get used in a different scenario or until the lighting changes. And so
I decided to create my own universal texture value checker, specifically for colour
and roughness, to enable other artists to create consistent, realistic-looking
lighting. Because if you want the lighting to look realistic and consistent, it’s
crucial to keep an eye on your base colour textures.

But before we get to the tool, its benefits and how it
works… let’s go back to basics.

Why are correct PBR Values important?

Put simply, correct PBR Values are crucial if you want
realistic material responses. To achieve these, you have to understand what
these values do and what values are realistic. Different properties of
materials can alter the way they perform and interact with light. Let’s take a
look at some basic rules on how Unreal Engine handles PBR, using the
Metalness-Roughness workflow:


Metalness

A material is either a metal or a dielectric (a material
that would not conduct electricity like glass, leather or wood) – its state impacts
how reflective it is. Generally speaking, the metalness of material should be
either 0 or 1 but there are exceptions where ‘grey’ value can be expected, such
as conductive surfaces covered in dirt or rust.

Specular

Specularity has to do with how much different materials
reflect light. On average, the specular percentage range is 0-8% and, on
average, dielectric materials have a specular value of around 4%. Remember: all
engines will have a variation of this.

Roughness

A material’s roughness has a direct impact on how it
reflects light. Rough objects reflect light in more directions than smooth ones
do, which in turn impacts how blurry or sharp a reflection is. As with
Metalness, the values range from 0 to 1 but remember to check your scene as a
whole when it comes to roughness.

Ambient Occlusion

Ambient Occlusion describes the ambient lighting of an
object, usually marking which areas are harder or easier to reach for the light. Cavities
will be displayed as dark, flat exposed surfaces as white. Practically, the
inside of something is typically darker or ‘more shaded’ than the exposed outer
edges and will therefore continue to become darker still depending on how far in
you go.

Albedo & Base Colour

Albedo refers to a surface’s ability to reflect sunlight
which is informed by its base colour: for example, charcoal is the darkest
albedo found in real life and, in contrast, fresh snow is the brightest albedo
in real life. When working on a project, if you ever notice your scene appearing
too dark, despite the correct lighting set-up, the cause is likely the albedo
darkness.

Once you understand these principles, you can unlock
realistic-looking assets that look good in all lighting conditions and, crucially, are consistent.

Unreal Engine Tool: PBR Value Checker

So why create a tool to help with all the above? Basically:
to make the lives of artists everywhere easier. Consistency is key in game
development and as artists, we’re always working to create an immersive experience for players – a huge part of that is building a real world.”

The tool I’ve created is specifically for Albedoes and
Roughness (as both are paramount for realistic-looking lighting).
The way it works is simple: it checks the viewport’s unlit colours and measures
its value on a linear RGB (red, green and blue) scale of 0 to 1. From there, it
compares it to the ‘hard minimum’ and ‘hard maximum’ values and recolours based
on those.

I set up the viewport shader to automatically consider the material’s nature (dielectric or metallic) and its roughness because when a surface has a certain roughness level, its albedo
should appear brighter than usual.

The value checker in Albedo mode.
The
value checker in Albedo mode.

As demonstrated above, when set to Albedo mode, the tool has
viewed the scene and recoloured areas accordingly:


Green means the Albedo range is within an
acceptable range;


Red means the Albedo range is too dark;


Blue means the Albedo range is too bright;

We’re going for green but it’s worth mentioning that green
does not mean your values are perfect, just that they exist within an
acceptable range for realism.

Similarly, when the tool is in Roughness mode it will
identify issues using the same system. As seen below, red is indicating that
the bricks have a roughness that is pushed beyond its limits and needs
correcting.

The value checker in Roughness mode.
The
value checker in Roughness mode.

When used in Engine, the tool will be neatly stored away in
a widget ready for you to run in either Albedo or Roughness view mode.

I hope it can take some of the guesswork out of PBR and
can’t wait to hear how people use it!

More detailed information, a PDF and download link for
the PBR Value Checker in Unreal Engine can be found
here.

You can follow Dominique on ArtStation and discover their
useful tips, tricks and insights into Environment Art
here.


Glossary

Don’t know your RGB from PB&J? This handy glossary
breaks down some of the technical terms used above!

PBR: Stands for Physically Based Rendering and is a
method of shading and rendering which models the way light interacts with
objects in the real world. Most often used to achieve photorealism.

RGB: Stands for red, green and blue – the three
primary colours used to create every other colour within the spectrum.

Engine: An engine or game engine is a software
framework used for the development of games. Examples of these might be Unreal
Engine or Unity.

ArtStation: ArtStation is a portfolio website,
magazine and forum where (primarily digital) artists can collaborate, learn and
discover.

Principal Environment Artist: An environment artist
is someone who specialises in the creation of world assets for media. In games,
they might create anything a player could see in the environment of a level or
world – including terrain, structures or props. A Principal works with the Lead
Environment Artist and Art Director to create high-quality environments and
lead by example.


Looking to join an award-winning developer and work on
iconic games? The Chinese Room is looking for talented people to join its team.
You can discover all current opportunities on the
Careers Page.

2nd March 2023 Game Stories