This is a speed question, I have a texture, which is 2048 per 2048, the texture is designed to run in big resolutions (1920x1080 for example).

The problem is, that the texture have a size of 10MB in bitmap, is too heavy, I don't know if that's a good size for load it in gl and use it in a game...

Is there any problem to use a 10MB texture in an OpenGL Game?

  • 1
    \$\begingroup\$ "Too big" for what? Are you asking about whether it'll fit, whether it'll hurt performance, whether it'll cause some other kind of problem? \$\endgroup\$ – Trevor Powell Feb 25 '13 at 23:45
  • \$\begingroup\$ Talking about the speed of opengl and the VRAM, RAM, video card, etc... \$\endgroup\$ – Spamdark Feb 26 '13 at 0:24
  • 3
    \$\begingroup\$ A typical gaming class GPU now has a gigabyte or more of dedicated memory on-board. Do the math and figure out what makes sense. Also remember that GPUs support hardware texture decompression of the DXT/BCn/S3TC formats, which can reach compression ratios of 6:1. \$\endgroup\$ – Promit Feb 26 '13 at 2:33

First off, don't measure the amount of video memory used by the image by the disk size of the file. There's a similar question here which covers the topic and I've linked to a very good answer that will cover most ground on how you should measure VRAM usage accurately. As a quick guideline though, it depends on the size and amount of colours in the image and how the image is saved and packed.

With this in mind, the image might be a lot smaller than you anticipated or bigger - it would be up to you to check this out. At any rate however, as long as you're not loading a bunch of those textures into memory you would probably be okay but it's a game specific thing. With todays video cards having 1GB + of VRAM, it's trivial to load a few of those textures into memory if that's what you need. It also depends on your target audience and what kind of hardware you expect them to run this on.

So in short: Run with it if you think you need; optimize it later if you need.

  • 1
    \$\begingroup\$ Also check glGetIntegerv (GL_MAX_TEXTURE_SIZE, ...) to ensure your GL implementation is able to load it (you should have no problem here unless you've got really ancient hardware going back to almost 10 years old, but it's good practice despite that). \$\endgroup\$ – Maximus Minimus Feb 25 '13 at 23:34
  • \$\begingroup\$ Using this question... a lot of vertex inside a buffer (spheres ... etc) is normal? \$\endgroup\$ – Spamdark Feb 26 '13 at 1:28
  • \$\begingroup\$ It depends on the level of detail in your game world in relativity to what you're trying to accomplish. If you run into performance issues - run a profiler against your code and find the bottlenecks. :) \$\endgroup\$ – Vaughan Hilts Feb 26 '13 at 1:43

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.