MobilePBRLigting update

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:

13 Likes

Looks great!! I may integrate it into my current project :wink:

I have models that have multiple parts with different metalness and roughtness, both in full range depending on the area of the model. Which would be the patterns matching this situation?

I’ve been looking at your shader code. I’m curious why you added that many shaderlib files based on jme3 core. Did you change that much from them?

Thanks

3 Likes

Hi, joliver82.
I try to write some examples to help guide the use of MobilePBRLighting. But it has not been completed yet.
According to my experience, in most cases, Pattern5 is sufficient, and Pattern5 is the closest to the standard PBRLighting rendering effect.
Only when you need to increase the frame rate more, you can change some objects to Pattern1 mode and use it in combination with SpecularMode.
You can visually view Pattern1 and Pattern5 in the SDK scene editor to view the rendering effect of the standard PBRLighting. If you can adjust the parameters under Pattern1 to achieve a good approximation with PBRLigting, then please use Pattern1 mode, otherwise, please use Pattern5 mode.
Pattern5 rendering frame rate is not the fastest, but ideally it should be able to increase your frame rate by about 15-20.
Ideally, Pattern1 can increase your frame rate by about 30 frames.
Regarding Pattern2 and Pattern3/4, do not use them now because they are still being improved.

1 Like

The reason for this is that I will extract the MobilePBR part into Shaderlib in the future, and Shaderlib is currently consistent with the core library.

1 Like

Thanks for the explanations

I’m not in the in a performance issue still because only some of my assets use PBR but they use them somehow extensively :stuck_out_tongue: Then I’ll play with parameters of pattern1 and fallback to pattern5 if they’re not good enough as you said

1 Like

I am still looking for a better solution to achieve PBR rendering on a larger scene (200,000 vertices on a mobile terminal).
One of the ideas is that since jMonkey does not integrate a deferred rendering path, it will cause overdraft and cause the performance overhead of PBR lighting.
I also considered implementing the rendering path based on Light Pre-Pass and Tile-based Deferred Rendering.
But work is a bit busy, I don’t have time to try.
I also know that the performance of mobile MRT is not as good as PC. So I thought of some improved delay schemes.
Not yet started.

I’ll be looking for your next updates on mobile pbr

About deferred rendering, it seems like a huge project. Good luck with it

1 Like

:muscle: :muscle:

2 Likes