Skip to main content
gamedev.net
🔒 Locked

quickie

Started by vrdhananjay Feb 24, 2007 at 4:48 PM 7 replies 1.3k views
Original Post
vrdhananjay
vrdhananjay
Hey, I know that OpenGl has a platform specific limitation of the size of a texture. Is there a limitation to the number of textures used in an OpenGL program ? Thanks, Dj
swordfish
swordfish
I imagine the theoretical limit would be 65535 (max value for GLuint?)

The main limitation would be a factor of available texture memory and texture size(s). 32MB means ~32 1MB textures. 64MB means twice as many. 500k textures and 64MB memory means N*2*2. Of course I could just be speaking out of my a**.
http://blog.protonovus.com/
nts
nts
Quote:
Original post by swordfish
I imagine the theoretical limit would be 65535 (max value for GLuint?)

An integer is 4 bytes or 32 bits large, so 2^32 = 4294967296 for unsigned.

You are thinking of shorts (2 bytes, 16 bits).

Quote:
The main limitation would be a factor of available texture memory and texture size(s). 32MB means ~32 1MB textures. 64MB means twice as many. 500k textures and 64MB memory means N*2*2. Of course I could just be speaking out of my a**.

Even if you run out of texture memory on the video card it can spill over to system memory and the driver will swap the textures as necessary.

As for the original question, if there is a limit it'll be platform (video card, driver, os, etc) specific. There is no hardcoded limit AFAIK (except for using up all the numbers in an unsigned int...).

swordfish
swordfish
So textures exist both in texture memory, in system memory, and even paged to disk? How did I not know that? :P

P.S.
I knew those numbers were probably wrong. My point was to illustrate where the limitation would be.
http://blog.protonovus.com/
vrdhananjay
vrdhananjay
That was indeed quick, befitting the subject i chose!

What does MAX_TEXTURE_UNITS_ARB return? I get a measely 4, surely its not the number of textures! I suspect this might be the limit for mltitextureing? Anyone want to confirm my suspicion?

Cheers,
Dhananjay
Zipster
Zipster
It's the number of texture units on your graphics hardware. 4 is pretty standard for mid-range cards, however the newer ones have up to 12, 16, and 24. If you look up ATi or nVidia on Wikipedia, they have nice tables of technical specs for all the models.
OrangyTang
OrangyTang
Quote:
Original post by Zipster
It's the number of texture units on your graphics hardware. 4 is pretty standard for mid-range cards, however the newer ones have up to 12, 16, and 24. If you look up ATi or nVidia on Wikipedia, they have nice tables of technical specs for all the models.

IIRC but texture units don't really go that high, nvidia cards max out at 8 texture units or thereabouts.

This is because a texture 'unit' in the fixed function includes both a sampler (ie. extracting colour data from a texture) and a texture coord set. With the GF FX cards and later these are separated out when using shader programs, so you may have 16 or more 'samplers' (ie. able to read from lots of texture sources) but only 8 different coord sets (which is fine, because usually you share one or two coord sets for the whole lot).
Zipster
Zipster
I'm not claiming to a be a graphics hardware expert, I was just going off the information here as well as these two diagrams, which for instance states that an X1900 XT has 16 texture units. But then again, I'm still trying to sort out all the similar terminology - texture unit, texture address unit, texture mapping unit, etc.
V-man
V-man
GLuint is typically 32 bit but on 64 bit platforms, I don't know.
Most programs will create 100 or so textures so that is never an issue. Keep in mind that you can also use DXT compression these days.

nVidia offers 4 tex units for fixed pipe.
ATI, 8.

For shaders, I think it's 8 texcoord and 16 image units.
I don't know about the 8800 but I think they implemented some kind of texture_array extension.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.