So I was just screwing around in UDK, and I made a pretty nice looking material - and then I looked at the statistics. Apparently it is 59 LightEnv shader instructions, and 114 vertex shader instructions. Which sounds afwully high?
I tried cutting out things, but it'll only affect the LightEnv figure. The vertex shader stays at 114 instructions, even if I cut down to a simple texture for the alpha and the yellow Constant3 for color.
My questions:
-Did I break something with the vertex shader?
-What are normal amounts of shader instructions for a current gen material like this? A fire in say, Skyrim, or Gears of War?
Of course, deeper discussion about shader instructions is welcome in this thread too (if it grows, I'll edit this post)
Replies
though you could easily drop down to 1 texture sample by putting both your grescale textures in to red and green of 1 texture, than masking out a channel of a texture coordniate and clamping it to get your gradient.
(these textures, btw, were just images grabbed from google - I uninstalled photoshop earlier today because it gave issues)
A baseline static color into diffuse phong model generates 38 pixel shader instructions and 33 vertex instructions.
ie this
Changing THAT material to blend_translucent instantly increases the vertex shader instructions over 100.
Don't stress about it.
The master udk character material generates 125 pixel shader instructions and 46 vertex shader instructions. Its just how and where the data is being processed.
fwiw you have a limit of 512 pixel shader instructions in SM3. I know, in part, because I hit it the other month trying to do something nuts.
The vertex shader shouldn't really be affected after you do this. I'd check your main node settings if something changes once you start plugging a lot of stuff in.
Edit: Vailias beat me to it.
Anyway - should I sort of disregard the amount of vertex shader instructions, and only pay attention to the other number (59 and 27)?
Your blend mode and material type affect it, as does anything going into worldPositionOffset.
Just set up your material how you need it and let UDk optimize it under the hood as best it can.
There are always going to be more pixels than verts to an object, and you can control your pixel shader instructions (for the most part).
Fewer is faster, but don't sacrifice quality for small gains. Materials used everywhere should be kept to a lower maximum than materials for set pieces or one offs, or even characters. Even still don't go too nuts. For most things you'd be hard pressed to get terribly high anyway.
I have a character material with masked transparency, fake sss, color bent per pixel cube mapped reflection and multiple lighting models at work and it's still under 200 instructions.
Can someone could share informations about this topic, how it looks like in 2014, on pc, X1 and ps4?
Where is maximum, optimum? How many instructions should have the "base" shader for characters, environments, ground?