Sign in to follow this  

Texturing a terrain with sectors

This topic is 4529 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'm building a terrain engine in C# and managed directx. Recently I have came across a problem that is driving me nuts. When i apply a texture to the terrain it's cleary visible the separation between the sections. How can i avoid this ? It's floating point errors ? I need some kind of blending ? I'm using one indexbuffer, one vertex buffer and triangle strip's in each sector. I have posted an image of the problem to this location : http://img270.imageshack.us/img270/7665/terrain3dt.jpg Tnks for any help

Share this post


Link to post
Share on other sites
This could be one of 3 problems I think:

1) The texture doesn't tile. If the texture isn't made to fit to itself on the other side, you shouldn't tile it like you are. Make sure the texture tiles correctly - copy it in paintbrush and place a copy on each of the side, make sure you get a smooth fit.

2) Texture coords are not correct. Recheck these, if they are off, your texture won't tile at the correct place, and it won't look good.

3) (this is the most likely)Your normals/lighting isn't smooth. I'm guessing you're using per face normals/lighting. This means, that between two faces, the lighting shifts immediately, causing a visible line, as though the terrain was two surfaces with an angle between them. Either look into vertex normals (recommended) or tone down the lighting contrast to make the differences less visible.

Good luck :).

Share this post


Link to post
Share on other sites
Quote:
Original post by sirob
This could be one of 3 problems I think:

1) The texture doesn't tile. If the texture isn't made to fit to itself on the other side, you shouldn't tile it like you are. Make sure the texture tiles correctly - copy it in paintbrush and place a copy on each of the side, make sure you get a smooth fit.

2) Texture coords are not correct. Recheck these, if they are off, your texture won't tile at the correct place, and it won't look good.

3) (this is the most likely)Your normals/lighting isn't smooth. I'm guessing you're using per face normals/lighting. This means, that between two faces, the lighting shifts immediately, causing a visible line, as though the terrain was two surfaces with an angle between them. Either look into vertex normals (recommended) or tone down the lighting contrast to make the differences less visible.

Good luck :).


Tnks a lot i will check the normals...

Share this post


Link to post
Share on other sites
Quote:
Original post by i24021
Quote:
Original post by sirob
This could be one of 3 problems I think:

1) The texture doesn't tile. If the texture isn't made to fit to itself on the other side, you shouldn't tile it like you are. Make sure the texture tiles correctly - copy it in paintbrush and place a copy on each of the side, make sure you get a smooth fit.

2) Texture coords are not correct. Recheck these, if they are off, your texture won't tile at the correct place, and it won't look good.

3) (this is the most likely)Your normals/lighting isn't smooth. I'm guessing you're using per face normals/lighting. This means, that between two faces, the lighting shifts immediately, causing a visible line, as though the terrain was two surfaces with an angle between them. Either look into vertex normals (recommended) or tone down the lighting contrast to make the differences less visible.

Good luck :).


Tnks a lot i will check the normals...


I've found the bug and as you have said it was in the normals. Many tnks...

Share this post


Link to post
Share on other sites

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