PDA

View Full Version : Texture Priority Problem



ysatou
01-31-2002, 02:46 AM
Hi everyone.
May I ask a question?
I want to render large texture data,and it is exceeded video memory.
Then , I divide it to some textures, and prioritized by glPrioritizeTextures ( some are set by 1.0 , and remains set by 0.0, 1 texture size = 8.4MB ).
However, I confirm texture resident status by glAreTexturesResident, I have no effect of Texture Priority( default "least recently used" has performed ).

Why can't I take a effort of Texture Priority.

Please teach me.

V-man
01-31-2002, 04:09 PM
AFAIK, if you use it, it gets uploaded. I dont know how to use the priority thing efficiently or whether if its useful at all.

Can you be more specific with the problem?

V-man

ysatou
02-05-2002, 05:01 PM
Thnks for Reply.

Here is my abstract code of Prioritize Texture.




/* settings */
int max_texturs = 16;
glGenTextures( max_textures , texture_id );
for( i=0;i<max_textures;i++ ){
glBindTexture( GL_TEXTURE_3D_EXT , texture_id[i] );
glTexImage3DEXT( ..... );
}
GLfloat priority[]={1,1,1,1, 1,1,0,0, 0,0,0,0 , 0,0,0,0 };
glPrioritizeTextures( max_textures , texture_id , priority );

/* display routine ( call by glutDisplayFunc, Redraw by glutPostRedisply ) */
GLboolean status[max_textures];
glAreTexturesResident( max_textures , texture_id , status );
print_resident_status( sttus );
for( i=0;i<max_textures;i++ ){
glBindTexture(GL_TEXTURE_3D_EXT,texture_id[i] );
draw_texture();
}

-----------------------------------------
I hope that texture_0 to texture_5 stay on textuer memory.
(disired status)
(1)1,1,1,1, 1,1,0,0, 0,0,0,0, 0,0,0,0
(2)1,1,1,1, 1,1,0,0, 0,0,0,0, 0,0,0,0
.....

but in fact, each dispay callbacks, glAreTextureResidents returns following result.
(sample returned status)
(1)1,1,1,1, 1,1,1,0, 0,0,0,0, 0,0,0,0
(2)0,1,1,1, 0,0,1,0, 1,0,0,0, 0,0,1,1
(3)0,0,0,0, 1,1,0,0, 1,0,0,1, 1,1,0,1

Why don't stay prioritized textures on texure memory?