Hello folks! How are your molecules doing?

Today’s post is a quick one: no long derivations, no giant matrices (well, almost), just a little show and tell. This year I’ve been working as a graphics researcher at UFSJ on a comparative study of BRDFs (Bidirectional Reflectance Distribution Functions), a.k.a. the functions that tell us how light bounces off a surface. The goal is simple to state and not so simple to execute: evaluate each model for energy conservation and theoretical coherence, and then weigh physical accuracy against computational cost (ALU vs. bandwidth) to find out which ones are worth it under real-time constraints.

Reading papers only gets you so far, though. To actually validate the approximation errors and the visual fidelity of each model, I needed to see them side by side: same mesh, same light, same parameters, only the BRDF changes. Enter the Material Explorer!

BRDF Explorer

What Is It?

This is a simple project I wrote while I was studying BRDFs. It was a testbed for my studies. The idea was to make the research easier when comparing BRDF papers, as well as to understand the pitfalls of the implementation process, e.g. singularities and NDF overflows. Everything was coded in C++ using OpenGL 3.1+ and Dear ImGui, with the shading models written in GLSL, so I could tweak a parameter and watch the lobe change in real time. Trust me, this is the fastest way to build intuition about a BRDF!

BRDFs Implemented

Below is the gang, roughly in historical order: from the empirical oldies to the physically based crew. Each image uses the same scene, so any difference you see comes from the BRDF alone.

  • Phong – The classic empirical model: a specular lobe around the reflection vector, controlled by a shininess exponent. Cheap and simple, but it doesn’t conserve energy.

    BRDF Explorer

  • Normalized Phong – Same lobe, now multiplied by a normalization factor, so the amount of reflected energy stays (approximately) constant as the exponent changes.

    BRDF Explorer

  • Blinn-Phong – Swaps the reflection vector for the half vector between the light and view directions. Cheaper in many setups, and closer to how microfacet models behave.

    BRDF Explorer

  • Normalized Blinn-Phong – Blinn-Phong plus its own normalization factor. Still empirical, but now it plays nicely with energy conservation.

    BRDF Explorer

  • Torrance-Sparrow – Here comes the physics! The surface is modeled as a collection of tiny mirror-like microfacets, with Fresnel and geometric attenuation terms.

    BRDF Explorer

  • Cook-Torrance – The microfacet model that brought all of this into computer graphics. (At the time I did not get the NDF right, probably because I used an LDR buffer and clamped to [0.0f, 1.0f])

    BRDF Explorer

  • Cook-Torrance - GGX – Same framework, but with the GGX (Trowbridge-Reitz) distribution, whose longer tails give highlights a softer, more natural falloff. No wonder it became the industry standard!

    BRDF Explorer

  • Lambertian and Oren-Nayar – Not everything is specular! Lambert reflects light equally in all directions, while Oren-Nayar models rough diffuse surfaces, like clay or the Moon, which look flatter than Lambert predicts.

    BRDF Explorer
    Left: Lambertian – Right: Oren-Nayar

Conclusion

Well, that is it for today, folks! This little tool ended up being one of the most useful things I wrote this year: every time a paper claimed something about its lobe shape or energy behavior, I could just plug it in and check for myself. The full study, A Comparative Analysis of Bidirectional Reflectance Distribution Functions, is where all of this landed.

Live long and prosper!