Hi everyone, I have been improving the MobilePBRLigting material during this time. The purpose is to perform PBR rendering on Mobile while ensuring a certain frame rate. I decided to publish an updated version of the latest results. The following are some of my research results:
PATTERN1:
Applicable objects: objects with low metallicity and high roughness (usually metal is between 0-0.5 and roughness is between 0.5-1, among which, when metal is close to 0.5, roughness should be close to 1, and when metal is close to 0, roughness should be close 0.5). For nonmetal (Nonmetal), fully rough (Fullyrough) and intermediate state, three options can be optimized; at the same time, for SpecularMode, three optimization options are also provided.
For non-metallic objects (metallicity is between 0-0.3, Nonmetal), use Pattern1 mode (the following are all objects in the scene, Metal is 1, Roughness is 0.5), the comparison chart is as follows:
In this case, Pattern1_Nonmetal and Pattern1 are closer to the standard PBRLighting.
Only turn on indirect lighting contrast:
It can be seen that for objects with metal between 0-0.3 (ie almost completely non-metal objects), Pattern1 is very close to the standard PBRLighting in various situations (so, for scenes that only require indirect light (such as indoor games) ), you can choose the default Pattern1 mode, so the efficiency is the fastest).
Turn on direct light + indirect light at the same time:
It can be seen that due to the influence of indirect light, the overall difference is not very big.
Performance comparison: Pattern1_Nonmetal>Patern1>Pattern1_SpecularMode1_Nonmetal>Pattern1_SpecularModel2>PBRLighting.
For FullyRough objects, use Pattern1 mode (the following are all objects in the scene, Metal is 0.5, Roughness is 1), the comparison chart is as follows:
Direct light:
It can be seen that in addition to Pattern1, the remaining Pattern1_Fullrough, Pattern1_SpecularModel1_Fullrough and Pattern1_SpecularMode2_Fullrough are very close to the standard PBRLighting (actually this is completely correct, because this is not an approximate calculation, but a re-derivation of the calculation equation when Roughness=1 Simplification).
Indirect lighting:
As you can see, Pattern1_Fullyrough is the closest to the standard PBRLighting.
Turn on direct light + indirect light at the same time:
Performance comparison: Pattern1_Fullyrough>Patern1>Pattern1_SpecularMode1_Fullyrough>Pattern1_SpecularModel2_Fullyrough>PBRLighting.
PATTERN5:
Applicable objects: objects with high metallicity and low roughness (usually metal is between 0.5-1, and roughness is between 0-0.5). For the Specular part of metal objects, three optimization schemes are also provided.
In the following test scene, the metal value of the object is 0.8, and the roughness is 0.2.
Direct light:
Here, except for the color difference of the highlight part, the highlight spread is basically the same.
Indirect lighting:
Basically the same.
Indirect light + direct light:
The effect is still very close. Without looking carefully, it is even difficult to distinguish which is the standard PBRLighting.
The following is a set of comparison pictures using LearnOpenGL resources, the left is MobilePBRLighting, and the right is PBRLighting:
By using the correct mode (Pattern1 or Pattern5, and the appropriate specular mode SpecularMode1, SpecularModel2, and the default specular mode, as well as Nonmetal or Fullyrough), you can get rendering performance very close to the standard PBRLighting.
So, how does it perform on the mobile terminal?
Here are some comparison charts:
PBRLighting:
MobilePBRLighting:
PBRLighting:
MobilePBRLighting:
After turning on tone mapping:
Some guidance:
I use Mi 6x as a test machine. According to my test, it is the best to render 50000 vertices and 50000 triangles per frame (you can guarantee at 58-60 frame rate). According to different machines, please find out each frame of different phones The largest Vertices and Triangles that can be rendered. The following is another scenario I tested.
PBRLighting:
MobilePBRLighting: