Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Texture atlas and GPU instancing

Discussion in 'General Graphics' started by sstrong, Aug 10, 2022.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    In built-in RP, if I have a mesh that is almost always in the scene (say a weapon) with say a 2K x 2K texture, and I have 100s of small dynamic objects that have GPU Instancing enabled on the material, should they share the same texture?

    Or is it more efficient to have a separate small texture for the dynamic objects? The dynamic objects will all have the same mesh, material and texture.

    I'm assuming from looking at the memory profiler, that textures are only loaded once in the GPU. I'm assuming that given I already have to load the 2K texture for the weapon, it would be more efficient to share that with the 100s of dynamic objects.

    I'm also aware that GPU instancing typically is only efficient when the meshes have 256+ verts.

    So, which is the correct strategy, share the same texture, or have a separate smaller 256x256 texture for the dynamic objects? Or maybe there is a better approach...