Sign in to follow this  
miroz

Texturing on Trianglestrip

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
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

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