Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


What's the best way to associate Terrain with multiple Textures?

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

What's the best way to associate terrain with a variety of textures? I have a terrain built of several triangles and indices and wanted to put a wide variety of textures onto the landscape (like say, EverQuest), but i'm not sure the best/most efficient way to associate textures with each of these triangles that make up the landscape? Should I make an array of structures that have a D3DVertex and a also an int for the texture tile to use or have an array of all my triangles/indices and another array with the tiles to use on the triangles to overlay on it or what's the most common approach? This is my first attempt at this so feel free to give me any advice how to best do this! Edited by - nPawn on 8/30/00 10:11:07 AM

Share this post

Link to post
Share on other sites
I have no idea what is the best way to do this, I only have the way that I got it to work...

It''d take a bit of explaining to go into any real detail, but basically, I made a different mesh for each texture of the landscape.

So you have a grid of 11x11 vertices (making a 10x10 tile grid) I then went through and figured out for each tile, what mesh it belonged to , like the grass mesh, the rock mesh, etc... I''d add those vertices to the mesh, and then at render time, just call each of the meshes in order.

Now, problems with that is I repeat a lot of data. Vertices are getting duplicated even in the same mesh. It could be optimized to go and look for a duplicate vertex first before adding it, and build up an index list, or you could combine the terrain into one mesh, and create different index lists for each of the textures. When you render the mesh, you call render using each texture''s index list, this eliminates data overhead, but you are passing all vertices everytime and just trying to fix it by using indexes, that isn''t too good either...

So I guess I don''t have an answer. It get''s even more difficult I think when you start blocking the terrain into different sections in order to only render those areas of the world you need.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!