Some time ago, I read the paper and saw the concept of Bent normal. I found some relevant materials to learn about it. Bent normal is common in offline ambient occlusion rendering (Chinese translation should be called the environmental law line? In some cases, it can be seen from the literal meaning that it is also normal, but it is modified and deformed (Bent ). How is this bent calculated? What is the usage of this bent normal? Here is a brief introduction.
What is bent normal?
First, we know that the surface method vector of the geometric model is a required information element for rendering equations of any reflection model. Bent normal is the new vector after the original normal is modified. It points to the average direction of the current pixel that is not blocked by other objects (or ry element, that is, the main direction of light input. It is known from some that it is related to ambient occlusion. The formula is as follows 【Method 1]:
Which is the current vertex.XInWVisibility, that is, whether it is blocked. This formula is basically the same as the ordinary AO formula. Using Monte Carlo points to discretization, a feasible bent under finite sampling can be obtained.
Normal calculation formula.
Bent normal sampling (we can see that bent normal (yellow) is trimmed to the right when considering the distribution of surrounding geometric elements compared with the original normal (blue)
What is the use of Bent normal?
Bent normal can be used in two ways:
- It is used to change the original normal state and record the main direction of light. In this way, we can calculate the sampled light from a more optimized direction during Environment texture sampling.
- It is used to perform normal shading instead of the original normal, so that the soft shadow effect similar to ambient occlusion can be obtained to a certain extent even if only normal is used.
How to calculate bent normal?
Bent normal is calculated in two ways;
- The first method is the traditional offline sampling method. The operation here is the same as the traditional offline ambient occlusion calculation method. sampling is performed at each point on the surface of the scenario and computing 【Method 1] Monte Carlo points to calculate the bent normal under scenario occlusion.
- The second method is a popular screen space-based method based on various image algorithms. Its advantage is that it is fast and Its disadvantage is that it is not accurate. In order to get real-time AO computing in the game, many ssao Algorithms Based on screen space are proposed, while AO computing is related to bent normal computing, therefore, the common ssao post pass can be used to quickly calculate the bent normal without excessive extra costs (however, a normal buffer sample will be added or avoided in an appropriate way ). The specific operation is similar to AO's calculation, except that the corresponding AO
Convert the value to the normal offset.
The following figure shows the comparison between the original normal and bent normal (the generation of Bent normal adopts the offline Monte Carlo algorithm for computation, and the wood has an optimized sampling mode, so there is a noise mark ):
From the above normal comparison, we can see that for a normal surface with a curvature greater than or equal to 0, its bent normal is no different from the original normal, when the scene is displayed, It is not blocked by other geometric elements. For the concave surfaces, Bent normal will modify the original normal, when performing ssao operations in these places, the corresponding AO will also be generated.
The two are rendered using normal & Bent normal: