Precomputing BRDF look-up tables
In the previous recipes, we learned the basic theory behind glTF 2.0 PBR and implemented a simple unlit glTF 2.0 renderer. Let’s continue our PBR exploration and learn how to precompute the Smith GGX BRDF look-up table (LUT) for our upcoming glTF 2.0 viewer.
To render a PBR image, we have to evaluate the BRDF at each point on the surface being rendered, considering the surface properties and the viewing direction. This is computationally expensive and many real-time implementations, including the reference glTF-Sample-Viewer from Khronos, use precalculated tables of some sort to find the BRDF value based on surface roughness and the viewing direction. BRDF LUT can be stored as a two-dimensional texture.
The X-axis represents the dot product between the surface normal vector and the viewing direction, while the Y-axis represents the surface roughness values 0...1. Each texel holds three 16-bit floating point values. The first two values...