Multitexturing & VertexArrays

Is there any other way to do this…

glMultiTexCoord2fvARB(GL_TEXTURE1_ARB, data[0 + i].tcoord[1]);
glArrayElement(0 + i);
glMultiTexCoord2fvARB(GL_TEXTURE1_ARB, data[1 + i].tcoord[1]);
glArrayElement(1 + i);
glMultiTexCoord2fvARB(GL_TEXTURE1_ARB, data[2 + i].tcoord[1]);
glArrayElement(2 + i);

Please tell me something encouraging…

hold thight… afaik… ehmm… err… no. );
the only think i would do is to use locked vertex arrays and dereference vertex data with glArrayElement().

btw, always remember GL_TEXTURE0_ARB is the same as glTexCoord… just in case you didn’t know.


Yes I know but… It suck… why there is not any kind of glMultiTexCoordPointer?

Are glLockArrays and multipass could be a faster solution?

why not a glMultiTexCoordPointer? i’m also wondering why…

about multipass, i don’t think so.
multipass should be avoided where possible because it needs blending, wich involves many memory accesses, therefore it is intrinsically slow.

you say it sucks: yes, it’s not a elegant solution.
but what about performances? well, there’s no point in performance, since it’s the only way to go…
…well, afaik: is it the only way people?


[This message has been edited by dmy (edited 05-23-2000).]

What are glLockArrays ? Never heard, never read, and didn’t find in the reference pages.

Here is the spec for the extension

I too am looking at lock arrays and could do with seeing a source code example if anyone has one.

Apologies for my previous comment about ints I stand corrected.

Ok I’ve found a source code example of glLockArrays here

the vertex culling test at the bottom of the page.

There is a multitexture option to work with vertex arrays :


Concerning glLockArrays : although I use it in some of my software, it does not seem to bring any performance improvement (on my Dual PIII 600,512Mb RAM,ELSA Erazor X2)…

Just to let you know…


when you use glClientActiveTextureARB, can you use glDrawElements?

I wonder, how do you specify textures coordinates on all textures levels in only one command since there is no glMultiTexCoordPointer?

There is no way to cram it into one command unfortunately, but it can be done in a simple 4:

// vertex pointer


then you go ahead and render the object using either glDrawElements or glDrawArrays.

hope this helps.

It might be my drivers (NVIDIA 3.68 - TNT2 ULTRA) but if I do what Trotsky wrote, it’s aint working… In fact, its only working if the glTexGen functions are at on on both the S and T coordinate… the following is the source I wrote…

// spoint = sizeof(data[0])


glBindTexture(GL_TEXTURE_2D, tex[0]->name);

glBindTexture(GL_TEXTURE_2D, tex[1]->name);
// glEnable(GL_TEXTURE_GEN_S);
// glEnable(GL_TEXTURE_GEN_T);

glVertexPointer(4, GL_FLOAT, spoint, &data[0].vertex);
glColorPointer(4, GL_FLOAT, spoint, &data[0].vcolor);
glNormalPointer(GL_FLOAT, spoint, &data[0].normal);

glTexCoordPointer(2, GL_FLOAT, spoint, &data[0].tcoord1);
glTexCoordPointer(2, GL_FLOAT, spoint, &data[0].tcoord2);

glDrawElements(GL_TRIANGLES, vertexNB, GL_UNSIGNED_INT, index);

If I made a mistake somewhere… please tell me where.

Thank you.

Oups… My mistake,
I should have put my glEnableClientState(GL_TEXTURE_COORD_ARRAY); in both glClientActiveTextureARB(GL_TEXTURE0_ARB) and

Now it work wonderfully…

Thank you all!