Open In App

Diffuse Reflection in Computer Graphics

Pre-requisites: Basic Illumination Models
 

Diffuse reflection is a fundamental concept in computer graphics that has a wide range of applications. In this blog post, we will explore the basics of diffuse reflection and its implications for computer graphics. We will also provide some practical examples of how diffuse reflection can be used to create realistic images.



Diffuse Reflection:

When light strikes a surface, some of the light will reflect off of the surface. The angle at which the light reflects off the surface is determined by the surface’s normal, which is a vector perpendicular to the surface. The amount of reflected light also depends on the angle at which the light strikes the surface, as well as the roughness of the surface. Diffuse reflection is when light reflects off of a surface in all directions. This is opposed to specular reflection, which is when light reflects off of a surface in a single direction. Diffuse reflection is what gives surfaces their matte appearance.

Rough surfaces tend to cause more diffuse reflection than smooth surfaces. This is because rough surfaces have many different angles that they can reflect light off of, whereas smooth surfaces have fewer angles. The color of a diffusely reflecting object depends on the wavelength of the incoming light and the wavelength-dependent absorption coefficient of the material. For example, a red object will appear red because it absorbs all wavelengths of light except for red (which it then reflects).



 

Types of Diffuse Reflection:

There are three types of diffuse reflection: Lambertian, Oren-Nayar, and Phong.

Diffuse reflection equation

The diffuse reflection equation is given by:

Rd = kd * I * max(0, n * l)
where,
Rd = diffuse reflectance
kd = diffuse reflectance coefficient
I = light intensity
n = surface normal
l = light vector

Assuming we have a light source with an intensity of 500 lumens, a diffuse reflectance coefficient of 0.5, and a surface that is perpendicular to the light source, the diffuse reflection would be:

Rd = kd * I * max(0, n * l)
Rd = 0.5 * 500 * max(0, 1 * 1)
Rd = 0.5 * 500 * 1
Rd = 250 lumens

Let’s say a surface has a diffuse reflectivity coefficient of 0.5 and is illuminated by light with an intensity of 100 units. The surface normal is pointing directly towards the light source, so n * l will be equal to 1. The diffuse reflectance of the surface will be:

Rd = 0.5 * 100 * max(0, 1)
Rd = 50 lumens

Advantages:

One of the advantages of diffuse reflection is that it can help to create the illusion of a more three-dimensional object. This is because when light is reflected off of a surface, it creates shadows. By using diffuse reflection, these shadows can be softened, giving the object a rounder appearance.

Another advantage of diffuse reflection is that it can help to create an even coloration on an object. This is because all of the light that is reflected off of the surface is scattered in different directions. As a result, there are no areas that appear significantly lighter or darker than others.

Disadvantages: 

There are several disadvantages of diffuse reflection that can impact the quality of computer graphics. One significant disadvantage is that it can cause “graininess” or “noise” in the image. This occurs because the light is scattered in many different directions when it hits a diffuse surface, which can result in a loss of detail and overall degradation of the image. In addition, diffuse reflection can also cause “washed-out” colors and decreased contrast. This is because the scattered light tends to wash out the colors and reduce the contrast between light and dark areas.

Diffuse Reflection in Computer Graphics:

In computer graphics, diffuse reflection is the most basic form of reflection. It occurs when light strikes a surface and is scattered in many directions, giving the impression that the surface is rough. This type of reflection is what gives an object its matte finish.

There are two main ways to implement diffuse reflection in computer graphics: through a shader or through environment mapping.

Article Tags :