PDA

View Full Version : Size Of Texturing



Nikki Joe
08-25-2006, 08:54 PM
Hi, it's my first post in here. I wanna ask about texturing.
when i bind my polygon with texture (jpg). the holder array can't stand about > 256x256 pixels (because i use read file structure). How can I get the solution about binding that texture (>256x256 pixel)?
Thanx

songho
08-25-2006, 10:10 PM
Nikki Joe,
Are you talking about the limit of an array size in C/C++?

If so, use malloc/free for C, new/delete for C++.

Nikki Joe
08-25-2006, 11:01 PM
Hm.. Nope. But allocate an bitmap file to array to create texture. Like NeHe Tutorial when binding texture.

08-25-2006, 11:02 PM
http://www.rush3d.com/reference/opengl-redbook-1.1/chapter09.html

i hope this helps! :)

Nikki Joe
08-25-2006, 11:04 PM
Is that because a limitation?

08-25-2006, 11:05 PM
i dunt know about that im very new but i lke opengl redbook becuz it help me to learn! :)

good luck to u nikki! :D

08-25-2006, 11:08 PM
maybe u need good c tut too? i dont know rit now but i look for u if u want :confused:

Nikki Joe
08-25-2006, 11:14 PM
thanx songho, i've read that a lot. Hm... I should create a bitmap file according to 256x256 to protect the array allocation. Am I right?

songho
08-25-2006, 11:53 PM
I thought it is about the limit of array size in stack, because 256x256 = 65536. You can allocate a memory block greater than 64K (65536 bytes) by using malloc/free or new/delete. (in the heap)

Also, OpenGL has the size limit of texture, for examlpe, 2048x2048 pixels. To make sure the maximum size of a texture that your video card supports;

int maxTextureSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);

Komat
08-26-2006, 04:36 AM
In 32bit C/C++ there is no limit on size of array or stucture on the stack other than size of the stack itself (in Windows it defaults to 1MB).

George Mihaila
02-25-2008, 01:50 AM
Hello!
I have a problem with GL_MAX_TEXTURE_SIZE. I am working on windows and before updating the driver GL_MAX_TEXTURE_SIZE returned the correct max texture size. Now it return twice the size but when I try to render the texture is not rendered. Could this be a driver bug or a software bug? I am coding in java (JOGL) on a NVIDIA GeForce4 MX 440 AGP8X graphic card (I know, it is a relative old graphic card).
Thank you!