5
\$\begingroup\$

Where exactly does the cost from switching textures come from? Would it be a good strategy to just fill all available texture slots from 0 to GL_MAX_IMAGE_TEXTURE_UNITS - 1 using glActiveTexture and glBindTexture to avoid the amount of state changes?

Or is it better to minimize the amount of texture slots that are used at the same time, and rely on sorting by material to keep texture changes for each used slot as low as possible?

Also, seeing as bindless textures are available in OpenGL 4.4+, can it be assumed that they perform better in general, i.e. should I prefer changing the uniform value to point to a new texture over re-binding a texture to a certain texture slot?

\$\endgroup\$
2
  • \$\begingroup\$ This article seems to have some pretty good information on the matter: gamasutra.com/view/feature/131768/… \$\endgroup\$
    – Fault
    Commented Dec 8, 2013 at 15:31
  • 1
    \$\begingroup\$ Look into using texture atlases and array textures as well. \$\endgroup\$ Commented Jan 15, 2014 at 4:02

1 Answer 1

1
\$\begingroup\$

The 15th of this month at Steam Dev Day nVidia presented this talk.

It explain how to write a modern openGL program to minimize bottleneck and stall. If you have Dx11 hardware they propose as best solution texture array with sparse texture, using one texture array for every type/size of texture.

They also explain other techniques to minimize parameters upload and minimize drawcalls. Luckily Dx11 hardware have become really cheap.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .