locking textures?
Is there any way you could ''lock'' the texture in vidmem so it would''t be necesary to transfer it from main memmory every frame. It would be very useful if I didn''t had to switch(upload) textures 100 times each frame. Since I have only for about 2mb of textures so space(vidmem) wouldn''t be a problem.
There are more worlds than the one that you hold in your hand...
You should never let your fears become the boundaries of your dreams.
I''ve got got a bit of DDraw experience and here''s a bit of my knowledge (for what it''s worth , anyway
):
You don''t want to perform pixel-array ops (locking-unlocking) on textures (surfaces in DD) that are in vidmem: for EACH operation on the data, the data has to come from the vidmem, be operated on, then go back to the vidmem. You''ll actually be better off to get the texture into sysmem, operate on it, then copy the result into vidmem.
![](smile.gif)
You don''t want to perform pixel-array ops (locking-unlocking) on textures (surfaces in DD) that are in vidmem: for EACH operation on the data, the data has to come from the vidmem, be operated on, then go back to the vidmem. You''ll actually be better off to get the texture into sysmem, operate on it, then copy the result into vidmem.
(nvidia related)
check out some of the new nvidia extensions.
also
cass everitt
>>For NVIDIA hardware, in release10 drivers and beyond, glCopyTex{Sub}Image2D() only updates the on-card texture -- if the formats match closely enough for a "fast copy". If the texture ever has to be evicted, you pay for readback then. That way you may never have to pay for readback<<
http://members.xoom.com/myBollux
check out some of the new nvidia extensions.
also
cass everitt
>>For NVIDIA hardware, in release10 drivers and beyond, glCopyTex{Sub}Image2D() only updates the on-card texture -- if the formats match closely enough for a "fast copy". If the texture ever has to be evicted, you pay for readback then. That way you may never have to pay for readback<<
http://members.xoom.com/myBollux
March 30, 2001 02:20 PM
Ever heard of texture priorities? You can assign each texture a numeric priority for how important it is. If the room is there, the program attempts to keep high priority textures in mem. Are you using texture objects? If you do priorities you need to. I quote the opengl superbible 2nd edition.
"KEEPING TEXTURE OBJECTS IN MEMORY?"
OpenGL automatically keeps the most recently used texture objects in memory. However, if your graphics card only has 8MB of texture memory and you have 30MB of textures, this meathod of texture shuffling doesn''t work too well.
To improve the performance of programs using large textures, OpenGL provides a glPrioritizeTextures function to specify which textures are the most important:
GLuint texture_objects[5];
GLclampf texture_priorities[5];
glPrioritizeTextures, 5, texture_objects, texture_priorities);
The texture_priorities array provides a numeric priority for each texture object listed from 0.0(lowest priority) to 1.0(highest priority). Giving a texture image a priority of 1.0 doesn''t guarantee that the texture is kept in memory, but if there is enough memory available, it WILL be resident when you need it.
-Alex
www.a-tronic.com
"KEEPING TEXTURE OBJECTS IN MEMORY?"
OpenGL automatically keeps the most recently used texture objects in memory. However, if your graphics card only has 8MB of texture memory and you have 30MB of textures, this meathod of texture shuffling doesn''t work too well.
To improve the performance of programs using large textures, OpenGL provides a glPrioritizeTextures function to specify which textures are the most important:
GLuint texture_objects[5];
GLclampf texture_priorities[5];
glPrioritizeTextures, 5, texture_objects, texture_priorities);
The texture_priorities array provides a numeric priority for each texture object listed from 0.0(lowest priority) to 1.0(highest priority). Giving a texture image a priority of 1.0 doesn''t guarantee that the texture is kept in memory, but if there is enough memory available, it WILL be resident when you need it.
-Alex
www.a-tronic.com
March 30, 2001 02:22 PM
sorry, typos! Here''s a re-post
Ever heard of texture priorities? You can assign each texture a numeric priority for how important it is. If the room is there, the program attempts to keep high priority textures in mem. Are you using texture objects? If you do priorities you need to. I quote the opengl superbible 2nd edition.
"KEEPING TEXTURE OBJECTS IN MEMORY"
OpenGL automatically keeps the most recently used texture objects in memory. However, if your graphics card only has 8MB of texture memory and you have 30MB of textures, this meathod of texture shuffling doesn''t work too well.
To improve the performance of programs using large textures, OpenGL provides a glPrioritizeTextures function to specify which textures are the most important:
GLuint texture_objects[5];
GLclampf texture_priorities[5];
glPrioritizeTextures (5, texture_objects, texture_priorities);
The texture_priorities array provides a numeric priority for each texture object listed from 0.0(lowest priority) to 1.0(highest priority). Giving a texture image a priority of 1.0 doesn''t guarantee that the texture is kept in memory, but if there is enough memory available, it WILL be resident when you need it.
-Alex
www.a-tronic.com
Ever heard of texture priorities? You can assign each texture a numeric priority for how important it is. If the room is there, the program attempts to keep high priority textures in mem. Are you using texture objects? If you do priorities you need to. I quote the opengl superbible 2nd edition.
"KEEPING TEXTURE OBJECTS IN MEMORY"
OpenGL automatically keeps the most recently used texture objects in memory. However, if your graphics card only has 8MB of texture memory and you have 30MB of textures, this meathod of texture shuffling doesn''t work too well.
To improve the performance of programs using large textures, OpenGL provides a glPrioritizeTextures function to specify which textures are the most important:
GLuint texture_objects[5];
GLclampf texture_priorities[5];
glPrioritizeTextures (5, texture_objects, texture_priorities);
The texture_priorities array provides a numeric priority for each texture object listed from 0.0(lowest priority) to 1.0(highest priority). Giving a texture image a priority of 1.0 doesn''t guarantee that the texture is kept in memory, but if there is enough memory available, it WILL be resident when you need it.
-Alex
www.a-tronic.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement