<p>I am going to have the following texture drawn hundreds of times all over the screen using a 4 point GL Triangle Strip. I would use GL's dots except I need to be able to orient the texture.</p>

<p><a href="https://i.sstatic.net/35Hk6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/35Hk6.png" alt="enter image description here"></a></p>

<p>The color does not really matter as that will change every so often.</p>

<p>Technically this is not the only image. Occasionally the thing will switch to being just a dot texture. I am not sure how I will be implementing that quite yet however. Worst case scenario I will pass two textures into the shader.</p>

<p>I need the drawing of this texture to be done as efficiently as humanly possible so I need to know if there is anything I can do to make sure that this does not cause OpenGL any hiccups. If there is any good way to initialize the texture that will hold this, pass it in, or sample it please let me know.</p>

<p>I am also not sure what resolution I want this shape to be drawn at. I don't know what the relationship between texture sampling cost and resolution is. Any suggestions?</p>

<p>I considered drawing the shape inside of a fragment shader but my hunch is that it will be more expensive. But I shall see.</p>

CC BY-SA 3.0
2017-03-11T06:51:44.690Z
Do you already have code to do this? If so, have you profiled it to see what its performance is like and where any potential slow-downs might be? As it's asked right now, there are a lot of possible answers, and it's a quite broad question.
user1118321
CC BY-SA 3.0
2017-03-11T07:01:14.080Z
No because the results to the experiment will greatly affect how I design my engine. I am completely redesigning my graphics engine and I am trying to have it with my new method in mind.
J.Doe
CC BY-SA 3.0
2017-03-12T04:13:53.533Z
Are you only drawing one quad (with the texture tiled)? I think a diagram or what you want to achieve as the end result would help.
aces
<opengl><texture>
How to quickly draw multiple instances of a texture?
J.Doe
# How to quickly draw multiple instances of a texture?

(Asked by: username_0 on 2017-03-11)

I am going to have the following texture drawn hundreds of times all over the screen using a 4 point GL Triangle Strip. I would use GL's dots except I need to be able to orient the texture.

[![enter image description here](https://i.sstatic.net/35Hk6.png)](https://i.sstatic.net/35Hk6.png)

The color does not really matter as that will change every so often.

Technically this is not the only image. Occasionally the thing will switch to being just a dot texture. I am not sure how I will be implementing that quite yet however. Worst case scenario I will pass two textures into the shader.

I need the drawing of this texture to be done as efficiently as humanly possible so I need to know if there is anything I can do to make sure that this does not cause OpenGL any hiccups. If there is any good way to initialize the texture that will hold this, pass it in, or sample it please let me know.

I am also not sure what resolution I want this shape to be drawn at. I don't know what the relationship between texture sampling cost and resolution is. Any suggestions?

I considered drawing the shape inside of a fragment shader but my hunch is that it will be more expensive. But I shall see.

**Tags:** opengl, texture

> **Comments:**
> **username_1**: Do you already have code to do this? If so, have you profiled it to see what its performance is like and where any potential slow-downs might be? As it's asked right now, there are a lot of possible answers, and it's a quite broad question.  
> **username_0**: No because the results to the experiment will greatly affect how I design my engine. I am completely redesigning my graphics engine and I am trying to have it with my new method in mind.  
> **username_2**: Are you only drawing one quad (with the texture tiled)? I think a diagram or what you want to achieve as the end result would help.  

---

## 0 answers

