Generally, three types of light sources need to be considered in computer graphics, namely the point light source, the concentration light source and the direction light source. Each type of light source describes different types of light seen in daily life. For example, a light source can be any light source that emits light in all directions from a distance, such as a light bulb. A light source emits light in a cone, such as a flashlight, while a light source emits light in a specific direction, however, the light source cannot be identified.
Note]
Different from vertices and focal points, there is no such light in the real world. On the other hand, in computer graphics, they do exist and can be calculated by mathematics.
1.
Point Light Source
As mentioned above, a point light source is a light source that emits light in all directions at a certain distance. With a certain distance of light propagation, it will lose a certain amount of energy and the brightness will gradually decrease. You can think of a light source as a light bulb, candle, or anything else that emits light at a certain distance. The Point Light Source looks comfortable in 3D scenarios because it is often used.
2.
Concentrating Light Source
Concentrating light sources scatter energy at a certain distance (similar to a point light source ). The difference with the point light source is that the concentrating light source emits light to 3D scenes through a cone, rather than emitting light in all directions. Some concentrating light sources, such as flashlights, sports ground lights, searchlights, and headlights, are difficult to implement and consume more processor resources than the lighting source. Although resource-consuming, they seem quite comfortable.
3.
Direction Light Source
In computer graphics, the third type of light is called a direction light. These lights appear in a certain direction without a specific light source (organizer: similar to sunlight ). In real life, all light sources have a source point that generates light, but it is also possible to generate a light source without a source point in computer graphics. In the Light computer process, the light source can be realized through several mathematical calculations. These light sources do not look very real, but they are used to render simple scenes and simple shapes.ProgramIs sufficient to meet the requirements.
3.1.2
Reflection Model
The Reflection Model describes how an incident occurs on an object surface when the light is directed to a specific surface. When some light is reflected back into the scenario, some light energy is stored. These surfaces are also called materials. The materials are only some properties that describe the full response method made when the materials are exposed. Changing these properties will produce different effects, such as different reflections on wood and plastic surfaces. There are many different Reflection models in computer graphics, but the most common models are the environment light reflection model, the diffuse reflection model and the mirror reflection model. The reflection model and attributes determine the appearance of objects in 3D scenarios.
1.
Ambient light reflection
Ambient light reflection describes the light without any direction in the scenario, but it can be seen from various places. Because light is reflected back from each surface, it is difficult to identify the original position of light. Ambient Light tries to simulate global lighting, which is the total amount of light that is formed after the light is reflected multiple times from the scene surface. Ambient light reflection of materials describes the amount of light that is reflected back from the surface to the scene. The amount of light reflected becomes the actual color of light. When the light is reflected off the surface, it is reflected along a certain direction. A part of the light enters the eyes of the game player so that the player can see the surrounding environment.
2.
Diffuse Reflection
The diffuse reflection model describes how light is reflected in the same direction from the surface. This means that if you look at an object that is only illuminated by diffuse reflection, the object looks the same from all angles. The diffuse reflection is visually independent and changes only when the object moves or the light moves.
When the light emits on the scattering surface, it is reflected in multiple directions. The smoother the object, the smoother the reflection light scattering. Except for the shadow area of an object, the object looks the same from all angles. This occurs because the light is uniformly scattered in all directions, so the amount of light received from one angle can be the same or very close to that received from another angle.
When light is strongly reflected from the surface area, a bright area is visible to the human eye. These bright areas can be as fine as the counter surface, or extremely extreme as they are on metal balls or glowing soft beverage bottles. Because light produces strong and different reflections on each small part of the surface, if you change the angle of observation or the position of the light source, the object will show a different appearance. You can try it yourself. If you observe a plastic bottle, you will notice that the actual bright area depends on the position of the light, the observed position, and the actual shape and details of the bottle. If you rotate the bottle, the light area will change. Similarly, if you move around the bottle, the same situation may occur.
When talking about light, mostAlgorithmCan be classified into two categories. They are either vertex-level illumination or pixel-level illumination. Vertex-level illumination is used to calculate the illumination equation of each vertex, while pixel-level illumination is used to calculate the illumination equation of each pixel on the screen. This is a common problem in real-time illumination computing. Vertex-level illumination is a lighting technology used by graphic APIs in direct3d and OpenGL. It completes vertex-level illumination through an algorithm called "BlinN-phong illumination.
Not all illumination in a scenario must be completed in real time. In fact, there are a lot of preprocessing techniques that can be used to achieve surrealistic images. The disadvantage of preprocessing technology is that real-time illumination is not allowed, because computing is performed before the actual program is run. The results are saved as files and read out as needed. This means that the environment of the object must be static. This is because the real-time use results are required. Therefore, every time a light or object moves, it has to be recalculated. Of course, this is impossible, because the computing capability required is far beyond the computing capability that can be completed by a single animation. An example of preprocessing technology is the so-called "illumination textures ". A lightmap is a specially created image that is added to a scenario and used to simulate illumination and shadow. It is used in many games such as quake (Raytheon) and rainbow6 (Rainbow 6) this preprocessing technology is used in the series of games.
Shadow is also an important feature that can add significantly more realistic layers to the scene. Shadow in computer graphics is a wide area of research that involves many different algorithms and methods for implementing shadow. There are many ways to implement shadow in direct3d, but it is not easy to calculate them. The direct3d method does not contain any of these methods. An available shadow algorithm technology is called "Shadow Paster", which is very popular among computer programmers. Shadow creates real-time shadows for dynamic objects and light sources. You can observe an object named "Deep cache" from the light angle and map the result to the scene in the form of a large image to implement a shadow texture.