Max Texture Size?
Blitz3D Forums/Blitz3D Programming/Max Texture Size?
| ||
Is there a guide somewhere as to what the max texture size is on any particular graphics card? I've checked nVidia's site, ATI, Tomshardware and Googled extensively... And what happens if you go over that in Blitz? Do you get an error, or does is get split into multiple textures (i.e. invisibly to the B3D programmer), or does it scale it down to the max size? |
| ||
Try this: Graphics3D 800,600,0,2 While Not endit=True size=size+1 tex=CreateTexture(size,size) If TextureWidth(tex)<size endit=True EndIf FreeTexture tex Wend Print "Max texture size: "+ (size-1) WaitKey:End It works for me--I got 1024 as the max size. What it does when you create a texture that's too large is it just goes back to your maximum size. (i.e. for me, if I create a texture that's 2000x2000, I get a texture that's 1024x1024 instead.) (Only one problem--this takes a while, I'm working on a faster version. Just assign the max. size to a variable when your program starts, if you need it--this is not a real-time calculation.) |
| ||
Thanks, that will help. I'm sure you can speed it up by changing the size increment to X2 instead of +1 (I'm pretty sure all cards do textures in powers of 2). That will tell me about my graphics card, and I could run this code at initialisation to establish the user's card, but it would be useful to see some online reference as a guide... |
| ||
You could just try to create one really big texture (1024 * 1024 should be plenty) - no need to loop through anything. |