PDA

View Full Version : when is texture data loaded into texture memory



guoxusheng
02-11-2004, 05:55 PM
I want to analyse the performance difference between the volume rendering based on 3d texture and the volume rendering based on muti-texture. I do not know the exactly time when the texture date in main memory is loaded into the texture memory. Does the loaded action occur after glbindtexture() executed or glteximage*d()?
what role does texture memory play in graphics hardware. when I use following statement
GLUint texNames[256];
glGentextures(256,texNames);
for ( int i=0;i<N;i++)
{
glbindtexture(gl_texuture_2d,texNames[i];
glTexImage2d(gl_texture_2d,....);
)
}

does the texture data loaded into texture memory ?
if not, when did the texutre data will be loaded.
after these statemet,i use the following codes.
for(int i=0;i<N-1;i++)
{
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D,texNames[i] );
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, texNames[i+1);

}
here,does texture data loadeded into texture memory?

Relic
02-12-2004, 04:49 AM
Your code snipped will be incredibly fast and useless. http://www.opengl.org/discussion_boards/ubb/wink.gif

Where the texture ends up in the first download is completely implementation specific. For example it can be in host, in AGP or in video memory.
As long as you don't USE the texture it's probably never ending up in video or AGP memory so in your code examples you bench nothing.
If you draw with the textures, it depends on the implementation's system, AGP, and video memory amount where the textures will end up WHILE drawing with them. If you're lucky the working set of textures will fit into the fastest memory.
This is all really unpredictable until you benched it per OpenGL implementation and computer system.