3D rendering basically consists of the process of creating two-dimensional images (for example, for a computer screen) from a 3D model. These images are generated based on data sets that dictate what color, texture, and material a given object has in the image.
How Does It Work
In principle, 3D rendering is similar to photography. For example, a 3D rendering program directs a camera towards an object to compose a photograph. Therefore, digital lighting is important to create a detailed and realistic rendering.
Over time, various rendering techniques have been developed. However, the goal of any 3D rendering is to capture an image based on how light affects objects, as well as real life
One of the first rendering methods was rasterization, which treats models as a polygon mesh. These polygons consist of vertices, which contain information such as position, texture, and color. Subsequently, these vertices are projected in a plane normal to the perspective (that is, the camera).
The vertices act as limits so that the rest of the pixels are filled with the appropriate colors. Imagine painting an image by first arranging an outline for each of the colors you are going to paint: that’s what rendering by rasterization consists of.
A rasterization is a quick form of rendering. Today, this technique is still widely used, especially for real-time 3D rendering (for example, in computer games, simulations, and interactive graphic interfaces). More recently, the process has been improved by increasing the resolution and by using the anti-aliasing or anti-lapping functionality, which makes it possible to soften the edges of objects and blur them with the surrounding pixels.
Although the rasterization technique is effective, it raises certain problems in the presence of overlapping objects: if the surfaces overlap, the last one that has been drawn will be reflected in the 3D rendering, causing the wrong object to be rendered. To solve this difficulty, the “Z-buffer” concept in rasterization was developed, which consists of a depth sensor that indicates which surfaces are above or below a certain point of view. This method was no longer necessary, however, when ray casting was developed.
The rays extend to each pixel in the image plane. The surface on which they strike first will be shown in the rendering, and any other intersection after this first surface will not be rendered.
In essence, the primary rays from the camera point of view are projected onto the models and generate secondary rays. Once they reach the model, they produce rays of shadows, reflections and refractions, depending on the properties of the surface. A shadow is produced on another surface if the path of the shadow ray towards the origin of the light is hindered by the surface.
If the surface is reflective, it will project the resulting reflection beam at a certain angle and illuminate any other surface with which it hits, which will generate a new set of rays.