Over the past two years I’ve done quite a bit of reading on Physically Based Rendering (PBR) and I have collected a lot of references and links which I’ve always had in the back of my mind to share through this blog but never got around doing it. Christmas holidays is probably the best chance I’ll have so I might as well do it now. The list is by no means exhaustive, if you think that I have missed any important references please add them with a comment and I will update it.

Linear Lighting and Shading

There is probably no point in talking about PBR, without first understanding why we should do all lighting and shading in linear space. This is why:

Static Sky Unite 2013 Presentation which describes the approach the game team followed to implement Physically Plausible Rendering on mobile platforms, baking a simplified Cook-Torrance BRDF into a lookup table and approximating glossiness using the mip levels of the texture.

There is a free Photoshop plugin for PBR material painting created by Andrew Maximov here. He also offers some PBR textures through his website.

PBR for Artists

The maths of PBR is only half the story and mainly concern the graphics programmers. The other half, of more interest to artists, is how to author the texture assets. In contrast to the first days of PBR, there are now a few great presentations that focus on PBR texture authoring.

You can also find a modular implementation of the BlinnPhong BRDF model with demonstration of the impact of each term and sample source code in this blog post (shameless plug).

Physically based lights

Physically based shading focuses on how a material responds to light that bounces off the surface in a plausible way. To get better results one should consider the type of light that shines upon the surface as well. Point lights, typically used in games, do not have a counterpart in the real world so several attempts have been made recently to model more realistic, area, lights in games.

A variety of BRDFs can easily be implemented in forward rendering architectures. Things become harder with deferred shading though due to the typically low amount of information we can store in a g-buffer. Anisotropic BRDFs are even harder to support, due to the need for a tangent vector. In many cases a single BRDF is enough to represent a variety of materials if you have the capacity to store glossiness and specular colour in the g-buffer. There are cases you might need more though. Some pointers to how people have address this problem so far:

Bake BRDFs in a 3D lookup table, each layer representing a different BRDF and within each layer addressed by (N.L, N.H). This method was used in STALKER’s deferred shading engine.

Another approach is to store Material IDs in the g-buffer and during the lighting pass branch to select the desired BRDF. This is the method used in Battlefield 3.

At Creative Assembly they use the stencil buffer to store the material ID and render each BRDF in a different pass.

And of course you can always forward render special-case BRDF materials. This is the approach followed recently by Ryse: Son of Rome to render specialised BRDFs.

Not directly related to deferred rendering, being more of a material authoring pipeline, Material Layering is receiving a lot of attention lately after Disney, Unreal Engine 4 and The Order:1886 successfully demonstrated the variety and complexity of materials that can achieve. In short, with this technique we bake parameters of a specific BRDF (that express different materials) into textures which can then be blended before the lighting pass either offline or in the shader. In The Order:1886 blending of different BRDFs is also supported albeit at a greater cost.

Importance Sampling

You will hear Importance Sampling being mentioned in the context of PBR, image based lighting and area lights, quite a lot so it is worth having an idea what it is all about. In short it is a method of sampling a function, image, cubemap etc with a set number of samples by assigning larger weight to important areas of the sampled function (or image, or cubemap). This way we can achieve better representation of the signal without actually increasing the number of samples. This method was feasible only in offline rendering but GPUs are catching up.

GPU-based Importance Sampling, a method of sampling environment maps for image-based lighting using BRDFs. Some more information about this work here. The original page is not there anymore, you can try your luck with web archive.

If you have the ShaderX7:Advanced Rendering Techniques book it is worth reading the “Efficient post processing with Importance Sampling” chapter by Toth, Szirmay-Kalos and Umenhoffer

Tonemapping

Not directly related to PBR, but when normalising a BRDF the specular highlight intensity can easily reach values above 1 and appear to burnout. For that reason we typically combine PBR with a tonemapping solution. A few pointers to get you started:

This paper which introduces the colour pipelines behind modern feature-film visual-effects and animation is also relevant.

Shader Antialiasing

Again, this topic is not directly related to PBR, but it is a shame to make all that effort to create realistic materials only to have specular highlights crawl and shimmer as the camera moves and surfaces look flatter at a distance.

Frequency Domain Normal Map Filtering, the specular AA method used in The Order:1886 is based on, calculates an NDF for each texel of the normal map using all normals from the highest-resolution mip level that contribute to a single lower-resolution texel. This NDF is then convolved with the BRDF. The produced BRDF that properly accounts for the variance of all normal map texels for a specific pixel.

In this blog post Matt published a sample application that implements and showcases popular specular AA techniques including Frequency Domain Normal Map Filtering, well worth a look.

Principal graphics programmer spending most of my waking hours making pixels prettier and faster. This blog is my scratchpad for graphics techniques I try and experiment with. The opinions expressed herein are my own.