# Minimizing draw calls: Many objects with different textures

**URL:** <https://discourse.threejs.org/t/minimizing-draw-calls-many-objects-with-different-textures/34440>\
**Category:** Questions\
**Tags:** instancing, batching, textures\
**Created:** [February 3, 2022, 12:40am UTC](https://discourse.threejs.org/t/minimizing-draw-calls-many-objects-with-different-textures/34440 "2022-02-03T00:40:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![foxtrotuniform6969](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/foxtrotuniform6969/32/23989_2.png) [@foxtrotuniform6969](https://discourse.threejs.org/u/foxtrotuniform6969)\
**Post date:** [February 3, 2022, 12:40am UTC](https://discourse.threejs.org/t/minimizing-draw-calls-many-objects-with-different-textures/34440/1 "2022-02-03T00:40:23Z")

</div>

Hello all.

I’m attempting to create a network graph in Three.js, as many before me have done. However, I have some unique requirements.

Generally speaking, so far the graph just consists of nodes and edges with the following characteristics:

- **Graph** :
  - Contains nodes and edges
  - All nodes and edges may be interacted with via the user’s mouse
  - May have it’s layout change (i.e., the positions of nodes) and these changes will be animated

- **Nodes** :
  - Are the same shape when not expanded. As such, I _could_ use InstancedMesh, except I also have the following requirements:
  - Have a unique bitmap image associated with them. Each one is different picture of a person or a logo for an organization, etc.
    - Maybe I could hide these using some LOD scheme, but its preferable to avoid it

  - Have text labels that may be expanded
    - Again, maybe I could collapse these at specific zoom levels when the graph is being laid out/animated

- **Edges:**
  - For now, they will just be solid straight lines between any two nodes.

Now, onto problems and solutions I’ve discovered:

- **Edges:**

- **Nodes** :

I’m not opposed to diving into writing shaders to solve this problem. I just need to know where to start. After looking around, it appears as though custom shaders may only render a finite set of uniforms.

Is there a good way to solve this problem? I’d like to batch the drawing of these `Nodes` and `Edges`, but I need to maintain interactivity and uniqueness as well.

Any reading material or key terms to point me in the right direction would be helpful.
