Home Unity

Most Efficient Way to Handle Large Amount of Textures

overhira
polycounter lvl 3
Offline / Send Message
overhira polycounter lvl 3
Hey All,

I'm looking into ways to most efficiently handle a large amount of tiling environment textures that will be shared across a large amount of environment objects. What are the best ways to tackle this?

I'm currently mulling over packing 512 textures into an 8k atlas. This would give me 256 different textures to work with (roughly 85 different materials - 3 textures per material).

I've heard that Texture Arrays are also another way of handling this, but don't know a lot about them. Is there a better/more efficient way to handle a large number of texture assets?

Replies

  • McDev
    Offline / Send Message
    McDev polycounter lvl 2
    Hi. First of all you should think about if you really need that many textures. Maybe it is possible to work with other techniques like blending several textures together. Anyway sometimes you need that many textures.

    Texture Arrays are a good solution and it would be much easier to handle than an atlas texture. Also with atlas textures you might run into seam and tiling issues. Your mesh and uv has to be layed out to tile an atlas map, with an texture array you can tile as usual. Also 8k, even 4k is not supported on all GPUs.

    You would just need a custom shader that supports texture arrays. Not sure though if there is a limit to texture size, but from what I heared 256 textures is possible.
    Also you need some kind of splatmap to identify the texture, a.g. a seperate texture or vertex color.

    The downside is that you need all that textures in ram of your gpu. It would be best to know upfront if all of those are required.
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    What kind of game is this for. Its relevant to an answer
  • RyanB
    You should profile the game before you do anything drastic. 
  • overhira
    Offline / Send Message
    overhira polycounter lvl 3
    McDev said:
    Hi. First of all you should think about if you really need that many textures. Maybe it is possible to work with other techniques like blending several textures together. Anyway sometimes you need that many textures.

    Texture Arrays are a good solution and it would be much easier to handle than an atlas texture. Also with atlas textures you might run into seam and tiling issues. Your mesh and uv has to be layed out to tile an atlas map, with an texture array you can tile as usual. Also 8k, even 4k is not supported on all GPUs.

    You would just need a custom shader that supports texture arrays. Not sure though if there is a limit to texture size, but from what I heared 256 textures is possible.
    Also you need some kind of splatmap to identify the texture, a.g. a seperate texture or vertex color.

    The downside is that you need all that textures in ram of your gpu. It would be best to know upfront if all of those are required.
    Thanks for the overview. A lot of good things to consider! The plan is to use texture masks to splat various textures (either from an array or atlas) on large environment surfaces. The game world is large, but hasn't been specifically defined due to still figuring out technical limitations. I'm thinking about scale-ability/options with a lot of head room in terms of number of textures - hence the appeal of 256 textures.

    What kind of game is this for. Its relevant to an answer
    Without getting into too much detail, the game is a large scale world in VR. Any other details that would be relevant to mention?
  • Mehran Khan
    Offline / Send Message
    Mehran Khan polycounter lvl 9
    For masks you don't need rgba/rgb images, you only need a single channel per mask, meaning you can stack up to 4 masks in a single image i.e one per channel in an RGB/RGBA image. But you will have to write a custom shader for this but it's fairly simple with amplify shader editor/shaderforge, but the payoff is uuuuge.

  • Mehran Khan
    Offline / Send Message
    Mehran Khan polycounter lvl 9
    Some texure maps can also be re-created by multipying a single color with the greyscale version of the original map(grass,sand),Do this as well where possible and you can than pack that greyscale version of the map just like an alpha/mask.
  • Eric Chadwick
    Some examples of this in action over in my Sketchbook, if it helps.

    http://polycount.com/discussion/comment/2490402/#Comment_2490402


Sign In or Register to comment.