Shader Complexity, expected values, and what we should expect.

I’ve been working extensively with Meta Quest hardware the last year, and beating Shader Complexity down to manageable numbers has been a consistent task, and I’ve seen other people asking a lot of questions regarding it.

Well, it’s got me stewing on a question.
The MaxShaderComplexityCount value that the filter uses can be edited in your ini files.

So should we be getting a list together of target shader complexity values for different hardware and shader models?

I haven’t been able to find anything that really delves into what we should be targetting, how it differs between platforms, and even editing the values feels arbitrary.

As best I can tell, shader instructions are calculated VERY different depending on what kind of rendering you’re doing. I’m not a rendering engineer, but this project has necessitated learning a lot about it.
For my project, I’ve stuck the value around 2500. The game runs performantly with that, at least for now.

Is anyone else digging into this? What numbers are you working with?

I don’t have the answer to your direct question about targeting an overall shader complexity, but I will confirm for you that Forward Rendering bumps the numbers up quite high and Deferred Rendering makes the number lower. That is to be expected.

Keep in mind that you can have a small portion of pixels on the screen have super high instruction counts (a glass window or fancy effect) and you won’t necessarily kill performance if everything else is in check. Do some performance profiling with what you’ve got, make sure your shader complexity is your bottleneck (like maybe you have too many draw calls and the GPU is just sitting around waiting).

Some common hacks for VR performance include making everything Unlit and faking the lighting inside the material. You can also hit the checkbox for Fully Rough in the material to take that out of the equation. Don’t use Two Sided.

Hopefully some other mobile VR devs share their average shader instruction counts to help you feel more confident about what you’ve got.