RoadMap: Graphics: PBR Mobile Optimizations

Hey guys, this has been on the road-map in development for really long time now, is this going ahead and whats the latest??, if one of the Unity guys can reply then it would be great. Its a shame this has not been given more priority and made it in 5.4.

3 Likes

Would like to hear more about this too…

Same here.

There a few things on the roadmap that seem to be forgotten or abandoned or taking way to long, especially mobile platform stuff.!! please guys some news.

1 Like

@KEngelstoft could perhaps share some news?

I don’t work in that area, but I’ll point someone who does to this thread.

3 Likes

Some of the “mobile optimization” related things did make it to 5.4, most notably ability to turn off reflection probes & turn off all specular calculations in the Standard shader (the two new checkboxes in the UI). This is mostly for super-low-end mobiles, that basically can’t afford these at all.

Some other things (cheaper better approximation of BRDF than what we have right now) are not ready just yet.

1 Like

Is there a reason the specular calculations and reflections cannot be baked? I’ve tried baked PBR on Android on a fairly new Galaxy Tab A and get 20 FPS on a fairly simple scene.

If I turn off the specular calcs and reflections I get 40 FPS.

Traditional diffuse lighting is fairly easy to bake since it can be just a texture. The angle something is view it is not a factor in the appearance of diffuse lightingÂą, all you need is the baked lighting texture and a texture coordinate (uv) for it to look right.

Specular lighting and reflections are by their nature dependant on the surface normal and view direction which makes baking it into a texture much harder. Technically reflections done with cube maps are a form of baked specular lighting, but they can only represent lighting that is infinitely far away (or a box, but that’s more math which you would want to be trying to avoid).

So called “matcap” (or material capture) shaders are another way to “bake” specular (and diffuse) lighting, but these have the same drawbacks as cubemap based reflections as they can only capture light directions as being infinitely far away, and unlike lightmaps they also can’t represent shadows being cast onto a surface.

One optimization method that can be used is baking a lot of the expensive calculations into a look up texture. Take some of the math and store the results in a texture that takes into account a range or two of possible inputs, like the specular reflection angle and roughness for example. Unity’s shader already does this for low end platforms.

The real problem is that the difference in performance between desktop and low end mobile is several orders of magnitude, like hundreds, sometimes thousands of of times different. So the full standard shader which is a fairly complex shader with somewhere around 200 math operations can still run on a decent desktop PC at hundreds of frames per second, and a really low end mobile phone might struggle to hit 30 frames per second with a shader with maybe 20 math operations. There are many factors in why, and the math operations aren’t the only thing they’re doing, but it’s a simple metric to compare them with.

¹ Diffuse lighting in the real world is actually dependant on viewing angle, and the desktop standard shader takes this into account in its real time diffuse lighting model. The diffuse lighting from lightmaps and the “simple” version of the standard shader do not care about the viewing angle.

1 Like

To anyone who might read this thread, as of Unity 2017.3.f1, on low-end mobile devices, you’re still better off using mobile/diffuse shaders for decent performance.

On medium performance devices, the standard shader with the Specular Highlights and Reflections checkboxes turned off should be sufficient.

2 Likes

Also, there’s the Lightweight scriptable render pipeline now :wink:

1 Like