What shader complexity implies?

It is basically Impossible to keep every effect with good shader complexity. I want to use some of Paragon, i tought that as they were created by a triple A company they would be optimized, and they are (LODs, cutouts, low materials instructions etc.) but some still have extremaly bad shader complexity. So… Im confused now. Even Luos that teaches everyone how to optimize effects has extr. bad shader complexity in some of his packs. Perhaps shader complexity is not so destructible like that… Or It is? Share your knowledge with me!

There’s no “good shader complexity” - it’s a constant balancing act between getting the features you need while performing on whatever platform and framerate your game is intended to run on.

Depending on the project, you may find that you’re heavily constrained by memory but not as much by overdraw. Or maybe your project allows for millions of particles in a scene, as long as they are limited in their behavior. There’s just no simple answer for what an “optimized” effect is, it all depends on your project and its technical restraints.

My current team has VFX artists follow “common sense” optimization guidelines - we don’t look at instruction count or GPU timings, we simply try to make our effects using only as many particles as we need and stick to using shaders that our tech artists have approved as performant. If you’re starting out, I think it’s a good approach to follow - only use as much as you need to get your effect looking the way you want.

1 Like

Thanks for the tips. And yes i am using only what i need to the effect looks good. But i don’t know if what i need to look good is optimized. For example, some of paragon’s fxs i remove a Lot of emitters that i don’t need (a Lot, like there are 13 originally and i use only 4). Seeking for more answers, i discovered that shader complexity is not a precise way t measure it. If you can tell me more tips, feel free! I’ll accept all of them

Whether it’s optimized or not is relative to the constraints of your project and what kind of effect it is, do you have more detail in that regard?

1 Like

Basically i am using effects from Paragon (they are free and awesome). Just making changes that i want. So i am using every material/shader epic made.

What I derive from this is, you are using just the effects, in an empty space with no context. Then they probably be performant…

What Chris is trying to ask is, in which context are you using these effects? openworld map, in a town, full of NPCs AI and weather effects? Well then you should look out if the paragon effects aren’t too much…
At the end it is a big balance act. Even if all you shaders are green in the shader complexity, it doesn’t mean the scene will run well per se. Because there are many factors at play to running a complete scene.

If you are really worried about performance, toss that shader complexity view to the side and start profiling. Look at the stats and measure how many millisecond the effects impact on the render time, until you hit you fps mark for your target plattform.

Shader complexity view is just a help to triangulate problematic areas.

2 Likes

Ray’s totally on point.

It feels bad but there’s no easy checkboxes to know whether an effect is optimized or not. It mostly comes down to figuring out:

  1. How close and at what angles will this effect be visible
  2. How many effects will be playing at the same time
  3. Using the above info, is this effect expensive enough to lower the framerate during a “worst case scenario”?

It’s really a lot of educated guessing, which is why you see studios have general performance guidelines rather than strict rules and numbers.

1 Like