PDA

View Full Version : Is there a way to keep vertices and textures in the graphics card memory at all times



BigShooter
10-30-2003, 12:13 AM
Let's say that I have a few objects that each have an array of vertices and each have one or more different textures. Let's assume that each one has own OnDraw() function, which binds the textures and renders the object glBegin(GL_QUADS). Now, if I have manu of those objects, are the vertices and textures send over the AGP bus each time before they are rendered, each frame? Is there a way to force to keep those vertices and certain textures in the graphics card memory?
Finally, is there a way to monitor what textures and what vertices are currently in the memory of the graphics card?
Kind regards,
Luke

TheSillyJester
10-30-2003, 12:35 AM
Look for something like glIsResident for texture.
There is nothing for vertices for now. VBO may be in VRAM, but you can't assert it.

Won
10-30-2003, 12:46 PM
If you use texture objects and vertex buffer objects, the OpenGL implementation will do a very reasonable job of giving you good performance. You can help the driver out by minimizing texture switches by sorting your draw calls on textures or vertex buffers.

-Won

BigShooter
10-30-2003, 08:10 PM
Won, are 'texture object' any different from regular textures?
I'm sorry about simplicity of this question, it was actually meant to be posted in the Beginners forum :-)

Thank you,
Luke

Won
10-31-2003, 09:24 AM
The old way of uploading textures was only through glTex{Sub}Image2x calls. Texture objects (look it up in the red book) let you assign handles to each texture, much like the way each display list has a handle. If you access your texture through the handle instead of the calls to glTex..., then the driver can tell when you're reusing an old texture vs. uploading a totally new one.

It's kind of like indexed vertex arrays versus immediate mode.

-Won