Don Burns (don_burns++at++peru.engr.sgi.com)
Thu, 11 Mar 1999 10:58:49 -0800 (PST)
This is a large subject with a lot of possibilities. In the Performer 2.2 or
later distribution you will find a pfuTextureManager(), which does all the
right things for managing lists of textures. It is important to understand
that if texture swapping begins to occur it will seriously hamper performance
due to a fundamental design issue in OpenGL. When a texture needs to be
removed from texture memory to make room for another, the GLhandle must be
destroyed, or the texture will actually be copied back to main memory in the
process. pfuTextureManager handles this case for you as well as taking care of
overlapping and redundant textures in separate texture lists.
There is a separate approach to managing textures which involves finding a
common set of texture sizes for multiple scenes, creating these as null
textures and loading them permanently to texture memory. In the scene to scene
fly through, texture images are then subloaded to the allocated texture memory.
This is fast and clean, but requires some set up. I've done this if you need
some example code.
To answer a couple of your specific questions:
> If an object (say a .flt model) is a
> child of a switch node and is turned off, does the texture associated with
> that model occupy texture memory?
Textures are loaded into texture memory when an object has been drawn requiring
the texture (texture memory miss). They remain resident until the space is
needed by another texture (in the case of texture memory being full), or the
space is made available by explicitely deleting the GL handle, or destroying
the graphics context.
So, the answer is, if your model has already been drawn, yes, the texture
remains resident, even if the switch is turned off.
> How is texture managed when the models are
> added to a scene which have associated texture requirements greater than the
> 64MB of texture memory available with a deskside Onyx II?
If you attempt to load more than 64 MB of texture at one time, it can affect
performance drastically. Especially if there has been no state sort and the
same textures are being swapped in and out as the scene is being drawn.
On the other hand, if you are aware of the limitations described above, use
proper state sorting, and put a bit of thought into it, you can leverage the
high bandwidth of the Onyx2 to minimize performance impact.
Hope this helps,
-don
This archive was generated by hypermail 2.0b2 on Thu Mar 11 1999 - 10:58:54 PST