PDA

View Full Version : Dynamic Loading of texture



utkarsh07
02-03-2009, 03:33 AM
In my application i am loading texture image and moving the image by varying the glVertex3f() coordinates.
So it appears as the image is moving.
now my requirement is that as this images past the screen i have to dynamically load the other image.
But when i do this my application halts for a moment.

Please suggest me how can i improve the performance of my application.

The image loading is through glBindTexture(GL_TEXTURE_2D, texture[0]);

Regards

wedge
02-03-2009, 05:19 AM
The image loading is through glBindTexture(GL_TEXTURE_2D, texture[0] -> nope this is binding not loading.
TexImage is loding images.

The best way is to load all images befor starting rendering, else you have to load the Image in a second Thread with a shared context.

zeoverlord
02-03-2009, 12:21 PM
if you only have a small number of smaller images then it's ok to load them all.
But if you have to do dynamic loading you need to do two things
1. make sure you can load the images pretty quickly from the HDD using a low or un compressed format, like tga or something like it, ideally it should just be a mattter of reading it from the HDD

2. use either PBO or glTexSubImage2D to load that data into a already existing texture

Make sure you do #1 before starting #2, ideally you could preempt this in another thread while your doing the rendering.