Jump to content
  • Advertisement
Sign in to follow this  

Terrain Generation and Drawing

This topic is 4747 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 building a remake of the game Transport Tycoon and I'm currently working on the terrain-part. Transport Tycoon has this simple tilemap. I have the same too. I use a vertex- and index buffer. The problem is I cannot get the map bigger as 256x256 tiles since the indexbuffer gets too big. Now I can think of 3 ways to solve the problem: 1. Using an array of indexbuffers. 2. Generate an new data for the indexbuffer when my view changes (In this situation you only have the data in indexbuffer what the view lets you see). 3. Geometry instancing. I would like to ask you, what you think it is best to use. If you see an other way to solve the problem, please add it.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Xeile
1. Using an array of indexbuffers.

This is probably your best bet.

Quote:
Original post by Xeile
2. Generate an new data for the indexbuffer when my view changes

The overhead of generating/uploading new data everytime the view changes will kill your performance. Avoid this idea.

Quote:
Original post by Xeile
3. Geometry instancing.

A possibility, but I'm not sure it'll work unless your terrain tiles. My understanding of instancing is that you can submit the same geometry but with different transforms and properties - but the raw geometry is still the same for each instance. Unless you procedurally generated your terrain in a vertex shader, this probably wouldn't look too good.


Depending on the style of view you need (if theres going to be large amounts off screen), splitting your terrain up into multiple 256x256 or 128x128 blocks might well help with culling (e.g. Quadtree).

hth
Jack

Share this post


Link to post
Share on other sites
Thank you for reply, I will look into the quadtree thingy. Splitting up the terrain in standard block sizes seems to be very good.

Share this post


Link to post
Share on other sites
Create blocks (32x32 tiles), then use some kind of class for material areas (which contains vb and ib), block will contain list of them, this way you can avoid getting index buffer per tile and not getting too big buffers, and faster culling.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!