Using glTexCoordPointer with multitexturing

Sage
Posts: 1,199
Joined: 2004.10
Post: #1
I'm reading the man page right now, but I'm not certain how to approach this. I'm moving from using display lists to VBOs, and I use multitexturing all over the place. I need to be able to submit texture coordinates for GL_TEXTURE0, GL_TEXTURE1, etc.

In immediate mode ( or stored in a display list ) it's easy enough to use glMultiTexCoord( GL_TEXTURE{N} )... but I can't see how to do this with vertex arrays.

Any suggestions? Thanks,
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #2
OK, I'm an idiot. A well-formed google search got me the answer.

http://berkelium.com/OpenGL/GDC99/multitexture.html

From the page:
Code:
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(2, GL_FLOAT, 0, tp0);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(2, GL_FLOAT, 0, tp1);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

Sorry for the noise.
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #3
texture coords generation is not affected by the use of VBO's.
a VBO is nothing more than a buffer in gpu memory as I understand it so if you are using vertex arrays it should be very easy to move yo VBO's.

this is how I do mine
Code:
glGenBuffersARB(1, &id);
        if(id) {
            glBindBuffer(GL_ARRAY_BUFFER, id);
            glBufferData(GL_ARRAY_BUFFER, bytesize, vertexptr, GL_STATIC_DRAW );
        } else printf("fail to load mesh to GPU as Vertex Buffer Object\n");

this is how I do vertex arrays


Code:
glGenVertexArraysAPPLE(1, &id);
if(id) {
glEnableClientState(GL_VERTEX_ARRAY_RANGE_APPLE);
            glBindVertexArrayAPPLE(id);
            glVertexArrayRangeAPPLE(bytesize, vertexptr);
            glVertexArrayParameteriAPPLE(GL_VERTEX_ARRAY_STORAGE_HINT_APPLE,GL_STORAGE_​SHARED_APPLE);
            glFlushVertexArrayRangeAPPLE(bytesize, vertexptr);
} else else printf("fail to load mesh to GPU as Vertex Array\n");
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #4
I've used both vertex arrays and VBOs plenty! I use them for foliage on my terrain, for shadow volume extrusion, etc etc.

I'd just never used vertex arrays or VBOs with multitexturing. I couldn't find in the man pages how to bind one array for GL_TEXTURE0 and another for GL_TEXTURE1 and so on.

But google helped.

Thanks,
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #5
I use this tutorial to learn about it.
http://nehe.gamedev.net/data/lessons/les...?lesson=22
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
That tutorial doesn't use multiple texture coordinates simultaneously with vertex arrays...

I think you need to go back and *read* what TomorrowPlusX wrote, before saying random things.
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #7
-- you're right OneSadCookie, I apologyzeAnnoyed
this one does use them
http://www.kraftwrk.com/multi_texturing.htm
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 3,885 Nov 16, 2009 11:48 PM
Last Post: arekkusu
  Lighting and Multitexturing problem Scribendi 0 2,565 Sep 25, 2005 09:22 PM
Last Post: Scribendi
  OpenGL Multitexturing Details w/Alpha WakingJohn 22 10,690 Dec 4, 2004 10:52 AM
Last Post: WakingJohn
  Sparseness of Multitexturing documentatin in Red Book WhatMeWorry 2 3,159 Nov 10, 2004 01:54 PM
Last Post: arekkusu
  Decomposing multitexturing to multiple passes arekkusu 4 3,954 Dec 1, 2003 12:43 PM
Last Post: Sohta