VBO repeat textures

Started by
1 comment, last by rocklobster 12 years ago
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?
Advertisement
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.
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!

This topic is closed to new replies.

Advertisement