Home Unreal Engine

How many instructions are to many?

polycounter lvl 9
Offline / Send Message
shxsy polycounter lvl 9
Before you answer... I know....'It depends'. On many things. But as I browse through materials in UDK, I notice that a lot of them have many instructions... It seems like many of them average between 50-90. I'm transitioning out of UI into VFX and am really looking for some general guidelines for building materials for VFX and the specifics around that. Anyone have any good rule of thumb(s) or guidelines? I do realize that these are per project, but I'm looking for an assessment that might come from a graphics engineer/TD?

Thanks Polycount!!!

Replies

  • Lazerus Reborn
    Options
    Offline / Send Message
    Lazerus Reborn polycounter lvl 8
    I think at the end of the day 100>* is best guide. What you should be thinking is, how can i do this with the least amount of instructions. Be efficient and as long as it does it's job i can't see much of an issue.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Absolute basic instruction count for a solid color diffuse is in the 30-40 neighborhood.

    Also not all instructions are equal. An add is different than a square root.

    So its hard to say. However there are hard limits.

    512 (I think) for SM3 (Direct x 7-9)

    4096 for SM4 DX 10+

    I just made up a shader with about 1200 instructions... needless to say its for research more than anything else.

    So you can easily hit 150-200 and not worry, especially if you actually need it.
  • Xendance
    Options
    Offline / Send Message
    Xendance polycounter lvl 7
    Also, acceptable instruction count depends on how visible the material will be on screen. For example a costly terrain material can eat performance quite a bit since there are so many pixels to shade.
    I think at the end of the day >100 is best guide. What you should be thinking is, how can i do this with the least amount of instructions. Be efficient and as long as it does it's job i can't see much of an issue.

    I just have to point out, that you said "greater than 100" :P
  • mAlkAv!An
    Options
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    Another thing to keep in mind is that the instruction count depends on the lighting as well. Materials for dynamic lighting ("Used With Static Lighting" unchecked in the material properties) will have more instructions. If it's for static lighting make sure to uncheck "Allow Lightmap Specular" which is on by default and adds ~16 instructions.
    For smooth LoD transitions you would need to enable " Screen Door Fade" which also adds a bunch of instructions. In case you use DX11 all materials will have significantly higher instruction counts as well.
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    On Fable: The Journey, we had a few materials clocking as high as 300 instructions. Ultimately the instruction count is not that important, it's how you're using what you have.
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    There's a lot of good advice in this thread, and yes as Valias points out some instructions cost more than others. This depends specifically on what kind of hardware this will be running on. For example, using a rotator isn't necessarily a lot of instructions, but it would DESTROY framerate on a 360 / PS3 with lots of particles.

    That said, this was my personal & unofficial guideline I used while doing VFX on MK & Injustice:

    6-11 Instructions - Ultra Cheap
    12-20 Instructions - Cheap
    20-35 Instructions - Mid
    36-65 Instructions - Expensive
    66-90 Instructions - Very Expensive
    91+ Instructions - Crazy

    When working in realtime VFX, it's also important to note that fillrate/overdraw is critical to performance and can be just as important to performance. They have an interesting explanation over on UDN:
    Overdraw = Pixel shader cost = Number of layers * avg number of pixels affected by a layer * avg number of instructions for a layer

    Balancing performance as a VFX artist can get tricky, as there are many factors that balance the equation.
  • Santewi
    Options
    Offline / Send Message
    To add to what imbueFX said, it really depends on how big and how many particles there are on the screen.

    You could make a choice between having a lot of simple particles, or having a few more complicated ones.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Also keep in mind that transparent objects, like water or smoke, will cost more per-instruction because they are drawing over the top of another shader. So for these kinds of objects you should try to be extra careful.
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    Absolutely. Unreal in particular doesn't handle layers of alpha particularly gracefully - it can often be better to use more triangles to better fit your geometry to your textures in a lot of cases.
  • shxsy
    Options
    Offline / Send Message
    shxsy polycounter lvl 9
    Thanks for all the advice everyone. Excited about my transition, but realize there is a ton to learn on the technical side of things.
Sign In or Register to comment.