Jump to content
  • Advertisement
Sign in to follow this  
miroz

Texturing on Trianglestrip

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

I'm trying to create tiled terrain in 3D. I've found few approaches and i need advice to choose the best one. To make it simple, terrain is pretty much standard 2D grid. I used TriangleStrip to keep number of vertices low. Using few degenerates i made a grid with low vertex count and got good performance. Now, problem is texturing. When using TriangleStrip, two neighboring tiles share two vertices. Problem is that if those tiles require diferrent textures, i can't find a good way to texture them. ----- |A|B| ----- I can specify only one (tu,tv) coordinates for middle vertex so for texture A middle vertex will have TU=1 but for B texture should have TU=0. I don't know how to deal with it except for using triangle list where every shared vertex will be twice in the vertex buffer. Should i use trianglelist or is there some way around?

Share this post


Link to post
Share on other sites
Advertisement
Don't bother with triangle strips. You can get much better performance from a triangle list and the storage requirements really aren't too significant - if you're dealing with super massive terrains you'd be wanting some sort of paging/streaming system anyway.

Your problem with texturing is probably just a fundamental issue with your approach - yes the position components are the same/shared, but they have different texture coordinates which implies they are in fact different vertices. You'll either need to find a way of getting them to share ALL properties or none at all.

hth
Jack

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!