I’ve been working on a nice material for the marketplace when I noticed something disturbing: I’ve added a ton of features to material that use static switch parameters to turn those features on and off. However, when I switched everything off to simulate a cheap material and checked the release stats, it was a much greater cost of a similar material that did not contain switches: 85 instructions vs 54, and they both look the same/use the same features. Is there some hidden cost to using switches that I don’t know about, or is a glitch in my version of Unreal (4.2)? I’d imagine static switches do not change at runtime, so they can remain permanent constants when compiled for final release.
If is not a glitch, that would mean I can’t parameterize too many things, and it would be much cheaper to make the features as separate materials.
NOTE: I noticed the increased instructions were for the stats related to static lighting. The dynamic lighting cost of both shaders is the same.