Performance friendly way of displaying Textures

Basically, the title. I am working on a small top down 2d shooter at the moment, similar to “Enter the gungeon”, also a Unity game. Now, i have a procedural mesh generator, generating nicely playable cave levels for my game using cellular automata. What i am struggling with, is how to actually display textures as a floor/background. The game will feature a Tiled floor with 2x2, 1x1 and maybe even 3x2 Tiles. I know how to distribute every Tile without overlapping etc, but what i need now is a way to display said Textures. I tried using the GUI.drawTexture method, but this displays textures in relation to the screen. Ive been browsing the forums a lot, though ive not found anything regarding this, same as on google itself. My question is: How would I go about the issue? Instantiate a gameobject with a Quad mesh, using a textured material? Or is there any other way of doing it?

Note: the solution does not need to have any colliders, etc, the only thing that needs to work is Normal Mapping for lighting.

If any questions regarding the Conditions appear, feel free to post a reply anyway :slight_smile:

Thanks in advance,

a struggling Unity user

Generally a mesh is rendered by passing the mesh to a Mesh Filter component, which then gets rendered using Mesh Renderer component with a material.

There’s also Graphics.DrawMesh, which draws for one frame.

I know about the rendering stuff, what i am looking for is just basically a way to display many smaller textures at once with minimal performance hit. these textures are static aswell.

As far as I know the best way to improve performance for lots of objects is to use batching.

To batch the draw calls the geometry must share a material, but you can have lots of objects share the same material with different visual properties if the shaders have [PerRendererData] properties. Those can be set per-material using a MaterialPropertyBlock.

Having the textures be static makes the process easier, as there are less requirements for static geometry.

Similarly, there is GPU Instancing, implementation is described in the docs.