Jump to content

  • Log In with Google      Sign In   
  • Create Account

VBO repeat textures


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 rocklobster   Members   -  Reputation: 415

Like
0Likes
Like

Posted 11 April 2012 - 04:49 AM

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?

Sponsor:

#2 Brother Bob   Moderators   -  Reputation: 8193

Like
1Likes
Like

Posted 11 April 2012 - 05:19 AM

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.

#3 rocklobster   Members   -  Reputation: 415

Like
0Likes
Like

Posted 11 April 2012 - 05:23 AM

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!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS