2
\$\begingroup\$

Im using modern opengl and c++.

How do I draw a number of triangles each one having a different texture in one draw call when I only have 32 texture units on my graphics card and the max texture size is 1024? My video card has 2gb of memory yet it can only hold 32 texture at a time?

Why do graphics cards have this limitation? I'm a c++ programmer and in c++ you don't have restrictions like that. The only restriction that you have is how much RAM you have which is fine.

\$\endgroup\$
6
  • 4
    \$\begingroup\$ Is this a question, or a rant? VRAM is not just for textures, it's also for models \$\endgroup\$
    – Bálint
    Dec 8, 2016 at 6:56
  • 1
    \$\begingroup\$ Hint: don't draw them in 1 draw call. \$\endgroup\$
    – Bálint
    Dec 8, 2016 at 6:56
  • \$\begingroup\$ Its a serious question. In my mind the memory of a graphics card(2 gb in my case) should be able to store textures and models however i like. Not to have a limitation of 32 textures. \$\endgroup\$ Dec 8, 2016 at 7:13
  • \$\begingroup\$ 32 textures is a lot, if you need more, then you obviously do something wrong. \$\endgroup\$
    – Bálint
    Dec 8, 2016 at 7:52
  • \$\begingroup\$ You don't have a limit of 32 textures. You can load hundreds or thousands of textures if you wish. What you have a limit on is the number of simultaneous textures you can use. \$\endgroup\$ Dec 8, 2016 at 20:22

1 Answer 1

2
\$\begingroup\$

Modern GPUs have hardware translation tables that bind a 64-bit integer to a texture (called a texture handle). This is the new way to bind textures to a GPU as opposed to only binding a texture to a texture unit which is more limited because textures units are available in a limited number. This is referred to as bindless textures.

Also for the maximum texture size, there are sparse textures (or virtual textures) that expose a way to fit very big textures (even bigger than the VRAM available) by using the virtual memory technique (as used in OSs). It enables just loading the needed parts of a texture when you need it while keeping the rest on disk. It's used in several engines and games that have open worlds.

\$\endgroup\$
0

You must log in to answer this question.

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