Jump to content
  • Advertisement
Sign in to follow this  
rocklobster

OpenGL VBO repeat textures

This topic is 2384 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!