cfmdobbie
08-08-2003, 11:45 AM
I was just wondering how much texture memory I have available in an application I'm developing, and I started trying to work it out. Does the following look right?
I have 8MB VRAM, OpenGL context is 1024x768@16bpp, double-buffered, no depth, alpha or stencil.
So the frame buffer is taking up: 1024 * 768 * 2 [16bpp/8 bits in a byte] * 2 [two buffers] = 3MB.
So (roughly speaking) I have about 5MB available for textures, right?
It's a tile-based app using 32x32 pixel tiles. For argument's sake, I'll use 256x256 pixel textures. They can hold 8x8 tiles = 64 tiles. I'll need several of these.
So, 256x256 pixel textures in GL_RGBA format. Those textures each take up 256 * 256 * 1 [one byte per pixel component] * 4 [four pixel components] = 256KB.
So I can have up to 20 of these! Does that sound right? Is the math correct, are my assumptions correct, and have I missed anything out?
Now, what eats away at this? A 16-bit depth buffer will require another 1.5MB. Display lists will use another unspecified amount. Server-side vertex caches etc will do, too.
I have 8MB VRAM, OpenGL context is 1024x768@16bpp, double-buffered, no depth, alpha or stencil.
So the frame buffer is taking up: 1024 * 768 * 2 [16bpp/8 bits in a byte] * 2 [two buffers] = 3MB.
So (roughly speaking) I have about 5MB available for textures, right?
It's a tile-based app using 32x32 pixel tiles. For argument's sake, I'll use 256x256 pixel textures. They can hold 8x8 tiles = 64 tiles. I'll need several of these.
So, 256x256 pixel textures in GL_RGBA format. Those textures each take up 256 * 256 * 1 [one byte per pixel component] * 4 [four pixel components] = 256KB.
So I can have up to 20 of these! Does that sound right? Is the math correct, are my assumptions correct, and have I missed anything out?
Now, what eats away at this? A 16-bit depth buffer will require another 1.5MB. Display lists will use another unspecified amount. Server-side vertex caches etc will do, too.