top of page

#### A Comprehensive Study In Unity3D

What Is PBR?
###### What Makes PBR Physical?

Over the past three or four decades, our understanding of the world around us and how it scientifically/mathematically functions has grown leaps and bounds. Part of this understanding has led to tremendous breakthroughs in the realm of rendering technology. Standing on the backs of giants, other intelligently tall individuals have been able to come to some serious conclusions regarding light, view, surface normal, and how all three of these things interact with each other. Most of these breakthroughs revolve around the idea of BRDF (the Bi-Directional Reflectance Distribution Function) and, inherent to that, Energy Conservation.

â€‹

In order to understand how light and your viewpoint interact with surfaces you have to first understand surfaces themselves. When light shines on a perfectly smooth surface, it will reflect off that surface in an almost perfect way. When light interacts with what we call a rough surface, it will not be reflected in a similar manner. This can be explained by the existence of microfacets.

When we look at an object, we must assume its surface is not perfectly smooth and is composed of many very tiny facets, each of which is a potentially perfect specular reflector. These microfacets have normals that must be distributed across the normal of the smooth surface. The degree to which microfacet normals differ from the smooth surface normal is determined by the roughness of the surface. The more rough the surface, the more potential exists for disruption to the specular highlight. Because of this, rougher surfaces have larger and dimmer looking specular highlights. Smooth surfaces can cause the specular highlight to compress as the light is reflected more perfectly than before.

###### To understand BRDF, it is very important to understand the 3 functions that make up a BRDF. Let's hit each of these in turn to make a shading model that will work for us.
Writing a PBR Shader: The Works
###### Piecing Together Your PBR Shader Pt.1: The Normal Distribution Function (Specular Function)
Normal Distribution Functions
-Blinn-Phong NDF

# Site Title

-Phone NDF
-Beckman NDF
-Gaussian NDF
-GGX NDF
###### The Trowbridge-Reitz approach was developed in the same paper as GGX, and produces remarkably similar results to the GGX algorithm. The main noticeable difference is that the extreme edge of the object features a smoother highlight than the GGX, which is a more harsh falloff at the grazing angle.
-Trowbridge-Reitz NDF
###### Anisotropic NDF functions produce the normal distribution Anisotropically. This allows for us to create surface effects that mimic brushed metals and other finely faceted/anisotropic surfaces. For this function we will need to add a variable to our Properties and Public Variables Sections.
-Trowbridge-Reitz Anisotropic NDF
###### The Ward approach to Anisotropic BRDF produces drastically different results than the Trowbridge-Reitz method. The Specular highlight is much softer, and dissapates much faster as the surface proceeds in smoothness.
-Ward Anisotropic NDF
-Implicit GSF
###### Designed for use with Anisotropic Normal Distribution Functions, the Ashikhmin-Shirley GSF provides a good foundation for Anisotropic effects.
-Ashikhmin-Shirley GSF
###### The Ashikhmin-Premoze GSF is designed for use with Isotropic NDF, unlike the Ashikhmin-Shirley approach. As with the Ashikhmin-Shirley, this is a very subtle GSF.
-Ashikhmin-Premoze GSF
-Duer GSF
-Neumann GSF
-Kelemen GSF
###### This is a modified form of the Kelemen Approximation of Cook-Torrance. It has been modified to produce the Keleman GSF distributed by roughness.
-Modified-Kelemen GSF
###### The Cook-Torrance GSF was created to solve three situations of Geometric attenuation. The first case states that the light is reflected without interference,while the second case states that some of the reflected light is blocked after reflection, and the third case states that some of the light is blocked before reaching the next microfacet. To compute these cases we use the Cook-Torrance GSF below.
-Cook-Torrance GSF
-Ward GSF
-Kurt GSF
###### Smith Based Geometric Shadowing Functions

The Smith Based GSFs are widely considered to be more accurate than the other GSFs, and take into account the roughness and shape of the normal distribution. These functions require two pieces to be processed in order to compute for the GSF.

Smith Based GSFs
###### The Fresnel effect is named after the French physicist Augustin-Jean Fresnel who first described it. This effect states that the strength of reflections on a surface is dependent on the viewpoint. The amount of reflection increases on surfaces viewed at a grazing angle. In order to include the Fresnel effect into our shader we need to use it in several places. Firstly we need to account for the diffuse retro-reflection, and then we need to account for the BRDF Fresnel effect.
Fresnel Functions
###### The Spherical-Gaussian Fresnel function produces remarkably similar results to Schlicks Approximation. The only difference is that the power is derived from a Spherical Gaussian calculation.
The Complete BRDF
###### Getting Unity Lighting Information Involved
Unity Lighting Data