Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Who will be interested in a LOD Terrain Plugin for DBPro?

Author
Message
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Dec 2008 22:22 Edited at: 15th Feb 2009 15:56



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.







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

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Dec 2008 22:34
Screenshot:


This is a wireframe of one of the terrains. It shows what LOD does (look at the poly count)

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Dec 2008 22:37


This is exactly the same as above, but it just shows what the above image looks like when rendered solidly, you can see that the detail is very high and the polys are very low.

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Dec 2008 23:38
I guess I would be. Sounds like a nice addition.

3700+ Athlon 64 - Geforce 7600 GS - 2GbDDR2 RAM - 40Gb Hdd (In this pc) - Windows Vista Ultimate (x86)
Visigoth
20
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 15th Dec 2008 03:39
me!
Neuro Fuzzy
18
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 15th Dec 2008 03:47
heh, i don't know who wouldn't be
TechLord
22
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 15th Dec 2008 05:50
A better question would be `Who will NOT be interested in a LOD Terrain Plugin for DBPro?`. Terrain LOD and any other 3D Mesh LOD are essential optimizations.

Sign me up!

Neuro Fuzzy
18
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 15th Dec 2008 05:52
the LOD in your picture though looks like part bintree, part what might as well be quadtree.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 15th Dec 2008 18:02
Thanks for answering

I guess thats its worth my time to make this into a plugin then.

for those who have not yet seen, heres a vid.

http://www.youtube.com/watch?v=DnEfzQDYlEQ

Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 15th Dec 2008 20:24
AAAAAAAH me want!!! NO wait! ME want now!
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 15th Dec 2008 23:36 Edited at: 15th Dec 2008 23:37
Ive set up a page on my website about UberTerrain.
Click Here

Were using a free webhost(cant afford a real one ) at the moment so sometimes the server may be busy.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th Dec 2008 18:02 Edited at: 16th Dec 2008 18:04
Ive nearly finnished the coding for the terrain in DBPro. I have to fix 1 or 2 bugs, then move my Anti seam code over (which is about 1 000 lines long). After all that, we will start porting to C++.

If you havnt played the demo yet, its downloadable here:
http://files.filefront.com/UberTerrainDemo3rar/;12372543;/fileinfo.html (2.96 MB)

Requires Nvidia PhysX. Get it here:
http://www.nvidia.com/object/ageia_8.04.25_whql.html

sydbod
17
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 17th Dec 2008 03:36 Edited at: 17th Dec 2008 03:37
Any chance of porting it to "Open CL" when it becomes practical, so that Nvidia as well as ATI/AMD users can benefit from it.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Dec 2008 16:40
Quote: "Any chance of porting it to "Open CL" when it becomes practical, so that Nvidia as well as ATI/AMD users can benefit from it."


Do you mean Open GL? If not, I dont know what "Open CL" is.

RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 17th Dec 2008 17:00
I never really use terrains as most of my projects are in-doors or in more urban environments (plus I dont really agree with the idea of making a huge expanse of grass for a player to run around on instead of a more detailed smaller map) but I would use it if it were available and there came a time for me to need terrains.

That said, an object LOD system would be interesting, but probably not practical with the way DBP's objects are created right now. But if you could give the user access to a way to load in several LODs of a model (say an enemy spaceship for example), and the plugin handled switching the models out for the correct LOD based on distance to the main camera while the user would only have to worry about one object number, that may be useful to the newcommers that can't program it themselves. I dont know if that makes sense .

Anyways the LOD Terrain system you're working on would definitely still be useful.

AndrewT
18
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 17th Dec 2008 22:19 Edited at: 17th Dec 2008 22:19
LOD terrain sounds awesome, I would definitely use it.

As for LOD objects the only practical way would be have different limbs for each object; one limb would be a texture plane mesh, one would be low-poly and one would be the regular one, and the different limbs would be hidden/shown according to distance.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Dec 2008 22:23 Edited at: 17th Dec 2008 22:37
AndrewT,

Thats exactly how the system works! There are also other things to look into though, the dredded LOD seams which are caused by when a low lod plain meets a high lod plain. You have to go into lots of complicated vertexdata commands and maths to solve it. Thats the purpose of this of this plugin, it allows people to create LOD terrains easily and quickly which increase FPS in their games significantly.


Everyone,

Please spread the word about this plugin! The more support we get the more motivated we will be to work on it!

sydbod
17
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 17th Dec 2008 23:20 Edited at: 17th Dec 2008 23:21
Quote: "Do you mean Open GL? If not, I dont know what "Open CL" is."


CUDA is a propriety language for Nvidia CPUs.

Open CL is an open language that is/will be backed up by many organizations including ATI/AMD and Nvidia that will allow one to program code that will utilize either Nvidia GPU (if it is there) or ATI/AMD GPU (if it is there, or just the ordinary CPU if supported GPUs are not there.

It is like an open source , supported by all type of CUDA.

Here is a link http://en.wikipedia.org/wiki/OpenCL
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 18th Dec 2008 00:18
What are you making it in? It could be good to have to DarkGDK and .NET

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 18th Dec 2008 16:34
Its being written in C++.

trogdor
22
Years of Service
User Offline
Joined: 15th Apr 2003
Location: Portsmouth, VA, USA
Posted: 18th Dec 2008 18:03
@kaedroho - I could use all the FPS I can get, and your plugin sounds like something I would buy.

I currently use massive terrains for a land navigation game.

I load a 512x512 map and set terrain scale 1, 44.85,4.5,44.85
So your terrain looks like it would help a lot.

can't wait to try with my terrain

If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 18th Dec 2008 20:05
@kaedroho - that looks very good... How big a terrain can you make with this?

Something you will sell? Or open-source?

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 18th Dec 2008 20:10
Quote: "How big a terrain can you make with this?"


The terrains are unlimited in size. However, the number of triangles/sectors depends on your hardware and any limitations in DBPro. On release I will do a few tests to find the maxinum size of terrain you can make on an average spec computer.

Sigh
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location: The Big 80s
Posted: 18th Dec 2008 22:52 Edited at: 18th Dec 2008 22:54
I'd be interested in this plugin. The work you've done so far is fantastic. Keep up the great work!

@RUCCUS
I'm working on an LOD system right now (LOD is quite simple), but it's not a plugin and requires modelers to name LOD limbs a certain way.
http://www.youtube.com/watch?v=HJZ_ah-k8Ho
Not much to see, but it works well.

Fighting the War Against Misused Apostrophes since 2002! Stop by for a chat! [IXE]Nateholio on irc.maxgaming.net:6667 #GarageGames
Violent Pigeon
17
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 19th Dec 2008 00:32
Im very interested, Everything looks great so far

Somethings you may want to look into adding:

- Lod Models within the engine, so trees, grass, buildings and such are culled or are turned into LOD with the terrain. as well as maybe option within the editor or the client so that they can select which lod to use, like if there on a good, bad or excellent pc they can turn up the amount of polygons used or turn it down

Just an idea

Thank you

Svothe



Serge Adjo
19
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 22nd Dec 2008 15:52 Edited at: 23rd Dec 2008 16:41
Who will be interested in a LOD Terrain Plugin for DBPro? I'AM

pascontent.
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 23rd Dec 2008 05:11
Slightly off topic, why is the tool above me unbanned? I thought he was gone for good.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 23rd Dec 2008 14:27 Edited at: 23rd Dec 2008 14:27
he was unbanned in janurary. You need to catch up!


Back on topic, ive got terrain rendering in the standalone. I just need to add heightmapping, detailmapping and Frustum Culling. Then i can move onto copying my LOD terrain code over.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 8th Feb 2009 21:08
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.

djchaos
18
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Brighton, UK
Posted: 8th Feb 2009 21:16
THIS must be added in2 the editor, i think the "infinite terrain" feature will solve all of our terrain related problems

Your mod has been erased by the signature
Outscape
17
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 8th Feb 2009 21:18 Edited at: 8th Feb 2009 21:37
YES, THATLL BE GREAT



Quote: "Function ifKarlasks(Recipient as String, Post as String, Link as String)
Recipient Goto Link : Insert Post : Endfunction"
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 8th Feb 2009 21:20 Edited at: 8th Feb 2009 21:26
Quote: "THIS must be added in2 the editor, i think the "infinite terrain" feature will solve all of our terrain related problems"


Yeah, ill send it to our editor programmmer when its finnished.

If you dont know what were talking about, Check the sig.

Monk
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 8th Feb 2009 21:31
This looks awesome, and is the sort of thing i would love and use loads
Downloading the demo now...

Edit:
That is soo cool!
Youve even put the collision between the camera and the terrain in, which is great!
However, the nearest LOD seems to change a bit too close to the camera so that its noticeable, but this is only a small thing...

Looking good

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 9th Feb 2009 19:09
Some Sample code:

I may change some parts, but this is an example of what im aiming for.



KISTech
17
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 9th Feb 2009 20:18
Nice. Can't wait to check it out.

Monk
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 9th Feb 2009 20:56
I can't seem to run that code, it just says unknown command on anything starting with UT_...
Is there a plugin that i need?

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 9th Feb 2009 21:49
Thats an Example of what the coding will be like. The code wont work until UberTerrain is released (thats what UT stands for).

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 10th Feb 2009 22:39
Vid:

http://www.youtube.com/watch?v=DnEfzQDYlEQ

This vid is getting old. It appeared in the december newsletter.

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 11th Feb 2009 03:53
Quote: "So who will be interested in a terrain engine which supports LOD?"


Heck yes!!

Seeing as I'm working on an RTS game, this could improve drastically the amount of detail I could put into the terrain.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Feb 2009 16:43
Im now putting all of my free time into this plugin.

Ive added a new command which is 'UT_Initialise(cameranum)'.

This should be called when all of your terrains are built and the camera is in the start position. It generates all of the sectors it needs to and in 'UT_Update' it deletes and generates new sectors on the fly. This should save ALOT of Vram as you dont constantly have an entire terrain loaded in. This will also allow you to have Infinite terrain.

This command can also be called when the device has been lost (by alt tabbing) and will regenerate all of your sectors without having to rebuild.

tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 11th Feb 2009 16:53
Does the basic plugin require NVidia Physix? If it does may I ask why? I thought LOD and terrains can be done without physics involvement. And this would open others to use it with Newton or a home-grown+sparky's type engine....

I'm not a real programmer but I play one with DBPro!
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Feb 2009 17:15 Edited at: 11th Feb 2009 17:16
It doesnt need PhysX. The demo uses PhysX because I made it with UberEngine. Im currently working on a standalone version.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Feb 2009 18:59
I should have the majority of it done by the end of next week as I have a week off school (half term).

Monk
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 12th Feb 2009 19:18
Cool! Cant wait to try it...
Ive got a week off but i doubt ill be doing anything as useful

Outscape
17
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 12th Feb 2009 20:01 Edited at: 12th Feb 2009 20:38
nice i hope it comes along, i am realy looking forward to it!



Quote: "Function ifKarlasks(Recipient as String, Post as String, Link as String)
Recipient Goto Link : Insert Post : Endfunction"
darkvee
19
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 12th Feb 2009 20:47 Edited at: 12th Feb 2009 20:49
Hi this is Vee
Karl its looking fantastic
Hopely when the team is all done with this.
We should have a free plugin system that everyone will love.

Use 1 heightmap or more. to load it onto alot of different mini terrains to form one big one.

This system is has it all.
It has detail mapping, Frustum Culling and Indexbuffering.

Up to 7 LOD levels

Streaming Live

Terrain engine works in the background and loads the terrain on the fly. Allows infinite terrains to be made. This feature alone is worth it :p
There is also Tile Rotation that you can rotate a tile a certain way if you want.

With the Advanced Physics built into it
You can use of dynamic soft-body ground pressure acts like real weight. For example, you add a big tanks and other objects the ground sinks some showing the objects had weight on it, and sinking that terrain there some.

We might even throw this in. Using the dynamic soft-body ground
pressure feature. We can take it a step farther. We can make it when you shoot a missle or something that has a explosion the ground gets destroyed, and looks great.

So I hope everyone is liking what they hear here. hehe I sure i'm. That's all I got to say, and look out for the plugin comming out soon. Cheers!

Vee
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Feb 2009 21:13 Edited at: 12th Feb 2009 21:22
Quote: "There is also Tile Rotation that you can rotate a tile a certain way if you want."


Ive acctually came up with a forumla to calculate which way is best. It should make it alot quicker to develop if you have hundreds of thousands (if not millions) of tiles.


Quote: "With the Advanced Physics built into it"


Advanced Physics is a feature that I came up with while developing ONE. It controls which parts of the terrain should be activated for colision and which parts shouldnt. Major speed increase (especially with PhysX).


Quote: "You can use of dynamic soft-body ground pressure acts like real weight. For example, you add a big tanks and other objects the ground sinks some showing the objects had weight on it, and sinking that terrain there some."


I love that idea. I will definately make it possible to do this. Ill probly make a function called 'Set Ground Height(x#,z#,height#)'.


I have 1 or 2 more ideas to share and they will be released soon.

Xenocythe
20
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 13th Feb 2009 18:32
I can't wait for this! This is exactly what I need. Looking forward to the release!


kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 13th Feb 2009 21:03
Update:

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.

Monk
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 13th Feb 2009 23:27
Sounds Good! Demo available soon?

Login to post a reply

Server time is: 2025-08-09 02:06:14
Your offset time is: 2025-08-09 02:06:14