1
$\begingroup$

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

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.

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – user1118321 Mar 11 '17 at 6:51
  • $\begingroup$ 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. $\endgroup$ – J.Doe Mar 11 '17 at 7:01
  • 1
    $\begingroup$ 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. $\endgroup$ – aces Mar 12 '17 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.