This article is a summary of the theory and does not involve the formula.
Advantages of physical Rendering It is easy to make real and photo-level effects. The same configuration can be used in different HDR lighting environments.
The interface is simple and intuitive, and is based on real-world parameters. (Such as roughness, metal level, etc ). There is no need for art to provide empirical "strange" parameters and configurations. It is easier to solve problems and expand requirements.
Physical rendering and traditional differences The illumination mode based on physical rules has a ubiquitous Fresnel effect and the energy conservation "Energy Conservation". the reflected light on the plane of an object cannot exceed the received incident light based on the object material, and the metal and Dielectric Materials will be distinguished, micro-plane concept linear space illumination, support for Gamma Correction, HDR rendering and tonemap
Light and matter) Light is a type of transverse electromagnetic wave. The wavelength range of the electromagnetic wave is very wide, but only 390 ~ A spectrum between NM is visible to the human eye, that is, the part used for rendering coloring in graphics. In addition, because light has a wave-like binary image, sometimes we use light as photon in graphics. When light is projected onto a sensor (eyes, cameras, etc.), the color and brightness are absorbed and perceived. After the light interacts with the material, it is the color of the object. The influence of a substance on light can be described by the refractive index (Refractive Index). When the refractive index is expressed by the plural, the actual influence speed (relative to the velocity in the vacuum) of the substance can be described ), the Imaginary Part affects the attenuation (absorption) of the light, and the refractive index changes the wavelength of the light. We first classify materials based on whether the internal refractive index is even:
Homogeneous Media) A substance with the same internal density means that it has a unique refractive index, which corresponds to a transparent uniform substance (such as water and glass). It does not change the color or intensity of light, when a substance absorbs a certain visible spectrum, light is gradually absorbed along with the propagation distance within the substance, and the direction of light does not change, this is absorption ).
When the light passes through the glass and water, the direction, color and intensity will not change in the direction, but with the distance will lose the intensity (revised color), that is, the light is absorbed.
Heterogeneous substances (heterogeneous medium) When the refractive index inside a non-uniform material is very sudden, scattering will occur, and the light will be divided into multiple directions, but the total amount of light will not change. In addition to the above two interactions, the material may also emit new light due to other energy, known as self-emitting "emission". Three ways of interaction between light and matter: absorption, scattering, and light.
Light and Object Surface) In the previous section, we talked about the phenomenon that light is transmitted within a substance with different density. The most typical phenomenon in rendering is that when it occurs on the surface of an object, the scattering effect between light and air and matter. At this time, the plane scattered light is divided into two parts: the part that enters the plane (refraction, absorption or scattering in the internal propagation of the object), the part that goes out of the plane (reflection ). A plane (optical plane) reflection that assumes perfect infinite optical flat. The air and objects on both sides of the plane have their own refractive indexes, but in fact, most of the planes are not optical planes (except mirrors or lenses), but microgeometry. The surface will have irregular bumps that are larger than the visible wavelength, but it is as small as it cannot cover a pixel or sample point. Therefore, we regard this non-optical plane as a set of tiny optical planes, and the reflection of visible light, it is actually a reflection set with slight different directions at each point in the plane, that is, the microsurface theory mentioned later ).
Roughness When the plane above is relatively smooth, the surface direction changes slightly, so that the direction of the reflected light changes slightly, with a clearer reflection. The following surface is rough, the surface direction is also wide, and the direction of reflected light is also large, resulting in blurred reflection. Different roughness of the two planes leads to different reflection effects.
Diffuse and specular) Here, we describe the interaction between light and plane in two projects. The direct reflection from the plane is called the reflected light (specular), which is derived from the "mirror" of the Latin and the other part of the light, transmitted to the inside of the object, and after refraction, it is absorbed by the material (converted to thermal energy), or internally scattering, some scattered light will eventually return to the plane for refraction, and captured by the camera or eyes, called diffuse ). After the diffuse light is absorbed and scattered by a substance, it will become light of different wavelengths, which gives the color of the object. For example, if the object absorbs light other than blue, the object is blue, because the scattering chaos is relatively uniform, it looks the same in every direction, so this is different from the mirror light. You can also use the name albedo to describe it. The macroscopic view of surface reflectance and subsurface reflectance forms diffuse and specular.
Metal and non-metallic materials
The action of refraction light inside an object depends on the composition of the object, which may be divided into metal (metal) conductor, dinotice ICS insulator, and semiconductors ), because there are not many opportunities for semiconductors to appear in rendering, it is enough to simply group objects into metals and non-metals when dealing with objects. The metal will absorb all the refraction light, and it is usually high by the reflectivity of the insulator. The normal reflectivity will reach 60% ~ 90%, while the insulator is 0% ~ 20%, high reflectivity, to prevent the incident light from being sucked or refraction, so that the metal has a "shiny" appearance.
The refraction energy of a metal is immediately absorbed by a free electron rather than a non-metallic (insulator). The light will be absorbed and scattered inside the metal. Finally, some refraction light will pass through scattering, if a non-metallic refraction light is emitted from the back direction of the incident plane, the reflection of the scattered conductor spans the spectrum. Therefore, the reflection is colored, although the color reflection is rare in the conductor, but in some daily materials (gold, copper, brass), we can still see this effect, and the reflection of insulator is usually their original color, because the metal will absorb all the penetrating light, there is no diffuse, but the oxidized metal part and some surface residues still scatter a small amount of light. For these reasons, the metalness parameter can be used. Although it is not purely PBR, it is more favored by art. The diffuse color of different materials. The metallic value is 0.
Subsurface Scattering) From the preceding figure, we can see that the scattered light after refraction is emitted from different points in the plane, and the distance between it and the original incident point is also different. It can be collectively referred to as secondary surface scattered light, based on the relationship between the scattered distance and the pixel size of the incident point, there are two possible situations: As shown in the left figure, when the pixel size is greater than the distance from the incident to the outbound point, this distance can be ignored. We can think that the light emitted from this plane is at the same point, that is, the right image, that is, the diffuse reflection we often call. When the pixel is less than the distance from the output to the incident, the coloring of each point will be affected by the other light incident to another point, that is, the "secondary surface scattering" technology, it is very important that it is a physical phenomenon (both secondary surface scattering of refraction light) with normal diffuse reflection coloring. The only difference is the relationship between the scattering distance and the observation point size, it is often considered a manifestation of "secondary surface scattering". When observing at a long distance, it can be considered as diffuse reflection coloring (such as the skin of a long-distance role ), while "regular diffuse reflection coloring" also has the secondary surface scattering effect during close observation.
Ubiquitous Fresnel reflection Fresnel represents the correspondence between the reflectivity of the material and the incident angle (that is, the angle between the incident vector of the light source and the plane normal vector). That is to say, the larger the incident angle, the stronger the reflectivity, fresnel reflection items are usually
F ()
Taking the water surface as an example, there is only 3% of normal incident reflection, while the water usually is almost 100%.
One change of PBR is the correction of the Fresnel equation. This will be further explained in the next chapter with a formula. For the material, when observing with a scanning angle, a smooth object approaches the "edge" and will form a perfect mirror, that is to say, at a specific angle, "Any smooth material can become a perfect mirror ". Except for metals, the curves or gradients corresponding to the reflection and angle of most materials are not very large non-metallic reflection coefficients, and the brightness at the edge is higher when the incident angle is 0, non-metallic materials (2% ~ 8%), water and liquid are 2%, bricks are 8%, other organic materials and plastics are 5%, semiconductors and crystals are 15% ~ 50% metal 60% ~ 90% if you want to achieve the real Fresnel, the less Fresnel art control, the better. You need to provide some parameter values for use, usually gloss (or roughness) and reflectivity. A basic reflectivity is provided to set the minimum plane reflection value, starting from the minimum reflection value of the Fresnel curve to meet the needs of different angles.
Surface Reflectance As mentioned above, micro- ry has the concept of micro-plane, because from a macro perspective, when we render a model mesh, we can use a normal texture to describe small surface details, however, there will still be some shortcomings. On the plane of many real worlds, there are still some tiny sinks, cracks, or spikes, which are hard to see with the naked eye, normal textures of small to normal sizes cannot be displayed. Although invisible to the naked eye, these microscopic features still have an impact on diffuse and specular. The details of the micro-plane have more influence on reflection, that is, specular. Because the rough micro-plane disperses or blocks the reflected light from the inside, the following two items are used to describe this phenomenon:
Normal Distribution Function The direction of the plane is not evenly distributed because of the micro- ry. If it is a smooth plane with uniform distribution, the light will be reflected in almost the same direction to produce clear highlights, if the surface is rough, the highlight is blurred. the number of micro-flat points is more inclined to the normal direction of the macro plane. We call this statistical method the microgeometry normal distribution function.
D () , Unlike the fresenl equation, D () does not have a similar 0 ~ To help determine the concentration of the micro-plane normal in a given direction. Therefore, D () determines the size, brightness, and shape of the high-gloss mirror. Some D () will provide "roughness (roughness) similar to the previously mentioned) "parameter (or glossiness), when the roughness is reduced, the normal direction of the micro- ry plane will be more concentrated in the macro plane normal direction,
D () The value also increases. In addition to specifying the roughness parameter, you can also deliver a glossn map to provide higher details. Performance of Different Roughness
Specular map on the left and gloss map on the right
Geometry Function Due to the structure of the micro- ry, some plane points of the incident light are blocked internally and become the internal shadow and cannot accept the light (so the light cannot be reflected ). Shadowing and some of the reflected light is blocked inside, and their reflected light cannot be observed. Although the reflected light can be rebounded multiple times and then observed by the viewpoint, however, it is negligible in the microplane theory.
Because of this phenomenon, a geometry function is required.
G (), To represent the visibility of reflected light, so
G () Is between 0 and ~ A range value between 1. In the coloring model, it is sometimes combined with other parameters.
V () (Visiblity ). And
D () Similarly, because the micro-plane has a sense of attention, when its roughness increases, the phenomenon of shadow and masking will also increase, and the plane with a high roughness will be smoother and darker,
G () You must also receive the roughness parameter. In addition
G () It is also a basis for conservation of energy, which makes the reflected light not higher than the incident light on the plane.
Energy conservation of energy The reflected light (specular) and diffuse light are mutually exclusive, because the total amount of light that leaves the surface cannot be strongly received by the incident light, And your combination of diffuse reflection and mirror reflection cannot exceed 1
This means that if you want materials to have a high mirror reflection effect (high reflectivity), you need to reduce the diffuse reflection. conservation of energy is an important method of PBR, this allows the artist to set the reflectivity and reflectivity (highlight color and diffuse color) without violating the same physical law, from 100% to 100%, the energy conservation in the mirror reflection conversion process processes the highlights, also known as "Energy preserving specular ", generally, whether the normalization factor is used for the conservation of capabilities implemented by adding the normalization factor to the rendering equation, and the brightness of the factor is lighter in the lower left, because the above-left non-capacity conservation model reflects more light, and the lower-left capacity conservation model, the highlights become brighter and more concentrated. When the microplane theory is introduced to the coloring system, the amount of light reflected will be affected by the roughness of the plane. When the surface with a large roughness is rendered, a large range of blurred reflected light is obtained, while a smooth surface is clearer. Although the materials all reflect the same amount of light, the rough plane disperses the reflection in different directions, while the smooth plane is more concentrated. For example, if your highlight radius is increased by 10 times, the darkness will be increased by 100 times. The reflection effect of gloss changes, normal distribution function (
D () It must also be conservation of energy.
In practical applications, the materials with a lot of diffuse reflection and roughness will reflect blur and broader highlights. For materials with relatively smooth and high reflectivity, the theoretical overview of brighter and more compact reflections will come here first, this article is also based on a lot of materials. It cannot be original. There are too many materials, and the collection and description may not be comprehensive. With the addition of subsequent chapters, this part should be further modified.
Basic Theory Based on physical Rendering