PDA

View Full Version : Texture objects -inside- display list



P88_Razor
01-22-2003, 03:33 AM
hi guyz,

I have a display list containing a bunch of polygons with a texture object assigned to it. (bindTexture is called inside display list generation)

Now, when I generate the texture after (first bindtexture ) the display list has been compiled all interaction of my viewer starts to slow down.

But when I recompile the display list after setting the texture, my viewer is fast.

Is it OK to generate textures inside a display list ?

P88_Razor

P88_Razor
01-22-2003, 04:09 AM
In the meantime I also tried to generate the texture objects ouside the display list and use (bind) them inside the display list.

Even that results in a slowdown.

Any ideas ? Somebody ? :-/

kawasakis900
01-22-2003, 05:16 AM
hi.

i would advise you not to have any texture bindings inside a glNewList/glEndList block.

instead, when you compile your list, provide the tex coordinates only.
when you want to draw the display list use a texture binding before the glCallList call.

in other words, i do the following:

glGenLists(...
glNewList(...
...
glBegin(...
glNormal3f(...
glTexCoord2f(...
glVertex3f(...
glEnd(..
...
glEndList(...

and when i want to draw it:
glBindTexture(...
...
glCallList(...
...

generaly, i always avoid using texture bindings when i compile display lists...

P88_Razor
01-22-2003, 05:48 AM
Indeed, that would be ideal.
But what I want is to be able to assign (bind) a texture to each polygon separately if needed.

Fe. I have separate textures for arms, legs, face, etc for my character...

JustHanging
01-22-2003, 07:01 AM
Texture binding is very slow. You should combine several textures, like body, face, leg, into one to avoid texture switching. If you can't do this, mostly because the textures are tiled, at least sort by texture.

-Ilkka

kawasakis900
01-22-2003, 07:21 AM
hi.

ilkka is right. especially if your 3D program (3DSMAX or whatever) supports a feature where you can map the texture coordinates of an object manually (most programmes nowadays have this feature)...

P88_Razor
01-22-2003, 10:46 PM
The problem is not the texture switching.
All poly's are sorted by texture.

So the problem still remains.

1st compile, # textures applied to faces.
--> glCallList slow response

2nd compile, # textures applied to faces
--> glCallist responds realtime


NOTE : I also tried to pre-generate the textures outside display list and only 'bind' it inside, but this has the same effect

Razor

P88_Razor
01-22-2003, 10:49 PM
Btw... I just registered. ;-)