1, random sampling
In the basic ray tracing algorithm, only a limited number of rays are traced. This is a sampling process.
There are many ways to sample:
a, uniform sampling
Example: Draw a mathematical function based on a given interval.
The interval is divided into a number of small, uniformly-spaced cells. The value of the function is calculated at the midpoint between the cells, and these points are finally smoothly connected.
In the case of a small number of cells, uniform sampling may give erroneous results.
b, random sampling
Use a random interval width instead of a uniform interval width.
You can use random sampling to draw smooth shadows; draw blurred reflections and refractions; consider depth of field; consider motion blur.
2, path tracking
The path tracking algorithm considers the global illumination problem. Previous ray tracing only considered four types of rays, and none of the rays considered the role of objects.
Indirect lighting is calculated by tracking the rays of all the paths around the intersection. To avoid an infinite number of renderings, all possible ray paths use random sampling. The light distribution of this method is usually hemispherical and the center point is the intersection point.
In outdoor scenes with skylight rendering, the path tracking algorithm is very efficient. Because the frequency of light changes in this scene is not large, that is, the function value of sampling does not change much, small-scale sampling can still obtain good results.
Bidirectional path tracking additionally tracks light from the light source, reducing the number of path trace samples.
3, photon mapping (photon mapping)
The two-channel algorithm takes into account the global illumination and reflections between objects and achieves a caustics effect.
Pass 1- Create photon map
Rays (photons) follow the light source and the photons carry a portion of the energy emitted from the light source.
When photons propagate in the scene, they may be reflected, penetrated, or absorbed.
When a photon strikes a diffusely reflective surface, maps are used to store the injected energy.
The photon map is implemented as a kd tree data structure.
Pass 2-Rendering
Use ray tracing algorithms. At the intersection, the information stored in the map is used to estimate the illuminance.
Bmor Vape,Electronic Cigarettes Vape Atomizer,Vape Electronic Cigarettes,Bmor Sober With 650Mah Battery
Shenzhen Kester Technology Co., Ltd , https://www.kesterpuff.com