Hello everyone,
I am here because I’m struggling with a curiosity about Unity’s handling of Graphics API calls. I have a previous game that didn’t use instancing for its props and a current project that make heavy use of this to reduce draw calls. While the reduction of draw calls works I discovered that in our current project Unity resends textures to the GPU for EVERY draw call even if the shader and material are the same between both draw calls. The texture is just a texture atlas which we use in both projects and is the same resource for all materials.
In the old project only the first draw call of any material sends over the textures. In the new project we have resource bind calls for every draw call. I wonder why this is happening and if anyone knows how to resolve this.
For the old project we used MeshRenderers. In the new project we use RenderMeshIndirect. By doing so with proper draw call management I was able to reduce the drawcalls at an example position in the game from 2500 to just 600.
Compared to the old project, the resource bind calls went up drastically from 286 to 4076 of which 2322 are Texture 2D binds.
Old project:
New project:
I appreciate all ideas!