multitexturing with interleaved-arrays?
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
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
You can specify a seperate vertex array for each texture unit with gClientActiveTextureARB() (see the end of chapter 9 in the red book).
sorry, i cant find any docu on this .. dont have the red book either!
can you be a little more specific please? :)
can you be a little more specific please? :)
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Can't get multitexturing to work | Coyote | 4 | 6,147 |
Nov 16, 2009 11:48 PM Last Post: arekkusu |
|
Vertex Array & Interleaved Array troubles | TomorrowPlusX | 5 | 7,694 |
Nov 17, 2007 09:59 AM Last Post: TomorrowPlusX |
|
Using glTexCoordPointer with multitexturing | TomorrowPlusX | 6 | 20,425 |
Dec 5, 2006 09:42 AM Last Post: NYGhost |
|
Lighting and Multitexturing problem | Scribendi | 0 | 3,725 |
Sep 25, 2005 09:22 PM Last Post: Scribendi |
|
OpenGL Multitexturing Details w/Alpha | WakingJohn | 22 | 17,814 |
Dec 4, 2004 10:52 AM Last Post: WakingJohn |