Home Technical Talk

More memory or more sampler: what is better?

polycounter
Offline / Send Message
rollin polycounter
Disclaimer: Ok, I know I should simply profile this myself but I'm lazy and maybe this question is more about the theoretical aspects. 

You have:
1x Diffuse map
1x Normal map
1x Compound map (packed map out of 3 channels, for instance metal, roughness, ao)

What would you choose if you would have to add one additional channel:
  • One more texture compressed to dxt1 or similar or even a one-channel compression which then requires one more sampler in the shader
  • Add one more channel (alpha) to the Compound map - requiring a different compression and leading to more memory usage
The engine in question is Unreal if this makes any difference

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Adding an alpha channel would use as much memory as a full texture, so then it makes more sense to simply add an extra texture. At least you get 2 extra channels.
  • rollin
    Options
    Offline / Send Message
    rollin polycounter
    Hi there!,
    So at which point you would say are sampler then becoming more expensive?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Your example would be fine. A modern computer is able to handle this with ease. You shouldn't notice a difference. Adding many extra samplers would start to show. There is also shared samplers in Unreal so they should really count as one.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    Indeed,. The real hits come from effects that require many reads - triplanar mapping, pom etc   


  • rollin
    Options
    Offline / Send Message
    rollin polycounter
    Ok, thx! I'll try it out :)
  • Shrike
    Options
    Offline / Send Message
    Shrike interpolator
    From what I gathered in the last thread is that there are increased costs the higher you go, so if you use a couple texture samples its not a big deal but the higher the worse each new one gets (similar how to draw calls become an issue), around 4-5 apparently

    Also it seems like most ive seen rather use the memory than use the new sample but that probably depends on your target, on consoles memory is more important Id assume, in general it is GPU time versus memory

    Also don't forget workflow and iteration speed, thats also a factor
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    (*not a graphics programmer but I hang around them a lot)

    What shrike says sounds totally plausible to me. There's a limit to the amount of things your GPU can do in parallel and once that stack is full you're left waiting for the current instructions to finish before the next stack can start - effectively doubling the time taken to get through it all.

    Obviously the effect this has is all dependent on what else is being shoved up the GPU at a given frame, dependencies between  instructions, stalls caused by CPU submission etc. So it's impossible to put absolute numbers on anything unless you look at a very specific set of circumstances

Sign In or Register to comment.