Physically Based Rendering Encyclopedia
Physically Based Rendering Encyclopedia
Physically Based Rendering Encyclopedia
v.0.95(july17,2014) Compiledby:BrianYu(3py0n)
There is no one way to accomplish a task, more specifically in texturing. The below is a guideline of the most common and effective routes
currently and is by no-means the only way to texture for PBR. Final name of this document is in consideration. ENJOY!
Introduction
An emporium/bible of sorts wherein I will try to encompass all there is to know about creating physically based materials for the next-gen. I am still
new to PBR texturing and am learning as I make this bible. The reason for me making this is to have a central database for artists and developers to
look at to help them with their workflow. Its also a great way for people who are new to PBR to learn more. Please note that this is just a general
guide/bible and is not the end-all-be-all. That is to say, there is typically not only 1 way of doing things. Before I finish, this document is also for people
who have prior knowledge in texturing and making 3D art in general.I would like to take this opportunity to thank all the wonderfully talented and
innovative people who I sourced from for their work on this subject matter. :) PS: This is more for the artistic side and less of the math/deep
calculations and how it works exactly, etc.
Copyright
I do not pretend to own all of what I am stating in this document. Some parts will be from my personal experience/knowledge while other parts will be
excerpts taken from sources (credit will be identified at the beginning of a section).
Light that gets reflected directly from the surface is handled as specular reflectance in a shading model. The light that is refracted and undergoes subsurface scattering
is handled as diffuse reflectance.
The amount of light that is reflected versus refracted depends on the surface substance and the angle at which the light hits the surface. At a grazing angle, the amount
of light that gets reflected directly (specular) gets higher, until it reaches 100% at an extreme angle. This behavior is described by the Fresnel effect.
Metal has no diffuse reflection. This means that metal should have a black diffuse color. All visible light is reflected directly from the surface (specular reflectance).
The different types of metal have characteristic specular colors.
Metal actually neither refracts nor absorbs ANY light, metals are so dense that light can't actually enter the surface, which is why all of the light is reflected. (source)
1
In contrast to metal, non-metal has diffuse reflection, however the specular reflection is a lot weaker and less varied than for metal. Specular reflectance for non-metal is
monochromatic (no color, just gray). Most non-metals reflect only a small fraction of the light as specular, for most materials between 2% and 5%.
Energy conservation of this sort is an important aspect of physically-based shading. It allows the artist to work with reflectivity and albedo values for a material without
accidentally violating the laws of physics (which tends to look bad). While enforcing these constraints in code isnt strictly necessary to producing good looking art, it does
serve a useful role as a kind of nanny physicist that will prevent artwork from bending the rules too far or becoming inconsistent under different lighting conditions.
When the equations are properly balanced, a renderer should display rough surfaces as having larger reflection highlights which appear dimmer than the smaller,
sharper highlights of a smooth surface. It is this apparent difference in brightness that is key: both materials are reflecting the same amount of light, but the rougher
surface is spreading it out in different directions, whereas the smoother surface is reflecting a more concentrated beam:
Here we have a second form of energy conservation that must be maintained, in addition to the diffusion/reflection balance described earlier. Getting this right is one of
the more important points required for any renderer aspiring to be physically-based.
The gamma colour space is 0 - 255. The neutral gray/50% is 187, not 127(128).
As of the original writing, standard monitor gamma is about 2.2, with some exceptions.
A more indepth explanation of gamma and how it affects displays (monitor, cameras, LCD on camera, etc) is given in the article. For the sake of lessening the amount of
diagrams, etc Ive omitted it.
Here is where we get to the nitty gritty of gamma vs linear. I stated that I wouldnt put too many images but this part is too good not to.
1 2 3
2
1. The left image does all the lighting calculations in gamma-space. The right image does all calculations in
4
linear-space. If you are on the PC/PS3/360, you should be doing your lighting in linear-space. If you are on
the Wii/PSP/iPhone, you gotta do what you gotta do.
The image on the left is wrong for several reasons. First, it has a really, really soft falloff, which does not look
correctly. Also, you can see a lot of hue-shifting, especially in the specular highlight. It seems to shift from
white to yellow to green and back to yellow. When you look at the image on the right, it looks like a diffuse
surface with a white specular highlight. It looks like what the lighting model says it should look like. Finally, Im
not talking about what looks good, Im talking about what is correct. Thats an entirely different discussion.
2. [Typical shader that does not convert texture back into linear-space] You are first reading the texture.
BUT, the texture that is on your hard drive is in gamma-space. The texture is much brighter and more
desaturated than the texture you see when you look at it on your screen. So you are taking this too-bright
texture, and applying your lighting model to it, for the middle image. Your monitor then applies a pow(2.2) to it
which darkens it and gives you the final result. How do you fix this?
3. [Typical shader that converts texture back into linear-space] W hen the texture is read by the hardware, it is in gamma-space (1st image). But the pow(x,2.2)
converts the texture back into linear-space (2nd image). Then we do the lighting calculations (3rd image). Now that we have the final image that we want, we apply a
pow(x,1/2.2) to convert it back into gamma-space. The gamma-space image is sent to the monitor, which applies its own pow(x,2.2) and displays the final image.
Of course, those pow() functions arent free in a shader. But they are in fact free if you use the hardware sampler states. For the texture read, you can use
D3DSAMP_SRGBTEXTURE, and for the write to the framebuffer, you can use D3DRS_SRGBWRITEENABLE. So now your shader has the same code as before, and
the hardware states give you the conversions for free.
4. Here is a real image of a volleyball. The top CG image is in linear-space and the bottom is in gamma-space. Note how the linear image matches the harsh falloff of
the real image, but the gamma one does not.
So thats how to make your image look correct. Making it look good is an exercise for the reader.
That wraps up the shortened-shortened version of what is Linear Space and Gamma Space. There is much to know and read and for all those who wish to venture on
this journey I say, go for it! But for this doc, I will be stopping here with the explanation as I feel it is an adequate amount of information. What a great read!
Note that every engine/shader varies in one way or another to how it represents the physical world, specifically lighting. Values/textures in UE4 may differ from
CryENGINE 3 and Marmoset, etc.
There is no single model that fits every situation, but there are some better than others. The Cook-Torrance model has been shown to be a top performer, when
compared against actual acquired BRDF data. Of course, with the good comes the bad and Cook-Torrance is one of the most expensive models to compute. But for
overall results, it is hard to beat. So this is our target; a nice implementation of the Cook-Torrance reflectance model. Now this maybe an issue when using
Cook-Torrance model on mobiles and consoles due to hardware limitations, so it's a question of which module to use.
3
Dielectric materials are the most common materials. Their optical properties rarely vary much over the visible spectrum: water, glass, skin, wood, hair, leather, plastic,
stone, concrete, ruby, diamond
Metals. Their optical properties vary over the visible spectrum: iron, aluminium, copper, gold, cobalt, nickel, silver
Reflection/Specular
When light hits a surface boundary some of it will reflect that is, bounce off from the surface and leave heading in a direction on the opposing side of the surface
normal. This behavior is very similar to a ball thrown against the ground or a wall it will bounce off at the opposite angle. On a smooth surface this will result in a
mirror-like appearance. The word specular, often used to describe the effect, is derived from the latin for mirror (it seems specularity sounds less awkward than
mirrorness).
Except gemstones, any dielectric material we will use should be in the range 0.02-0.05 (more values found here).
As you can expect, you wont spend your time finding all the refractive indices of metallic material. Especially since values are for pure laboratory material. But these
specular colors can be used as references. Moreover, we can see that specular colors for metallic objects are close to what we think the color of the metal is. The basic
rule for metal is to set up a value above 0.5.
Diffuse/Albedo
Not all light reflects from a surface, however. Usually some will penetrate into the interior of the illuminated
object. There it will either be absorbed by the material (usually converting to heat) or scattered internally.
Some of this scattered light may make its way back out of the surface, then becoming visible once more to
eyeballs and cameras. This is known by many names: Diffuse Light, Diffusion, Subsurface Scattering
all describe the same effect.
The absorption and scattering of diffuse light are often quite different for different wavelengths of light, which
is what gives objects their color (e.g. if an object absorbs most light but scatters blue, it will appear blue). The
scattering is often so uniformly chaotic that it can be said to appear the same from all directions quite
different from the case of a mirror! A shader using this approximation really just needs one input: albedo, a color which describes the fractions of various colors of
light that will scatter back out of a surface. Diffuse color is a phrase sometimes used synonymously.
The lighting unit for these light sources is specified as the color a white lambertian surface would have when illuminated by the light from a direction parallel to the
surface normal.
This mean that when you set up a light in the game editor with 1 in brightness and point it directly on a quad mapped with a diffuse texture, you get the color as displayed
in Photoshop (be aware of postprocess).
One of the darkest substances on earth is charcoal, the brightest is fresh snow.
Metals
Firstly, metals tend to be much more reflective than insulators (non-conductors). Conductors will usually exhibit reflectivities as high as 60-90%, whereas insulators
are generally much lower, in the 0-20% range. These high reflectivities prevent most light from reaching the interior and scattering, giving metals a very shiny look.
Secondly, reflectivity on conductors will sometimes vary across the visible spectrum, which means that their reflections appear tinted. This coloring of reflection is rare
even among conductors, but it does occur in some everyday materials (e.g. gold, copper, and brass). Insulators as a general rule do not exhibit this effect, and their
reflections are uncolored.
Finally, electrical conductors will usually absorb rather than scatter any light that penetrates the surface. This means that in theory conductors will not show any evidence
of diffuse light. In practice however there are often oxides or other residues on the surface of a metal that will scatter some small amounts of light.
It is this duality between metals and just about everything else that leads some rendering systems to adopt metalness as a direct input. In such systems artists specify
the degree to which a material behaves as a metal, rather than specifying only the albedo & reflectivity explicitly. This is sometimes preferred as a simpler means of
creating materials, but is not necessarily a characteristic of physically-based rendering.
In computer graphics the word Fresnel refers to differing reflectivity that occurs at different angles. Specifically, light that lands on a surface at a grazing angle will
be much more likely to reflect than that which hits a surface dead-on. This means that objects rendered with a proper Fresnel effect will appear to have brighter
reflections near the edges. Most of us have been familiar with this for a while now, and its presence in computer graphics is not new. However, PBR shaders have
made popular a few important corrections in the evaluation of Fresnels equations.
The first is that for all materials, reflectivity becomes total for grazing angles the edges viewed on any smooth object should act as perfect (uncolored) mirrors, no
matter the material. Yes, really any substance can act as a perfect mirror if it is smooth and viewed at the right angle! This can be counterintuitive, but the physics are
clear. (Ex. Probably akin to asphalt looking like water/wavy mirror at extreme angles)
4
The second observation about Fresnel properties is that the curve or gradient between the angles does not vary much from material to material. Metals are the most
divergent, but they too can be accounted for analytically.
The shading system can now handle the Fresnel effect almost entirely on its own; it has only to consult some of the other pre-existing material properties, such as gloss
and reflectivity.
Note: Toolbag 2 does not currently support a texture map to control Fresnel intensity.
Fresnel, in Toolbag 2 and most PBR systems, is approximated automatically by the BRDF, in this case Blinn-Phong or GGX, and usually does not need an additional
input. However, there is an extra control for Fresnel for the Blinn-Phong BRDF, which is meant for legacy use as it can result in non physically accurate results.
Microsurface (Roughness/Gloss)
Most real-world surfaces have very small imperfections: tiny grooves, cracks, and lumps too little for the eye to see,
and much too small to represent in a normal map of any sane resolution. Despite being invisible to the naked eye,
these microscopic features nonetheless affect the diffusion and reflection of light.
Microsurface detail has the most noticeable effect on reflection (subsurface diffusion is not greatly affected and
wont be discussed further here). In the diagram to the left, you can see parallel lines of incoming light begin to
diverge when reflected from a rougher surface, as each ray hits a part of the surface with a different orientation. In
short, the rougher the surface gets, the more the reflected light will diverge or appear blurry.
Unfortunately, evaluating each microsurface feature for shading would be prohibitive in terms of art production, memory use, and computation. So what are we to do? It
turns out if we give up on describing microsurface detail directly and instead specify a general measure of roughness, we can write fairly accurate shaders that
produce similar results. This measure is often referred to as Gloss, Smoothness, or Roughness. It can be specified as a texture or as a constant for a given
material.
This is significant because two real world quantities that are physically related
microsurface detail and reflectivity are now properly tied together in the art
content and rendering process for the first time. This is much like the
diffusion/reflection balancing act described earlier: we could be authoring both
values independently, but since they are related, the task is only made more difficult by attempting to treat them separately.
Further, an investigation of real world materials will show that reflectivity values do not vary widely (see the earlier section on conductivity). A good example would be
water and mud: both have very similar reflectivity, but since mud is quite rough and the surface of a puddle is very smooth, they appear very different in terms of their
reflections. An artist creating such a scene in a PBR system would author the difference primarily through gloss or roughness maps rather than adjusting reflectivity, as
shown above.
Microsurface properties have other subtle effects on reflection as well. For example, the edges-are-brighter Fresnel effect diminishes somewhat with rougher
surfaces (the chaotic nature of a rough surface scatters the Fresnel effect, preventing the viewer from being able to clearly resolve it). Further, large or concave
microsurface features can trap light causing it to reflect against the surface multiple times, increasing absorption and reducing brightness. Different rendering systems
handle these details in different ways and to different extents, but the broad trend of rougher surfaces appearing dimmer is the same.
This section only serves as a very basic and introductory lesson to the world of PBR. I wont be going in-depth on the math and science behind it as more links will be
provided in the additional references section. However after reading this section, one should be familiar enough with how PBR works now to understand the rest of this
document.
5
From my point of view, the most difficult texture to author is gloss. Reasons are as follows:
Specular power range deduced from gloss values is completely dependent of your engine.
A lot of the detail is contained here compared to the previous method wherein details were spread out through all the maps
Values are numerical, neither color nor vector.
Details like scratches, pores, grooves, etc can be added even without them being in the normal map. Hence why this map is also referred to as microsurface.
Artists who are unfamiliar with the concept of PBR systems often assume that content creation is drastically different, usually because of the terminology that is used. If
youve worked with modern shaders and art creation techniques you already have experience with many of the concepts of a physically based rendering system.
Figuring out what type of content to create, or how to plug your content into a PBR shader can be confusing, so here are some common terms and concepts.
Non-Metals
Non-metal has monochrome/gray specular color. Never use colored specular for anything except certain metals unless certain of what you are doing
[Specular] The sRGB color range for most non-metal materials is usually between 40 and 60. It should never be higher than 80/80/80.
A good clean diffuse map is required.
Metals
The specular color for metal should always be above sRGB 180.
Metal can have colored specular highlights (for gold and copper for example).
Metal has a black or very dark diffuse color.
For practical purpose, more diffuse and rough materials will reflect dimmer and wider highlights, while smoother a
nd more reflective materials will reflect brighter
and tighter highlights.
Diffuse/Albedo (source)
Diffuse/Albedo maps are generally gamma space and are quite flat colour wise.
Albedo is pure colour, no lighting information baked in like we used to do with diffuse maps. (source)
The diffuse color defines how bright a surface is when lit directly by a white light source with an intensity of 100%. More physically speaking, it defines which percentage
for each component of the RGB spectrum does not get absorbed when light scatters underneath the surface. A diffuse map is always required. In most cases the diffuse
color in the material editor should be set to white (255/255/255).
For pure metal materials, the diffuse color should be black as explained before. Rusty metal/oxidation however needs some diffuse color.
An albedo map defines the color of diffused light. One of the biggest differences between an albedo map in a PBR system and a traditional diffuse map is the lack of
directional light or ambient occlusion. Directional light will look incorrect in certain lighting conditions, and ambient occlusion should be added in the separate AO
slot.
6
The albedo map will sometimes define more than the diffuse color as well, for instance, when using a metalness map, the albedo map defines the diffuse color for
insulators (non-metals) and reflectivity for metallic surfaces.
Reflectivity is the percentage of light a surface reflects. All types of reflectivity (aka base reflectivity or F0) inputs, including specular, metalness, and IOR, define how
reflective a surface is when viewing head on, while Fresnel defines how reflective a surface is at grazing angles.
A spec map wont be needed to directly set reflectivity (when using metalness workflow) but is still required in the alternative workflow. The spec map is combined with
your diffuse in the form of the albedo map in the metalness workflow.
Specular color is a physical value now which is constant for a single type of material. So in essence, it will look quite flat compared to pre-PBR spec maps.
The specular color defines how much light gets reflected immediately from the surface when the light source is directly above the surface. This is the minimum specular
intensity, under grazing angles it will increase due to the Fresnel effect. As the specular color is specific for a certain type of material, it can also be considered as a mask
for the type of material/substance. The specular color is a physical value which should be picked directly from a reference table. As such, it does not leave much artistic
freedom.
Its important to note how narrow the range of reflectivity is for insulative
(non-metal) materials (see below). Combined with the concept of energy
conservation its easy to conclude that surface variation should generally
be represented in the microsurface map, not the reflectivity map. For a
given material type, reflectivity tends to remain fairly constant.
Reflection color tends to be neutral/white for insulators, and colored
only for metals. Thus, a map specifically dedicated to reflectivity
intensity/color (commonly called a specular map) may be dropped in
favor of a metalness map.
Traditional specular maps offer more control over the the specular
intensity and color, and allow greater flexibility when trying to reproduce
certain complex materials. The main drawback to a specular map is that
it generally will be saved as a 24 bit file resulting in more memory use. It
also requires artists to have a very good understanding of physical
material properties to get the values right, which can be a positive or
negative depending on your perspective.
Insulators (non-metal), IOR values do not require color information, and can be entered into the index field directly, while the extinction field should be set to 0.
Metals that have color reflections, will need a value for the red, green and blue channels. This can be done with an image map input (where each channel of the map
contains the correct value). The extinction value will also need to be set for metals, which you can usually find in libraries that contain IOR values.
7
Using IOR as opposed to specular or metalness input is generally not advised, as it is not typically used in games, and getting the correct value in a texture with
multiple material types is difficult. IOR input is supported in Toolbag 2 more for scientific purposes than practical.
Metalness (source)
Metalness maps generally are Gamma space.
A metalness map is not more or less physically accurate than a standard specular map. It is, however, a concept that may be easier to understand, and a metalness
map can be packed into a grayscale slot to save memory. The drawback to using a metalness map over a specular map is a loss of control over the exact values
for insulative materials. (refer to the above image)
Protips (source)
When using a metalness map:
Insulative surfaces - pixels set to 0.0 (black) in the metalness map are assigned a fixed reflectance value (linear: 0.04 sRGB: 0.06) and use the albedo map for the
diffuse value.
Metallic surfaces pixels set to 1.0 (white) in the metalness map the specular color and intensity is taken from the albedo map, and the diffuse value is set to 0
(black) in the shader. Gray values in the metalness map will be treated as partially metallic and will pull the reflectivity from the albedo and darken the diffuse
proportionally to that value (partially metallic materials are uncommon).
Metalness maps should use values of 0 or 1 ( some gradation can be okay for transitions). Materials like painted metal should not be set to metallic as paint is an
insulator. The metalness value should represent the top layer of the material.
However, If you use mid-values in the metalness mask you can sort of hack it into doing what you want. You don't need to stick to black or white. But then it will pull the
spec color from there as well, which works for things like Christmas ornaments, but not really for glossy plastics.
But really, if you want fine control over the specular color and specular intensity for non-metals, you shouldn't be using the metalness function, you should use the
standard blinn-phong, as that will let you do exactly that. With energy conservation on, and a bright spec intensity value with blinn-phong, it will basically work the same
as the metalness thing (ie: it will darken the diffuse to make it appear more metal-ish)
If a metalness map is used, the spec and albedo maps are combined into one, thus the need for a separate spec map is negated.
Typically all the detail is located here. Scratches, wear, finger prints, etc are located in this map. It is more or less the same pre-PBR.
A a low gloss value means that the surface is rough while a high value means the surface is very smooth and shiny. The roughness influences the size and the intensity
of specular highlights. The smoother/glossier a surface is, the smaller the specular highlight will be. A more narrow/smaller highlight will at the same time be brighter in
order to obey to the rules of energy conservation.
A gloss map is used and creates interesting and plausible variation on the specular highlights.
Most materials should have a gloss map, as it can give a lot of good variation to the shading. Gloss is closely related to normal maps, as high frequency details in a
normal can create some feeling of roughness as well. However, gloss is more the micro-scale roughness of the material.
Note how the specular highlight becomes smaller and brighter with an increasing gloss value, making the material look smoother (Image Source: Real-Time Rendering)
8
Here we see the how the principles of energy conservation are affected by the microsurface of the material, rougher surfaces will show wider, but dimmer specular
reflections while smoother surfaces will show brighter, but sharper specular reflections.
Depending on what engine youre authoring content for, your texture may be called a roughness map instead of a gloss map. In practice there is little difference between
these two types, though a roughness map may have an inverted mapping, ie: dark values equal glossy/smooth surfaces while bright values equal rough/matte
surfaces. By default, Toolbag expects white to define the smoothest surfaces while black defines roughest surfaces, if youre loading a gloss/roughness map with an
inverted scale, click the invert check box in the gloss module.
Adding AO as a separate map as opposed to baking it into the albedo and specular maps allows the shader to use it in a
more intelligent way. For instance, the AO function only occludes ambient diffuse light (the diffuse component of the image
based lighting system in Toolbag 2), not direct diffuse light from dynamic lights or specular reflections of any kind.
AO should generally not be multiplied on to specular or gloss maps. Multiplying AO onto the specular map may have been
a common technique in the past to reduce inappropriate reflections (e.g. the sky reflecting on an occluded object) but
these days local screen space reflections do a much better job of representing inter-object reflections.
Cavity (source)
A cavity map represents small scale occluded light and is generally baked from a 3d model or a normal map. An easy and
painless way of creating a cavity map would be by using NDO2 wherein it generates it via a normal map.
A cavity map should only contain the concave areas (pits) of the surface, and not the convex areas, as the cavity map is
multiplied. The content should be mostly white with darker sections to represent the recessed areas of the surface where
light would get trapped. The cavity map affects both diffuse and specular from ambient and dynamic light sources.
Alternatively, a reflection occlusion map can be loaded into the cavity slot, but be sure to set the diffuse cavity value to 0
when doing this.
9
Please note the metalness map approach was used in this scenario. (source)
Please note the specular map workflow was used in this scenario. (source)
10
There are many ways to create texture content for PBR systems; the exact method you choose will depend on your personal
preferences and what software you have available to you. Here is a quick recap of the method I used to create the lens above:
First, basic materials were created in Toolbag for each surface type using a combination of tiling textures from Megascans,
measured data from known materials, and where lacking appropriate reference, logic and observation, to determine the
values. Creating the base materials in Toolbag allows me to quickly adjust values and offers a very accurate preview of the
end result.
Tip: Often I assign base materials directly to my high poly model to get a clear idea of how the texture will come together
before doing the final bakes.
After setting up my base materials I brought the values and textures into Photoshop and started layering them in a logical
manner. Brass at the bottom, nickel plating, matte primer, semi-gloss textured paint, paint for the lettering, and finally the red
glossy plastic. This layering setup provides an easy way to reveal the various materials below with simple masks.
After I have my base layers set up and blended together to represent various stages of wear, I added some extra details. First
I used dDo to generate a dust and dirt pass, and then I finished it off with fine surface variation in the gloss map.
The exact method you use to create content for a PBR system is much less important than the end result, so feel free to
experiment and figure out what works best for your needs. However, you should void tweaking materials values to look more
interesting in a specific lighting environment. Using sound base values for your materials can greatly simplify the process,
increase consistency and asset reuse on larger projects, and will ensure that your assets always look great no matter how you
light them.
Lastly take special consideration of the colour space for each respective value.
11
(above source)
Water 38 38 38 0.02
Skin 51 51 51 0.03
Hair 65 65 65 0.05
Plastic / Glass (Low) 53 53 53 0.03
Plastic High 61 61 61 0.05
Glass (High) / Ruby 79 79 79 0.08
Diamond 115 115 115 0.17
Iron 196 199 199 0.57
Copper 250 209 194 N/A
Gold 255 219 145 N/A
Aluminum 245 245 247 0.91
Silver 250 247 242 N/A
If a non-metal material is not in the list, use a value between 45 and 65.
(source)
So UE4 uses slightly different parameters and handles maps a little differently compared to other shaders/engines. In this section I will illustrate those points.
Base colour, roughness, metallic, and specular inputs take 0 to 1 values.
Porosity
The Dontnod chart include an unusual parameter named Porosity. This parameter is the open porosity of a material. It can be used for driving weathering and aging
effect (Pollution, rain, aging). More details on its usage can be found in previous blog post: Water drop 3a Physically based wet surfaces and Water drop 3b
Physically based wet surfaces. In practice Dontnod use it mainly with the dynamic wet formula provided in the mentionned previous post.
The range is remapped from 0-1 to 0-70% of open porosity. There is real worl image to try to give a feeling of what the value mean. An extremely porous material is the
clay (70%), but open porosity can vary a lot for same material, clay could also be only 50%.
12
Base Colour
Base Color simply defines the overall color of the Material. It takes in a Vector3 (sRGB 0-255) value and each channel is automatically clamped between 0 and 1.
If taken from the real world, this is the color when photographed using a polarizing filter (polarization removes the specular of nonmetals when aligned).
Charcoal 0.02
13
Platinum (0.672, 0.637, 0.585)
The diffuse part of the base color (the one use by the non-metallic) must be in the range of the first gradient 50-243. There is some sample values of real world material
in sRGB below the gradient. Some of these values are base on real world measured material (from misc sources, not done by us) and other are have been generated by
Laurent Harduin. He take calibrated raw picture of representative material, take the luminance histogram in Photoshop and use the value of the medium axis for the
luminance. Then he blur the picture and take one pixel inside the blurred region and use that as the color value. This explain why in few case like the clean cement the
color and the luminance doesnt match perfectly. We also lower a bit the value to take into account the invevitable specular present during the capture.
The reflectance part (the one use by metallic) must be in the range 186-255 (not present in the chart). Some example are provided below the grey square. Most of the
time the metallic color of material match what the eye see.
Roughness
The Roughness input literally controls how rough the Material is. A rough Material will scatter reflected light in more directions than a smooth Material. This can be
seen in how blurry or sharp the reflection is or in how broad or tight the specular highlight is. Roughness of 0 (smooth) is a mirror reflection and roughness of 1 (rough) is
completely matte or diffuse.
Roughness is a property that will frequently be mapped on your objects, in order to add the most physical variation to the surface.
oughness
If you have been making Materials in previous iterations of the Unreal Engine and are not accustomed to physically-based Materials, keep in mind that R
maps are where you will handle most of your Specularity texturing.
Metallic
The Metallic input literally controls how "metal-like" your surface will be. Nonmetals have Metallic values of 0, metals have Metallic values of 1. For pure surfaces, such
as pure metal, pure stone, pure plastic, etc. this value will be 0 or 1, not anything in between. When creating hybrid surfaces like corroded, dusty, or rusty metals, you
may find that you need some value between 0 and 1.
Specular (Reflectance)
The Specular input should not be connected and left as it's default value of 0.5 for most cases.
There is no chart for the reflectance value of the Unreal engine 4, just let the value by default and apply a cavity map on it.
o effect on metals.
It is value between 0 and 1 and is used to scale the current amount of specularity on non-metallic surfaces. It has n
For very diffuse Materials, you may be inclined to set this to zero. Resist! All Materials have specular. What you really want to do for very diffuse Materials is make them
rough.
Commonly, if we modify Specular, we do so to add micro occlusion or small scale shadowing, say from cracks represented in the normal map. These are sometimes
referred to as cavities. Small scale geometry, especially details only present in the high poly and baked into the normal map, will not be picked up by the renderer's
14
real-time shadows. To capture this shadowing, we generate a cavity map, which is typically an AO map with very short trace distance. This is multiplied by the final
BaseColor before output and multiplied with 0.5 (Specular default) as the Specular output. To be clear this is BaseColor = Cavity*OldBaseColor, Specular = Cavity*0.5.
For advanced use, this can be used to control the index of refraction (IOR). We have not found this to be necesary for 99% of Materials. Below are Specular values
based off of measured IOR.
Material Specular
Glass 0.5
Plastic 0.5
Quartz 0.570
Ice 0.224
Water 0.255
Milk 0.277
Skin 0.35
Additional charts and values.
Example measured Materials. Top: Charcoal, fresh concrete, worn asphalt. Bottom: Copper, iron, gold, aluminum, silver, nickel, titanium
For metallic surfaces, the specular intensity is pulled from the albedo map, while the diffuse is darkened to 0 (raw metals reflect nearly 100% of light, so they don't
really have a diffuse component). This basically means that the albedo for raw metals is black.
For insulators, or non-metals, the diffuse color is pulled from the albedo map, while the specular intensity is set to a fix value (0.04 or so), as most non metals reflect
light in very narrow range of values.
Gloss/roughness maps define how glossy or rough a surface is, and how tight or wide the specular reflections are. Glossier surfaces have tighter, more intense
highlights, while rougher surfaces have wider/blurrier and more dim highlights. This applies regardless of material type. If the surface is a glossy plastic, you make it
glossy in the gloss map. For wear and tear and such, say for where the gloss coating on the plastic is worn off, you would make it more rough in the gloss map. You
shouldn't be painting highlights or lighting of any sort into any maps with modern shaders.
Generally engines will use a full color spec map, or a metalness map. The biggest difference is really how the content is packed. Its true that the metalness workflow
gives you less control, but its more efficient memory wise as you can pack more info into less textures. The theory with the metalness thing is that it is harder for artists to
use incorrect specular values (artists have a tendency to eyeball stuff, which often looks ok under one set of lighting but totally wrong in another).
As far as glossy plastic goes, you should be able to do this just fine with a metalness map and your gloss map. Something like a car paint shader is more complex and
would likely require a custom shader.
The best way to visualize these concepts is to load up TB2/EU4, add a sphere, and play with simple parametric materials. Adjust the gloss/roughness values,
observe how the reflections change. Play with the metalness value, etc.
15
Be aware that you are working in sRGB color space on your monitor when painting a texture. In sRGB space, a 50% mid-gray is not 0.5 or 127 but rather 0.5 raised by
the inverse of gamma 2.2 which equals 187 in Photoshop. In a nutshell, the reason that sRGB is used is to avoid banding artifacts. In sRGB space you get more
precision for darker colors to which the human eye is more sensitive. Before working on colors, please make sure that your screen is calibrated properly.
There isnt a huge emphasis on colour spacing for PBR but it is noted in many sources because those sources are trying to cover all basis and explain the nature of this
genre.
For each material I start with the reflectance value, these can be found in various charts online, if I cant find a reflectance value for a certain material, I try to determine it
with logical reasoning (ie, worn out rubber will be less reflective, brass is a mix of copper and zinc, etc).
Reflectance values are the easiest to start off with, and give you a good base for the other maps. For insulators, its important to keep to keep the values within the small
range that non-metals typically reflect. For metals, its important to make the diffuse black first, and then find the appropriate reflectance value. After this I will assign a
quick roughness value, usually by just sorting materials into 3 categories (shiny, middle or rough). Then I pick an albedo color, paying attention here to keep things
consistent and not too dark. I also toggle through various skies to make sure the materials are consistent in a variety of lighting conditions. Once this initial stage is over I
fall back on observation for the fine tuning these values, since every material is different, keeping in mind the concepts of PBR. At this point I like to add a basic overlay
to the normal map for materials that have a strong surface variation, such as bumpy plastic.
Its important to remember that values in the reflectance map only change when there is an actual change in material.
Generally it's important for this to be consistent throughout your project, which maps are in linear or gamma space. Its not something that should vary per asset, so
talk to your technical artist, engineers, etc if you're confused about which to use. Again, you don't need to set photoshop up in a special way to use linear space textures,
just remember to check the final result in game. There are some more technical things to consider, like if you're using gamma space specular but find a measured
reflectance value in linear space. In that case you will need to convert the values.
Lastly, all your textures do not need to be linear space "to be pbr", I've heard this before, I'm not sure what the source of this information is but its factually incorrect.
Color space simply defines how much precision is used for the darker values (more in the case of sRGB) vs a linear distribution of precision for the data (linear space).
Color space in regards to texture inputs actually has nothing to do with physically based rendering (other than the fact that you may need to convert your
measured base values - which depends on the source of said values). However, most renderers that have PBR shaders, the renderer itself is in linear space(for a
variety of technical reasons), but this is something different entirely.
Of course, as with everything, this isnt the only way to approach this and is just one method someone prefers. Dont get caught up with steps and following everything to
the letter because another approach to the above would to alter the albedo/spec map more than the metalness map, etc. Refer to the tutorial/examples
16
section for more information.
Examples
Tileable Dirt & Pebbles Texture - click here
Some Environment Textures - click here
Cutting Torch - click here
PBR Stylized Dagger - click here
Video
PBR Theory Explained - click here
PBR in Substance Designer - click here
General
UDK Physically Based Lighting - click here
Free Engines Supporting Physically Based Lighting - click here
TGA Physically Based Lighting CGFX Shader for Maya Viewport - click here
Practice
Sbastien Lagardes summary of Rendering Remember Me
Discussions
Polycount discussion on PBR - click here
Polycount PBR Texturing Process Q&A - click here
Reddit Star Citizen PBR Discussion - click here
FAQ
I dont know how to use a PBR system, will I need to re-learn how to create art content?
In most cases, no. If you have experience with previous generation shaders which use dynamic per-pixel lighting you already possess much of the knowledge necessary
to create content for a PBR system. Terminology tends to be one of the biggest stumbling blocks for artists, so I have written a section on various terms and translations
below. Most of the concepts here are simple and easy to pick up.
If your experience lies mostly with hand painted/mobile work, learning the new techniques and workflows outlined here may be more of a challenge. However, likely not
more difficult than picking up a traditional normal map based workflow.
17
Yes, absolutely. If your goal is to create a fantastical, stylized world, having accurate material definition is still very important. Even if youre creating a unicorn that farts
rainbows, you still generally want that unicorn to obey the physics of light and matter. A great example of this is Pixars work, which is very stylized, yet often on the
cutting edge of material accuracy.
Here is a great article about PBR in Monsters University: fxguide feature on Monsters University
Here is another example created by our resident stevston89 of polycount: PBR Stylized Dagger
What is all this talk about sRGB, gamma, and linear? And why is it important?
sRGB, gamma, and linear are colour spaces used when defining a certain colour. A simpler way to think about it is RGB vs CMYK. sRGB stands for standard RGB
colour space. This is basically how light/information is displayed.
sRGB is for all intensive purposes, synonymous with gamma (gamma corrected). It is of an exponential graph. 0 - 255. As an fyi, the neutral gray/mid point of a gamma
colour space is 187, not 127/128.
Linear is, as it sounds, a linear graphic. 0 - 1
Does the old workflow of baking in the AO/cavity into your diffuse and spec still apply? (source)
[AO] No. In the PBR workflow it does not apply. (Check with your respective engine/shader for more details) I leave it to the infamous Earthquake of Marmoset to
elaborate.
[Cavity] It can still be applied to the albedo and spec maps. (Check with your respective engine/shader for more details) Engines like TB2 offer the ability to input an
occlusion and cavity map with sliders to adjust its influence on diffuse/spec.
Large scale AO really should not be baked into specular (or the metallic materials of an albedo map when using the metalness workflow), or diffuse, this just does not
make much sense physically. As mentioned above, when you do that, your AO is occluding direct light sources, which is very much the incorrect thing to do. Just think
about it for a second, if you have the inside of a helmet, naturally your baked ao map would get a lot darker there right? Now, put a light source directly inside that
helmet, what happens in real life?
If that content is baked into your textures, you can never light that area correctly in a game.
Will artists need to capture photographic reference with a polarized camera system for every material they wish to create?
No, generally you will be provided with reference for common materials by your studio. Alternatively, you can find known values from various 3rd party sources, like
Quixels Megascans service. Creating your own scan data is a very technical and time consuming process, and in most cases not necessary. However there is a quick
tutorial located here.
Caution: If you have no clue what you are doing, you could potentially be pulling inaccurate values. Consult the tutorial and read through the posts for a better
understanding.
Is there a central database for material values for albedo, spec, roughness, etc?
There is and there isnt. There is from those that are publically shared and there isnt from the studios whom use their values specific to their engines. Regardless,
please do take care when using values and dont pigeonhole yourself into thinking that a value is the only value for that material.
How do I make sure I have the exact value needed for a material?
There is no exact value for any given material as in the real world, many factors influence the physical values of that item. Long story short, just utilize some base
values found online as a starting point and adjust it in small increments until it looks like the material youre attempting to represent. It becomes easier with more
practice and looking up values will be needed less.
Im new to PBR but it looks like this method of texturing is a lot more troublesome than before?
Not true in my opinion. It may look this way because this is new to you but once youve gotten used to it or know of the workflow, its actually simpler in a sense, and
quicker. You dont have to repeat diffuse details in all other maps, ensure gloss looks interesting VS spec and diffuse, etc. As well, more procedural based/material
layering software has come into the market that aid in next-gen texturing.
How come there is not more math and theory/concept in this encyclopedia?
This doc was originally compiled/made for artists to read and get a grasp on PBR. As such I guess I neglected those who were interested to know the underlying details
of PBR. For now please point your attention to the Additional Readings & References for more information.
18
rather time consuming from a production standpoint and just not as flexible/versatile. Though being able to texture manually and knowing how to would help with your
knowledge overall.
Standalone Programs
Substance Designer - Next-Gen Texturing - material layering workflow; node based; standalone program
Substance Painter - 3D Painting Software - great for unique baked textures
Quixel's Megascans - a material library like never before
Mari - a 3D painting tool
19