You are on page 1of 12

THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.

040220

THE BASICS OF PBR


IMPLEMENTATION IN XPLANE

Assumptions:

1. You are comfortable with your image-editing software and know about editing specific RGBA
channels - white = higher value, black = minimum value

2. You know how to make a ‘regular’ normal map – If not, an easy way to make one for a material
is to convert it into a height map, then use the height map to generate the normal map - see this

3. You know how to use blender ( Blender internal rendering engine) and bake multiple materials
to one object texture - see this tutorial

1 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Table of Contents

Theory ................................................................................................ 3
What is PBR? ................................................................................... 3
What is a normal map? ................................................................... 3
PBR in Xplane................................................................................... 5
Examples by Ilias Tselios: ................................................................. 7
Workflow Suggestions ....................................................................... 8
Detailed Technique ......................................................................... 8
Simpler Workflow: hand-painting ................................................. 10
Quick-Start Notes/Summary ............................................................ 11

2 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Theory

What is PBR?

PBR stands for Physically Based Rendering

It enables the game engine to ‘simulate’ the different ways in which light (mostly reflections)
interacts with different materials.

This can make materials look more realistic if done correctly. You can thus produce shiny
glass windows as part of the same object as a light metal, and in turn, the light will reflect
differently of both surfaces.

What is a normal map?


A normal map is a texture map that can be used to give the illusion of additional
geometry/detail on a 2d face. This reduces GPU workload.

3 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Figure 1 Diffuse texture (left) and it's normal equivalent (right)

In the case of XPlane, the normal map also can store PBR information in its channels.

An XPlane normal map can use up to four channels: R,G,B,A. The way to think of these
channels is that each channel stores information about a pixel in a normal map.

Type of Information Which Channel is it Stored in?


Displacement Red
Displacement Green
PBR base reflectance/metalness Blue
PBR smoothness/specularity Alpha

When viewing individual channels, they are generally displayed in black and white. Black
represents minimum channel value, and white represents the maximum value. Any values in
between the extremes will be shown as a shade of grey.

This image is purely blue. Look at the channels: The green


Figure 2 What individual channels can look like when editing. In this and red channels are purely black because red and green
case, the blue one is selected (gimp). In the blue channel, those black don't exist in any of the pixels. On the other hand, the blue
regions means that little/no blue exists in those pixels. channel is purely white.

4 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

PBR in Xplane
XPlane models two types of reflections:

Type What does it do Where in the _NML is this


information stored

Diffuse reflection Produces a reflection but it Alpha channel


is not clear due to the
scattering of the light once
reflected. (matte - rough
surface)
Specular Reflection Glossy (specular) reflection. Alpha channel
This is very clear (e.g.
mirror-like)

The diagram below illustrates how a smooth surface (left) produces a clearer reflection than
a rough surface (right). This is because a rough surface has lots of micro-surfaces with
normals in lots of different directions. This means that light rays will bounce off at different
angles as their angle of incidence is different depending on which micro-surface they hit. This
causes the light to scatter. X-Plane 11 conserves energy between diffuse and specular
reflection – having a stronger specular reflection reduces the amount of diffuse reflection
automatically; in this way highly glossy and reflective materials don’t appear to be overly
bright compared to matte materials.

Less Alpha More Alpha

Roughness Smoothness

Alpha Channel Values

X-Plane 11 conserves energy between diffuse and


specular reflection – having a stronger specular
reflection reduces the amount of diffuse
reflection automatically

5 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Xplane also models something called the Fresnel Effect. This is how a surface’s reflectance
varies depending on the angle which you view it at.

In PBR, materials exist as dielectrics or conductors, with the latter being more electrically
conductive. Dielectrics have different reflection properties to metals. The more metallic a
material is:

1. The greater its tendency to have its reflections tinted by the environmental light.
2. The higher its reflectance at given viewing angles.

The goal of modelling base reflectance is to make metals looks more like metals. Note that
painted metals are treated as dielectrics.

Minimum metalness Values

Maximum metalness values: The metal


reflections are brighter when viewed
orthogonal to the surface. The metal’s
reflections are similar in colour to the
environment.

6 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Type What does it do ? Where in the _NML is this


information stored ?

Metalness/base reflectance Higher metalness = more Blue Channel


reflection at a given viewing
angle. Greater tinting of
reflections.

Lower metalness = Less


reflection at a given viewing
angle

Examples by Ilias Tselios:


Type of Material Alpha Blue
Hi-gloss Metal high high
Glossy Plastic high low
Rough Metal low high
Rough Plastic low low

7 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Workflow Suggestions

Detailed Technique
This is how I like to do things when it comes to PBR implementation.

Download albedo texture for a particular


Open in materialize Create Height Map
material

Create Normal Map from height map and


Create Metallic Map and export Create Smoothness map and export export. Note that this wil not be your final
normal material.

We now have 3 maps per material: A) After creating your object and baking
1. Normal (blueish color) the diffuse textures, import the three B) Re-bake the same UV layout for each
maps we created into each material's of the three maps (if you're using all
2. Metallic (black and white) texture slots. Use the settings on the next three). Use the settings on the next page.
3. Smoothness map (black and white) page.

Add layer mask for the initial Normal


Add layer mask for the initial Normal Export these three .pngs (2x PBR, 1
map's Alpha channel. Copy and paste the
map's Blue channel. Copy and paste the Normal) and open in image editing
smoothness map into this mask and apply
metallic map into this mask and apply it. software.
it.

Add to the .obj file followed by anumber


between 0 and 1:
a. NORMAL_METALNESS directive to
Export this result as the PBR variant of the
indicate that the blue channel is suitable
object's normal map.
for base reflectance.
b. ATTR_shiny_rat for the specular
level map to work

SEE THIS TUTORIAL HOW TO USE MATERIALIZE

8 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

A) The bake settings

B) In this case, Textures 0.006,013,014,015 are my Albedo, Normal


(displacement only), alpha and metallic maps respectively for the
given material. These three maps all use the same UV. In this case, I
have selected the displacement map for this material as I was
baking the displacement component of the normal file for this
object.

Displacement normal (left), Smoothness map (middle left), metallic map (middle-right) merged PBR normal (right).
These are for an entire object and include multiple PBR materials

(BLENDER INTERNAL RENDERING ENGINE)

9 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Simpler Workflow: hand-painting


This workflow is more appropriate for hand-painting simple reflection profiles for objects that
have already been made in XPlane. You may want to do this if you want to make windows
shiny in XPlane for example.

Edit the alpha channel to control specularity. More


alpha (100% opacity) makes the surface more
mirror-like. You can edit it by only selecting the
alpha channel and using the eraser to remove alpha
Open the <objectname>_NML file in image editing
or using a paint brush to add it. You can also use
software. If this does not exist, you can use a plugin
brush opacity to change the alpha values to be in
to make one. In the .obj file you must use the
between the extremes of max and min values.
TEXTURE_NORMAL directive to use it.
Don’t worry if you need 0% alpha and your image
turns out ‘invisible’ – the height information is
retained in the other channels even if you can’t see
anything.

Follow the rest of the procedures to implement the


NML file in the object by entering the appropriate
commands in the .obj file: Edit the blue channel to control base
reflectivity/metalness. In GIMP, using a black paint
a. NORMAL_METALNESS directive to indicate
brush reduces the blue values. Using a white brush
that the blue channel is suitable for base
increases the blue value in the painted region. The
reflectance.
argument of brush opacity still holds
b. ATTR_shiny_rat for the specular level map to
work

10 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Quick-Start Notes/Summary

1. PBR information is stored in the Blue and Alpha channels of an


object’s normal map. These values – in increasing magnitude -
control how metallic and smooth a pixel appears respectively.
2. Activating the PBR metalness and Smoothness PBR information
in the normal maps is done by using the Global_Metalness and
Global_Specular lines respectively. You can follow these with
multipliers between one and zero if needed. For example:

3. Here is a small table I have made to give you some channel


value ideas. These are all relative. It is hard to pinpoint exact
values. This table extends onto the next page.

Material Blue Channel Alpha Channel


(Metalness) (Smoothness)
Smooth, bare Metal High Medium
Why: It’s a metal and Why: It’s smooth, but
thus needs to behave not so smooth that
like one. reflections are crisp

Rough concrete Low Low


Why: Concrete is a Why: It’s very rough
poor conductor of
electricity and
therefore not very
metallic

11 CLICK HERE TO RETURN TO TABLE OF CONTENTS


THE BASICS OF PBR IMPLEMENTATION IN XPLANE rev.040220

Glass window High


Why: Glass is very
smooth and thus
Low produces clear, focused
Why: glass is a poor reflections.
conductor of
electricity and
therefore not very
metallic

Painted metal Low Low/Medium


Why: The surface is Why: In this case, the
assumed to be coat of paint is quite
dielectric despite the thick and smooth.
base material. We
therefore treat it as
being a poor
conductor.

12 CLICK HERE TO RETURN TO TABLE OF CONTENTS

You might also like