Using glTexCoordPointer with multitexturing
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,
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,
OK, I'm an idiot. A well-formed google search got me the answer.
http://berkelium.com/OpenGL/GDC99/multitexture.html
From the page:
Sorry for the noise.
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.
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
this is how I do vertex arrays
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");
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,
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,
I use this tutorial to learn about it.
http://nehe.gamedev.net/data/lessons/les...?lesson=22
http://nehe.gamedev.net/data/lessons/les...?lesson=22
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.
I think you need to go back and *read* what TomorrowPlusX wrote, before saying random things.
-- you're right OneSadCookie, I apologyze
this one does use them
http://www.kraftwrk.com/multi_texturing.htm
this one does use them
http://www.kraftwrk.com/multi_texturing.htm
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Can't get multitexturing to work | Coyote | 4 | 3,432 |
Nov 16, 2009 11:48 PM Last Post: arekkusu |
|
| Lighting and Multitexturing problem | Scribendi | 0 | 2,335 |
Sep 25, 2005 09:22 PM Last Post: Scribendi |
|
| OpenGL Multitexturing Details w/Alpha | WakingJohn | 22 | 9,790 |
Dec 4, 2004 10:52 AM Last Post: WakingJohn |
|
| Sparseness of Multitexturing documentatin in Red Book | WhatMeWorry | 2 | 2,900 |
Nov 10, 2004 01:54 PM Last Post: arekkusu |
|
| Decomposing multitexturing to multiple passes | arekkusu | 4 | 3,541 |
Dec 1, 2003 12:43 PM Last Post: Sohta |
|

