Diffuse Reflections
By Neil Blevins
Created On: Dec 8th 2024
Updated On: Dec 8th 2024
Software: Any

When light hits a surface in the real world, it reacts with that surface in some fashion. Reactions include reflection, absorption, refraction, diffusion, scattering, etc. This is simulated in raytracing in computer graphics by firing a ray from the light source, hitting a surface, calculating what color that surface is at that point (refered to as getting a shade call from the BRDF of the surface (Bidirectional Reflectance Distribution Function)), then the ray bounces to the camera and shades the appropriate pixel in your final image (in view raytracing, the ray travels backwards from the camera to the light, but for the sake of clarity I'll be referring to light raytracing for this tutorial). In the real world, this process is actually a two step process, light hits a surface, the surface absorbs certain wavelengths of light based on its material, and other wavelengths are reflected back to the viewers eyes, producing the color we see. The actual material weighs heavily in the equation, rough surfaces for example will reflect light back very differently than a smooth surface. But since most cg artists aren't interested in playing with the molecular structure of the material, many approximations and tricks have been developed to replace the actual science.

Most shaders break up your material into various properties, such as Diffuse Reflections, Specular Reflections, Refraction and Translucency to name some of the more common ones. This lesson will focus on the first of these properties, Diffuse Reflections.

Lambert

The most common Diffuse reflection type in CG is Lambertian. It is named after Johann Heinrich Lambert, who introduced the concept of perfect diffusion in his 1760 book Photometria. It is a good approximation of an ideal "matte" surface. And the brightness of this surface is the same regardless of the camera's point of view (as opposed to Specular Reflections, which are view dependent).


Here's an example of a Lambertian Diffuse Reflection.


Many pieces of 3d software create materials that are a combination of multiple shaders. For example, the Principled BSDF inside of Blender is actually a combination of several shaders...


The Base Color portion at the top is in fact a simple Lambert Shader, and drop downs such as Subsurface and Specular are other shaders mixed overtop. So even if the material doesn't say lambert, you're likely using a Lambert shader.

As a side note, you can also create a pure Lambert shader inside of Blender with a different node, which doesn't contain any other shading attributes:


Oren Nayar

The classic Lambert model makes certain assumptions, such as the surface would be completely smooth when in fact there are very few surfaces anywhere that are completely smooth. This led to the creation of other models, the most common is the Oren-Nayar model, which allows for surfaces to be "roughened", producing a better visual result than making everything purely Lambertian.

Here's the difference between pure Lambert and Oren Nayar with the roughness turned up. You can see how some of the darker diffuse color sort of leaks into the brighter part, which simulates a rougher surface.


In Blender, you can't add Oren Nayar roughness to the Principled BSDF (the roughness in that material is for your specular reflection), but the Diffuse BSDF node does have a roughness which goes from 0 to 1, a value of 1 being full Oren Nayar. So if you need to create a really rough surface like unfinished wood or rubber in Blender, use this shader instead.

Other renders like vray do add Oren Nayar roughness to its standard material.


A Note On Ambient

As well as a Diffuse color and a Roughness value, some older materials in some 3d apps have another attribute called Ambient Color.




Ambient And Diffuse Reflection

What is ambient? Well, before the popular use of Global Illumination, ambient was a cheat to give a little boost to the brightness of your objects in the shadow areas, basically it was trying to mimic fill light. But sadly, it applies itself uniformly over the entire surface, so if you have an ambient color to your material, or have an ambient light in your scene, you will never be able to achieve pure black in your render. While this may be fine for some sorts of stylization, in general, this makes your scenes look very unrealistic and flat, so my recommendation is if you are using a shading model that has an ambient parameter, always turn ambient colors to black and never add an ambient light to your scene.

Conclusion

That covers the basics of Diffuse reflections. Go to the next few tutorials in the menu on the left to read about some other material properties such as Specular Reflections and Translucency.



This site is ©2024 by Neil Blevins, All rights are reserved.
NeilBlevins.com TwitterMastodonBlueskyInstagram CaraBloggerFacebookLinkedIn ArtStationKickstarterGumroadYouTube IMDB