Huge 3D Terrain Engine
Written by: Brett Binnersley (Brett14);
Credit is NO LONGER required (despite what the GMK may say) but is greatly appreciated!
GM8.0 only at the moment, sorry.
Here's a screenshot, however you need to actually run the example to see how it works.
What is it?
This is a 3D terrain engine which supports HUGE terrains. The biggest size that I recommend is a 512x512 terrain, however you can go higher. It has a colormap, a detailmap (with LOD) and an overlaying texture to draw the terrain.
What Techniques did you use?
-I have used surfacefix.dll to prevent Zfighting between the detailmap, the colormap and the overlay texture, and they draw perfectly over top of each other. I have to thank Effexgames for this idea, as I was stumped on how to prevent Zfighting between different layers of the terrain without changing the Z value of the models. Since GM uses an 8bit Zbuffer it was a really noticeable gap between the layers and it just wouldn't do.
-Since heightmaps take such a long time to load I've included a converter which converts the heightmap into a grid, and saves the grid as a terrain file. This terrain file takes only a few seconds to load as opposed to a couple minutes for the heightmap.
-The example terrain included is a 512x512 heightmap. The only way that it is possible to use a terrain this vast in size in GameMaker is to split it into many smaller models and only draw the terrain around you.
Check out my newest project: GameDev Studio
Edited by brett14, 14 March 2012 - 03:56 AM.