So I am in the midst of writing my own path traced renderer and right now I have only implemented the old Blinn-Phong models where we separately calculated the diffuse and specular components of the material and each object had a specular and a diffuse color.

Now going towards the more general side I want to be able to render different types of objects wood, polished wood, perfect mirror like reflections etc. However all this information confuses me on how should I implement these BSDFs or in other words how should I choose when to apply a certain BSDF or maybe a combination of two?

This is usually done using a material approach. The material being diffuse, glossy or perfect specular would define which BSDFs should I use.

I read PBRT for clues and they break surface reflection into 4 types. Diffuse, Glossy Specular, Specular and retro reflective. Then they implement an enum that stores the type corresponding to these reflection.

The enum has the types

BSDF_REFLECTION
BSDF_TRANSMISSION
BSDF_DIFFUSE
BSDF_GLOSSY
BSDF_SPECULAR
BSDF_ALL
  1. The users are supposed to select a bitwise combination of the first two and the next 3 ones. Where BSDF_ALL is a combination of all the flags. This interface seems nice but there is one little confusion. If BSDF_ALL combines all flags, then this means the surface can be diffuse and specular. However this seems odd, a perfectly specular surface can't be diffuse. While Glossy + Diffuse make sense (polished wood, paint on a rough wall), diffuse + specular and glossy + specular don't make sense to me.

  2. Assuming we have solved the above problem consider an object that is glossy+diffuse like an orange or lemon skin. How do we calculate the color for this surface? Suppose I am using Oran-Nayar model (ON) for diffuse surfaces and Cook-Torrance (CT) for specular ones.

    Should I compute the diffuse component through ON and specular through (CT) then add them together? However both of these models have their own parameters which define the slope distribution for microfacet. For ON that's $\sigma^2$, the variance of the Gaussian distribution and for CT that's $m$, which wiki describes as "RMS slope of microfacets" (check respective links). Which one of these will govern the roughness of the surface?

  3. Moving on further there is a more general question. In the older models such as Blinn-Phong we used to have a separate diffuse and specular color. The specular color, from what I understand is nothing more than the Fresnel Reflectance. This is because Fresnel reflectance is dependent on wavelength. In case of Dielectrics this isn't discernable but for metals it usually is (gold gives of a yellowish tint). Hence for dielectrics the specular color would just be the plain old Fresnel reflectance replicated across RGB channels while for metals this would be the color of the tint.

    The thing that confuses me is the lingering concept of diffuse and specular reflectivity. Consider Cook-Torrance's original paper where they describe their model as.

    $R = dR_d + sR_s$

    Where $d$ and $s$ are the coeffecients for diffuse and specular reflectivity respectively and they must hold the condition.

    $d+s \leq 1$

    $R_d$ is any diffuse BRDF (they assume lambertian) while $R_s$ is their new proposed BRDF for specular surfaces.

    That's where my biggest confusion is. I was thinking the diffuse and specular colors as the object's respective reflectivities in each channel. The above equation however separates the color from reflectivity. Which concept is used in PBR?

  • Not a proper answer but regarding your second point, don't use Oren Nayar with CT - the roughness terms are not compatible. Google 'Hammon GGX' for a diffuse term that plays nice. – russ Sep 3 at 23:11
  • @russ - Must be why I haven't seen anybody using both with one another. I'm separating my point 3 into a different question which is more concerned with light-matter interactions and is a little unrelated to how I should pick my BSDFs. – gallickgunner Sep 4 at 19:40
up vote 1 down vote accepted

Although the specular term of the Cook-Torrance BRDF is widely used in Path Tracing, the original BRDF was meant initially for rasterization (it was proposed before the advent of Path Tracing). The idea of summing weighted diffuse and specular components (i.e. $R=dR_d+sR_s, d + s \leq 1$) is not capable of representing the complex results that may emerge from the interaction between diffuse and specular material elements (e.g. refraction, Fresnel for plastics, etc).

Actually, a better physically based model for material representation would be that of layers. For instance, smooth and rough conductors could be modeled through a unique layer represented by the specular term of the Cook-Torrance BRDF. Smooth and rough dielectrics could be modeled through a unique BSDF. Plastics, on the other hand, could be modeled through the use two layers: the topmost layer representing a dielectric (a BSDF) and the second layer, underneath the dieletric, representing a diffuse material (e.g. a lambertian or Oren-Nayar BRDF). That two-layer setup for plastics is capable of simulating the Fresnel reflectance of plastics (through the dielectric layer), the plastic color (through the light reflected by the colored diffuse layer underneath the dielectric), the light absorbed by the dielectric (through the implementation of Beer's Law), etc.

The layer-based material model approximates quite well what actually happens in real life. I have already written a related answer, with more details, and that may help you (I've included some references in that answer): https://computergraphics.stackexchange.com/a/5761/5681

The original Cook-Torrance does not properly conserve energy (I've already posted a question about that here). In 2007, Walter et al. have published the paper Microfacet Models for Refraction through Rough Surfaces, where they propose a Cook-Torrance based model amenable for Path Tracing.

Regarding layered material, I've implemented the system presented in the paper by Weidlich and Wilkie, Arbitrarily layered micro-facet surfaces, where a quite general layered material model is presented. After that, more sophisticated layered material models have been proposed. One of them is A comprehensive framework for rendering layered materials , by Wenzel Jakob. There is a new paper (published in 2017, I think), that supports subsurface scattering for top layers (I will add it here when I find it).

I think that PBRT uses layer-based materials too, but I do not know how they have actually implemented it.

  • Thanks for the answer. I checked PBRT and they do have multi layered BRDFs such as Ashikhmin and Shirley's. They implement plastic as a mixture of diffuse and specular BRDFs where they control both through $K_d$ and $K_s$ as I talked about in the post. This is getting out of hand. I'll ask a few more separate sub questions then return to this question again. – gallickgunner Sep 4 at 19:03
  • Ok so i read the slides by Naty Hoffman given here in the answer, and after reading that and your answer makes much more sense. Thanks for the help. computergraphics.stackexchange.com/questions/1513/… – gallickgunner Sep 8 at 8:25

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.