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?

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

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.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.