Dbuffer and mesh decals on mobile not a good choice (high shader complexity and other issues)

While playing with the really nice Greenwood Fantasy Village Marketplace asset, trying to do a little mobile game, I want to share some experiences I made with reducing complexity from overdraw and with Decals.

Overall, I am fighting with performance issues, because of my old Phone with Mali T860 chip. But I believe, using old hardware is good for learning performance tuning and profiling. While it is running with 60fps on a friends Pixel4a (rather boring)- it drops to 8fps on my phone. Doing a lot on this, e.g. culling optimization.

First, I tried to change some meshes to be more optimized in terms of overdraw, after finding, that shader complexity, while shown as green in SM5 preview, is bad in ES31 preview.

Changing the mesh for the hay that floats above ground from a simple quad to some more optimized shape reduces overdraw a lot:

Same applies to the trees, which I did change as well. What is interesting: in SM5 preview, shader complexity is shown green, while in ES31 preview, it becomes expensive.

So this one does not really help actually, and my limits seem to be elsewhere. (Unfortunately, no GPU profiling data is available on mobile at all to see what is exactly happening)

Now for the next step with Decals:

I thought, I could go further and optimize this one by using real decals projected on ground instead of those planes. Creating everything with a dbuffer decal material and testing now shows the following:

So result: using dbuffer decals is even worse than using the mesh in terms of shader complexity.

I tested with mesh decals as well, using the example asset available in Epic docs, same here:

Apart from this, I found, that dbuffer decals do not get rendered nicely in ES31 / Android device:

  • CSM Shadows do not get received by the decal on mobile
  • Colors look as if they are unlit? - at least pale coloring

Compared to SM5 preview, which looks nice:

1 Like

You can create a plane set to MASKED and have it floating slightly above ground. That would essentially have the same effect and fix your issue.

Hi, thanks for the reply. Yes, that’s what the original assets are doing, see the first 2 images - having the plane (second one optimized for less overdraw) with masked transparency. I just thought, that using decals would make things better, but they actually turn out to make things worse.

Decals are heavy, its basically a translucent material. Stacking several on top of one another will have a performance hit, unfortunately

1 Like

What is interesting: I understand, that overlapped transparent parts increase the performance cost - as can be seen with the overlapping masked quads.

But I only have one single decal, nothing is overlapping, and, what is interesting: it is the non transparent parts, that have such an exploding cost. As you say, the translucent blend mode somehow seems to make things really bad here. I wonder, why the blood decal in my example above is so much cheaper.

My tests and your confirmation definitely show, that decals are not the way to go in this case. While for SM5 on PC the decals should be fine when looking at the shader complexity.

Thank you for sharing your thoughts.