Skip to main content
GameDev.net gamedev.net
🔒 Locked

VBO repeat textures

Started by rocklobster Apr 11, 2012 at 10:49 AM 1 replies 2.4k views
Original Post
rocklobster
rocklobster
Hi,

I was wondering if there was a way to repeat a texture multiple times over terrain using opengl VBO. I can do it in immediate mode, but i'm now moving on to vertex buffers and i have no clue how to do it. My vertex struct is simple:

struct Vertex
{
float v1, v2, v3;
float n1, n2, n3;
float u, v;
}


I'm also using an index buffer and just setting up the pointers with glTexCoordPointer etc.

Thanks,

- rocklobster

EDIT: I was thinking maybe i should repeat the texture on the model before exporting it in?
Brother Bob
Brother Bob
If you can draw something in immediate mode, then just stick the very same vertex data in the arrays instead. There is nothing special with the vertex data itself in either immediate mode or with vertex arrays; they are the same.
rocklobster
rocklobster
Thanks for the reply, it turns out it was the model exporter. I tweaked it and then just put


glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);


and its working great!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.