Sign in to follow this  

Terrain question

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

This topic is 4809 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this