Some of you may have seen around the forums and in the newsletter that im working on a terrain engine which supports LOD.
If your unsure what LOD terrain is:
LOD(Level Of Detail) Terrain is terrain with many detail levels and these detail levels get switched in real time. Really far away parts of your terrain are low detail and really close parts are high detail. This is a major improvement in FPS for your games.
The plugin also features: detail mapping, Frustum Culling and Indexbuffering.
So who will be interested in a terrain engine which supports LOD?
UPDATE: 8th Feb 2009
Sorry that i havnt posted any updates recently, Ive been working on another project. Im now going to finnish working on UberTerrain.
I thought that ill add the following features into the FREE version of the Terrain engine.
Up to 7 LOD levels
Instead of being fixed on 4
Streaming
Terrain engine works in the background and loads the terrain on the fly. Allows infinite terrains to be made. This feature may not be added as I have never done it and its been rarely done in DBPro. I will give it a go though.
Tile Rotation
Have you ever looked at the bottom of a diagonal cliff and saw these ugly tiles sticking out? This is because the direction of the tile and can be solved by rotating it.
Advanced Physics
This only activates physics on sectors when there is an awake dynamic body nearby. Its a MAJOR speed improvement.
Quite difficult to add, this requires the user to ake their own build code (dont worry, there are still functions to help you) because the system needs to create a separate physics object for each part of the terrain.
Also, the system needs to know the positions of each body at all times, so every dynamic body will need to be registered.
UPDATE: 9th Feb 2009
Some Sample code:
I may change some parts, but this is an example of what im aiming for.
sync on:sync rate 60:sync
`Start UberTerrain
UT_Start()
`Set The LOD Distances (as were only using 4 LOD levels, we only need to fill in the first 3)
UT_SetLODDistances(500,1000,1500,0,0,0)
`Make a Terrain
terrain=UT_MakeTerrain()
`Set the heightmap image
UT_SetTerrainHeightmap(terrain,heightmap)
`Set the texture
UT_SetTerrainTexture(terrain,texture)
`Set the detailmap
UT_SetTerrainDetail(terrain,detail)
`Set how many LOD levels there are
UT_SetTerrainLOD(terrain,4)
`Set the split (the terrain will be 8x8 so it will generate 64 sectors)
UT_SetTerrainSplit(terrain,8)
`Set the Tiling of the detailmap
UT_SetTerrainDetailTile(terrain,2)
`Tell it that were using the advanced physics feature
UT_SetAdvancedPhysics(terrain,1)
`Start Building
UT_BuildTerrain(terrain)
`Build
Building=1
while Building
`The visual object
object=FreeObject()
`The Physics Object
phyobject=FreeObject()
`Generate a sector
progress=UT_ContinueBuild(object,phyobject) `Generates a sector, phyobject can be ignored in normal physics mode
`Example showing that you can set it to any physics/collision system you want
SC_SetupObject phyobject,0,0
if progress=-1
`Stop building
Building=0
else
`Print the progress
center text screen width()/2,screen height()/2,"Loading Terrain: "+str$(progress)+"%"
endif
endwhile
maincam=0
do
control camera using arrowkeys maincam,10,3
`Update the system, use camera number for LOD and frustum culling
UT_Update(maincam)
sync
loop
UPDATE: 10th Feb 2009
Vid:
http://www.youtube.com/watch?v=DnEfzQDYlEQ
This vid is getting old. It appeared in the december newsletter.
UPDATE: 13th Feb 2009
Heightmap loading and terrain Generation is now complete.
Im going to now add texturing then add my LOD Terrain Code.
Ive recently created an Algorithm which decreases the ammount of polygons inside a sector. By making the tris bigger where theres less detail and smaller where theres more detail. But if I add this, it will make the loading ALOT Slower so im going to make a program to pregenerate terrains with this new Algorithm.
Texturing should be finnished by tonight.
UPDATE: 14th Feb 2009
Texturing is done, now for the LOD system.
UPDATE: 14th Feb 2009
LOD is now working, now I have to rewrite my anti seam system (which is about 2000 lines). This makes the LOD system work properly.
UPDATE: 14th Feb 2009
Over the past 2 - 3 hours, ive been making the demo. Adding colision, making the camera move correctly and tweaking a few variables to make the terrain look good.
Now im going to start adding my LOD seam code.
It could be done by tonight so look out for it.
UPDATE: 14th Feb 2009
My Anti seam code seems to be working. It needs a few bug fixes and optimisations until its ready though.
Demo is coming very soon!
UPDATE: 14th Feb 2009
Just put a page up on the Blitzwerks website about this plugin.
http://www.blitzwerks.co.uk/1_11_UberTerrain-Plugin.html
UPDATE: 14th Feb 2009
Screenshot.
POLYS: 47104
FPS: 116
1024x768x32
Taken on a relatively low spec pc.
LOD Terrain is very nearly finnished. Next im going to get Green Gandalfs Shaders working with UberTerrain.
UPDATE: 14th Feb 2009
All bugs fixed. Expect a demo release within the hour!
UPDATE: 14th Feb 2009
Demo Release:
http://files.filefront.com/UberTerrainDemo4rar/;13284175;/fileinfo.html
UPDATE: 15th Feb 2009
GGs Blend Shader works perfectly with UberTerrain.
Download here
I got 120 FPS which is twice of what I got with Advanced Terrain.
Video of the terrain using the blend shader:
http://www.youtube.com/watch?v=TBzYR7al0xU