Archive 17/01/2023.

PBR shading on Mobile

Lumak

While investigating PBR Mobile, I came across Unreal’s discussion on the topic, https://www.unrealengine.com/en-US/blog/physically-based-shading-on-mobile And investigating further, I found EnvBRDFApprox() fn already exist in our shader.

Applying the roughness gradient from 0 to 1:

edit: closer image

Applying it to my model using spec map treated as roughness map:

But I keep finding topics on how texture fetches are expensive on mobile and tried using a constant reflected value instead of a cube lookup:

This I can live with it!

The vehicle images are shown with baked bump/normal applied.

WangKai

I think comparing BPR implementations of different game engine, especially for the mobile is very helpful. I guess it would be very helpful for the guys in the community making their own games choose btw Phong and PBR.

dragonCASTjosh

So the main issue i see currently with the PBR implementation is A) the IBL reflection is not affected by roughness. But its awesome you got it compiled and running, i know that was an issue for a long time

Lumak

I had no idea IBL reflection is not affected by roughness (because the EnvBRDFApprox is a function of roughness). I actually didn’t test to see how PBR worked on a PC platform but looked through your shader code and tried figuring out how to mix the returned value from EnvBRDFApprox() with env map and specular. Results are not exact as shown in Unreal’s roughness spectrum image but I can live with it.

dragonCASTjosh

I recommend testing your changes on PC OpenGL in order to compare the results between the techniques. After they are the same / similar results then try run it on mobile. The issues with the reflections in your version is currently a big issue because its a key part of the visual results.