Jump to content
  • Advertisement
Sign in to follow this  
ManaStone

Terrain question

This topic is 5089 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

When rendering the terrain, how exactly do you do it so that U V coordinates are correct? What I mean is that when vertices are shared you might want them to have 2 separate UV coordinates depending on which triangle you are rendering. For example, say that the following UV coordinates represent each vertex on a height map: (0,0) (1,0) (0,0) (0,1) (1,1) (0,1) You are going to be able to put 2 textures on this, one which should render normally, and the other which should render it mirrored. The only way I can think of to fix this problem is to split the height map up into four different parts and render them separately, sending a different texture coordinate array in for each one. Is that the way you are supposed to render it? Also, how efficient is it to call to call glBindTexture() for each different texture on the terrain? Should I separate the terrain into different sections that use the same texture and render each part separately or should I use one giant texture and just use the UV coordinates to determine which texture I should use?

Share this post


Link to post
Share on other sites
Advertisement
You could put all your textures in one texture. And you calculate your uv-coordinates so that you cut a piece out your large texture.

I suppose that you are using vertex arrays?

Share this post


Link to post
Share on other sites
Yeah, I'm using vertex arrays. So that is how textures are usually done for terrains? What about the way I proposed to do the UV coordinates? Is that the standard way to do that as well?

Share this post


Link to post
Share on other sites
Quote:
Original post by ManaStoneIs that the way you are supposed to render it?


dont fall for the "is that the _right_ way to do it" illusion. you are not supposed to do anything in any particular way and if you feel like it you can just forget about storing any tex coords at all and generate a bunch of them in a vertex shader.

dont look for a _right_ way or how others are doing it, look for the way thats working best for YOU.

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!