multitexturing with interleaved-arrays?

<seb>
Unregistered
 
Post: #1
hi!

i was drawing an interleaved array with a single
texture, everything was fine and working, until
i got the idea of using multitexturing.

so i was defining two textures:

- - - - - - - - - - - - - - - -
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, id1);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, id2);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2);
- - - - - - - - - - - - - - - -

and rendered my terrain as before:

- - - - - - - - - - - - - - - -
glInterleavedArrays( GL_T2F_N3F_V3F, 0, VertexArray );
glDrawArrays( GL_TRIANGLE_STRIP, 0, NumVertices );
- - - - - - - - - - - - - - - -

of course, the desired effect didnt appear. i need to
call something like:

- - - - - - - - - - - - - - - -
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.5, 1.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.5, 1.0);
- - - - - - - - - - - - - - - -

but calling this function would mean to go away from my
nice and fast vertex array, go back to working on every
vertex on its own ...

or is there a way to use an interleaved-array together with
glMultiTexCoord2fARB ??


:))
sebastian
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #2
You can specify a seperate vertex array for each texture unit with gClientActiveTextureARB() (see the end of chapter 9 in the red book).
Quote this message in a reply
<seb>
Unregistered
 
Post: #3
sorry, i cant find any docu on this .. dont have the red book either!

can you be a little more specific please? :)
Quote this message in a reply
<seb>
Unregistered
 
Post: #4
ah, i finally found sth and tried a little,
and finally its working.

thanks again!!

seb
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Can't get multitexturing to work Coyote 4 4,066 Nov 16, 2009 11:48 PM
Last Post: arekkusu
  Vertex Array &amp; Interleaved Array troubles TomorrowPlusX 5 5,648 Nov 17, 2007 09:59 AM
Last Post: TomorrowPlusX
  Using glTexCoordPointer with multitexturing TomorrowPlusX 6 14,099 Dec 5, 2006 09:42 AM
Last Post: NYGhost
  Lighting and Multitexturing problem Scribendi 0 2,695 Sep 25, 2005 09:22 PM
Last Post: Scribendi
  OpenGL Multitexturing Details w/Alpha WakingJohn 22 11,258 Dec 4, 2004 10:52 AM
Last Post: WakingJohn