Diffuse Reflection in Computer Graphics
Last Updated :
05 Dec, 2022
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.
- Lambertian reflection is the simplest type of diffuse reflection. It assumes that the surface is perfectly diffuse, meaning that the angle at which light hits the surface has no effect on how much light is reflected. This results in a smooth, even reflection without any highlights or shadows.
- Oren-Nayar reflection is a more realistic type of diffuse reflection that takes into account the fact that light doesn't always hit a surface evenly. It accounts for both the angle at which light hits the surface and the roughness of the surface. This results in a more natural-looking reflection with highlights and shadows.
- Phong reflection is the most realistic type of diffuse reflection. It takes into account not only the angle at which light hits the surface and the roughness of the surface but also the shininess of the surface. This results in a very natural-looking reflection with highlights, shadows, and specular reflections (the bright highlights you see on polished surfaces).
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.
- A shader is a small program that runs on the GPU and is responsible for calculating the color of each pixel on the screen. In order to create a diffuse reflection, the shader must take into account the angle at which the light hits the surface, as well as the roughness of the surface. The roughest the surface, the more scattered the light will be.
- Environment mapping is a technique where a texture map is used to simulate diffuse reflections. This texture map contains images of surrounding objects, which are then projected onto the object that needs to be rendered. This technique is often used for real-time rendering because it can be computationally expensive to calculate diffuse reflections using shaders.
Similar Reads
Projections in Computer Graphics
Representing an n-dimensional object into an n-1 dimension is known as projection. It is process of converting a 3D object into 2D object, we represent a 3D object on a 2D plane {(x,y,z)->(x,y)}. It is also defined as mapping or transforming of the object in projection plane or view plane. When g
5 min read
Vector Graphics in Computer Graphics
Vector graphics are a flexible and scalable way to create images using mathematical equations and geometric shapes, unlike pixel-based raster graphics. This method ensures that images maintain high quality and sharpness at any size, making them ideal for logos, illustrations, and other designs. In t
6 min read
Display Processor in Computer Graphics
Display Processor is the interpreter or a hardware that converts display processor code into picture. The Display Processor converts the digital information from CPU to analog values. The main purpose of the Digital Processor is to free the CPU from most of the graphic chores. The Display Processor
1 min read
Introduction to Computer Graphics
The term 'Computer Graphics' was coined by Verne Hudson and William Fetter from Boeing who were pioneers in the field. Computer graphics is a dynamic and essential field within computing that involves the creation, manipulation, and rendering of visual content using computers.In today's digital era,
5 min read
Segments in Computer Graphics
Introduction : Introduction segments are a fundamental concept in computer graphics, used to represent the basic building blocks of a graphical scene. They are commonly used in 2D graphics to represent lines or curves that connect two or more points. An introduction segment is defined by two endpoin
8 min read
Refresh type output devices in Computer Graphics
CRT stands for cathode ray tube. CRT it is an elevated glass tube. An electron gun at one side of the tube produces a beam of electrons which is directed towards the front of the tube or towards the screen. The inner side of the screen is coated with Phosphorus substance which gives off the light wh
2 min read
Polygon Mesh in Computer Graphics
A polygon mesh is a type of computer graphics technique used for creating 3D models. It is a collection of vertices, edges and faces that define the shape and surface of a 3D object. It is often used in computer games, animation, virtual reality, and computer-aided design (CAD). Polygon MeshA polygo
3 min read
Phong model (Specular Reflection) in Computer Graphics
Prerequisite - Basic Illumination ModelsPhong model of reflection :When we look at illuminated shiny surfaces, such as glittering surfaces, polished metal sheets, apple etc, we found a kind of bright spot at certain viewing point locations. This phenomenon is called specular reflection. Look at the
3 min read
Motion Capture in Computer Graphics
Today, we see many movies, games, animations, 2D and 3D images, and drug designing. Have you ever wondered how these things have been created and how they work? These projections replicate the same of living beings and creatures. This could done with Computer Graphics. What is Computer Graphics?Comp
5 min read
Fractals in Computer Graphics
Fractals is a complex picture created using iteration and a single formula. Sometimes, objects cannot be drawn with a given equation or with a given geometry. Examples: mountains, clouds. Their shape cannot be defined so in this case, we use fractals. So these are nothing but natural objects that ca
4 min read