Sign in to follow this  

terrain question??

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

im working on a 3d engine and im working on actually loading in a terrain. Now i have done it with OGL easy, but with DX, the texture system is creating a problem for me. What is the most efficient way to load in a terrain. Would it be to have a list of textures and associate the geometry based on what texture it has and the loop through them and create a VB for each texture, a global VB for everything? This also poses another issue. If i sort based on texture, what if a certain poly has multiple textures? I guess basically what im trying to figure out, is what would be the best method for loading in a bunch of geometry and be able to maintain multiple texturing. ps. when i say terrain, i mean any world environment, not necessarily a heightmap or something. I just need a world to interact with. THanks for the help

Share this post


Link to post
Share on other sites
I made a very simple random terrain generator a little while back. What I did was iterate through and create a random height for the Y axis, in your case I think your just loading it right? Anyway load it into an array, put that array into a vertex buffer. Then to load a texture or just color to it, iterate throught he array again an put the color of that current vertex into another array, and add the color that way. That may seem general, but let me know if that helps or not.

Share this post


Link to post
Share on other sites
thats fine and everything, but the problem comes when i already load the vertex buffer up but have different textures for the geometry, how is it to know which one to use. Only thing i can think of is sort geometry by texture and then render each vertex buffer(each texture being its own VB). But then the multiple texture issues comes into mind.

Share this post


Link to post
Share on other sites
you could make a pixelshader which blends several textures together. you have for example a dirt and a grass texture which are present on every tile of your terrain in a combination defined by a blend texture and calculated by your pixel shader

Share this post


Link to post
Share on other sites

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