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.

Program Announcements / Object LOD Plugin

Author
Message
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 22nd Oct 2009 20:27 Edited at: 5th Jun 2011 14:36
Heres another dll which I have made.

It adds LOD levels to objects. This feature is already available in dark basic pro but only allows up to 3 LOD levels max. This plugin allows users to use as many LOD levels as they like.

Screenshot

Its easy to use, all you have to do is create a group of objects. Register the main object as a LOD object. And setup the right aount of LOD levels and setup the other objects as LOD Levels. Then totally forget about your LOD level objects, they will automatically be positioned at the parent object. All LOD switching is done automatically in the background.

This is an early release of the DLL. Some features are still in progress like deleting and Copying LOD data from other cameras.

This plugin has been tested and works with Multiple cameras. Switching is done with the camera mask so each camera will show different objects depending on their position.

The below files include:
Plugin Binary
Keywords File
Readme
1200 Spheres with LOD demo (as seen in above screenshot)


Download. 1.01 (24/10/09)
DOWNLOAD

Source Code:
DOWNLOAD

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 22nd Oct 2009 23:47 Edited at: 22nd Oct 2009 23:48
Heres a screenshot of the demo.

It is rendering 957 Spheres at 89 FPS.

There is a total of 1200 Spheres each with 5 LOD levels.


The highest sphere LOD level has 468 Polys.

Attachments

Login to view attachments
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 23rd Oct 2009 01:58
Nice work kaedroho. Do you think you could make a DLL which allows control over the render order of objects? I only ask because I am trying to implement a particle system into Evolved's deferred shading, and I am having problems getting the particles (which are just DBpro plains) to render in the proper order. It would be awesome if you could look into it for me.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 23rd Oct 2009 11:19 Edited at: 5th Jun 2011 14:36
I'll have a look into it for you. I dont think its possible to change it in the DBPro rendering engine. But I can write a custom rendering engine to render them outside the DBPros rendering engine.

This will mean that you can order them properly and you dont have to create 1000s of DBPro objects. Just a simple call to a function like "Draw object".

Or you could try and use "set global object creation 6" before creating any objects. This apparently orders objects by depth.

I have a rendering dll planned anyway.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 24th Oct 2009 13:07
I have an update planned for this to be released later today. It will clean up many bugs and allow you do release objects.

It will also allow you to control when objects need LOD updates and when they dont.

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 24th Oct 2009 16:11
Wow awesome work kaedroho! You're just pumping out plugins these days. Will this plugin work on objects with shaders, ghosted objects, and animated objects? For the shaded and ghosted objects, would I need to perform my shader set up on each LOD object or only on the original?

<-- Spell based team dueling game!
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 24th Oct 2009 16:53
You would have to do your shader to all your other LOD objects.

This system only syncronises the hide, position and rotation variables with other LOD levels.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 24th Oct 2009 22:05 Edited at: 24th Oct 2009 22:06
Ok, the Update is ready.

The following commands have been added:

KD ReleaseLODCamera CameraID
KD DisableObjectLOD ObjectHandle
KD EnableObjectLOD ObjectHandle
KD ReleaseObject ObjectHandle


Also the seccond parameter of KD RegisterLODCamera can be used.

If the camera you are registering is always going to be in the same position as another camera, Just set the seccond parameter of this function to the camera ID. The other camera must be registered before using this command. This makes sure that LODLevels are only calculated once for cameras which are in the same position. A good speed increase.

I've added some extra optimisations. Managed to squeeze another 20% out of it. I think that's as far as I can optimise it. I will release the code shortly so other people can optimise it further!

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 24th Oct 2009 23:36
1.01 Release.

Added following commands:
KD ReleaseLODCamera CameraID
KD DisableObjectLOD ObjectHandle
KD EnableObjectLOD ObjectHandle
KD ReleaseObject ObjectHandle

Optimised code alot more
Copy from cameras now work

RAR
ZIP

jeffhuys
18
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 25th Oct 2009 01:41
Kaedroho, that's awesome! I love it, and I'm certainly going to use it!
Thanks man!

You're the 'th to view this signature!
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 26th Oct 2009 14:18
Honestly never thought about LOD objects, so, then, quite lost with the way do do them work.

Is there somewhere an Example or explanation about LOD objects and the way to use/create/handle them??

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 26th Oct 2009 14:35 Edited at: 26th Oct 2009 14:36
Theres an example inside the download.

Heres an explantion:

Lets say that in your game, you have objects nearby and objects far away (this is true in most cases). But all of your objects are the same detail. The problem with that is that you are wasting detail on the objects which are far away, as their so far away you cant see the little details on them, so why draw every detail?

This plugin allows you to dynamically change the detail of objects depenting on their distance. The example shows 1200 spheres with 5 detail levels each which have been positioned at random distances. The plugin allows you to make all the objects close to the player very high detail and reduce the detail for far away objects.

The only visual differences are that your FPSometer will display a higher reading and youll beable to have your nearby objects very high detail.

Most big commercial games use this technique. Especially the ones with big landscapes.

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 27th Oct 2009 21:35 Edited at: 27th Oct 2009 21:35
can it work within a single object?


forever loading...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Oct 2009 00:07
Yep, you can set which objects will use the system. Different objects can have different numbers of LOD levels too.

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 28th Oct 2009 00:30 Edited at: 28th Oct 2009 00:30
no, as in, will it lod limbs/parts of a object seperately if they are one object.
"inter-object" lod.

eg:
if i exported these spheres as a .x file and loaded it as one object, would the lod effect both spheres at once or seperate?


forever loading...

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Oct 2009 01:33
Nope, you will have to split your limbs into separate objects.
Splitting your limbs into separate objects will improve render speed aswell.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Oct 2009 13:57
Quote: "Splitting your limbs into separate objects will improve render speed aswell."


I'm not sure, I heard rumours that limbs are far more efficient than objects due to the footprint each object creates.

I still prefer objects to limbs though

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Oct 2009 23:28 Edited at: 28th Oct 2009 23:30
I have heard from places that it renders faster when split up into objects. I may be wrong as I haven't actually tested it myself yet.

I have another plugin on the way, its been finished for about a week now but I haven't got round to testing it. I will get it out by next week hopefully.

I will upload the source code to this plugin if there is enough demand for it. The source code to my last plugin (anisotropic filtering) Didn't get many downloads so I didn't bother to upload it this time. But if someone wants it then let me know.

Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 29th Oct 2009 03:45
I would love to see the source for this.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 31st Oct 2009 21:02 Edited at: 31st Oct 2009 23:43
Ok Mistrel, Uploading now...

EDIT: Finally got it uploaded. Just after I posted this, my mum walked in and made me finnish writing a speech on Asperger Syndrome. (I still haven't done it)

Anyway, here it is:

RAR
ZIP

Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 2nd Nov 2009 06:38
Thanks for this, kaedroho. I was really curious at its implementation. There's never enough good information about DBP internals like this.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th Dec 2009 11:47 Edited at: 16th Dec 2009 11:48
An update will be released soon to allow the plugin to support Alpha fading. Unfortunately though, It won't support it if you use multiple cameras. As DBPro can only use alpha for all the cameras or none of them. If I use my system to update LOD differently for every object, you will experience random fading on all other cameras when camera 1 is moving.

I will have the update ready soon. And possibly a GDK release aswell.

Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 17th Dec 2009 07:40
Does this work on terrain? Or just on object?

Great job!!!!!


kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Dec 2009 10:37
Only objects as terains require LOD seam fixing. For terrain LOD Look into BlitzTerrain.

http://forum.thegamecreators.com/?m=forum_view&t=145404&b=8

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 17th Dec 2009 14:34
Hi kaedroho,

I'm surprised Geometry Resolution (LOD) isn't a hardware accelerated feature with vertex shaders or something. I'm curious as to how your calculating distance.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Dec 2009 15:10 Edited at: 17th Dec 2009 15:12
When you input distance into the system, it squares the near and far values to increase calculation speed later on.

In the loop, it gets the objects position vector from the DBPro internals and takes the camera position away from it. It then does this.

DistSQ=x*x+y*y+z*z

it compares the value returned with the near and far values stored in the array. As the near and far values were squared earlier, there is no need to square them now or square root the distance were checking them against.


Vertex shaders wont do it. They only change the vertices but don't remove triangles. To do LOD you would need to use a geometry shader which is DX10+.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 18th Dec 2009 00:16
Thanks for details kaedroho. I dont know much about shaders at the moment - hehe. Do you know if DX10 performs hardware accelerated LOD with geometry shaders? Tough to find info.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 18th Dec 2009 10:54
I think its possible. And maybe some games acctually use it. The problem with it is that you will have to make it reduce the mesh on the GPU. Which could make the mesh look really bad unless you have a really good alorithm to do it. LOD looks much better when its left to the 3D moddeler choosing what detail is best for an object.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 19th Dec 2009 09:09 Edited at: 19th Dec 2009 09:12
kaedroho, do you have plans to write a occlusion lib? I'm always looking for ways to speed up graphics rendering. Good reading here.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th Dec 2009 11:59
Now thats a nice idea! I will look into it!

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 19th Dec 2009 12:16
I can imagine the turbo boost in performance by combining Object LOD with Terrain LOD. I was pondering over the of a LOD for Building Interiors but, I not sure if thats practical.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th Dec 2009 01:55 Edited at: 20th Dec 2009 02:09
Good stuff. Having a blast with it.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 20th Dec 2009 14:35
Hi KISTech what happen to your MMO? Are you still developing with DBPro?

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Dec 2009 22:14
Yes.

Just having trouble keeping artists. The last one was outstanding, but it just didn't work out.

I'm proceeding with what he made for me, and making the entire game using those few models. Hopefully once the game is ready for ALPHA testing an artist will be inspired to jump in and help out.

I'm not yet at a point in the rewrite to start a WIP post yet, but it shouldn't be to much longer. Maybe mid-January I'll post a new WIP at the same time the ALPHA test starts.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 21st Dec 2009 23:32
Quote: "I'm proceeding with what he made for me, and making the entire game using those few models. Hopefully once the game is ready for ALPHA testing an artist will be inspired to jump in and help out."
I understand you there and that was a inspiration for MECS. Take a few modeled parts, mix & match to create different variations in the entities. Hopefully once the MECS App is ready for ALPHA testing an artist will be inspired to jump in and create model `part` packs.

Quote: "I'm not yet at a point in the rewrite to start a WIP post yet, but it shouldn't be to much longer. Maybe mid-January I'll post a new WIP at the same time the ALPHA test starts."
Look forward to it.

hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 22nd Dec 2009 23:36
yout the man with the answers kaedroho

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
jeffhuys
18
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 24th Dec 2009 16:36
Nice work Kae!
Think I'm going to use it in my learning project.

You're the 'th to view this signature!
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 30th Dec 2009 10:13
Hi kaedroho

Have you considered a 3D to 2D Imposters Implementation? Would definately complement your LOD system.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 30th Dec 2009 16:01 Edited at: 30th Dec 2009 16:05
Maybe I could do: MakeImageFromObject(ImageID,ObjectID,Frame#,CamX#,CamY#,CamZ#,CamAngle#)

And that would capture an image of the object at the set camera position and frame number.

(cam(xyz) being the position of the camera in relation to the object. The camera would automatically point itself at the object so the object would be centre on the image)
The cam angle would be the roll of the camera.

Maybe I could also make a system which would automatically draw imposters.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 31st Dec 2009 06:32 Edited at: 31st Dec 2009 06:32
Quote: "Maybe I could also make a system which would automatically draw imposters."
That sounds really cool. I'm curious as to what the performance trade off is between capturing the image and using a low LOD?

Random Thought: In a attempt to do something a lil different with 3D, I've pondered over developing a gallery-style shooter similar to Area 51(1995) using digitized characters on animated sprites and
Make3D 2D to 3D rendering techniques.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 7th Jan 2010 15:18 Edited at: 7th Jan 2010 15:20
Heres a link to the DLL collection forum.

http://devstorm.co.uk/viewforum.php?f=36

The topics which are not announced mean the plugin is in WIP.

Feel free to post any ideas to that forum.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 22nd Jan 2010 15:58
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 23rd Jan 2010 19:31
Awesome, Thanks for registering!

Azunaki
15
Years of Service
User Offline
Joined: 11th Feb 2009
Location:
Posted: 11th Feb 2010 16:37
kaedroho does this work with animated objects? like if it switched the main object out at frame 100 would it bring the new lod stage in at 100 or 0?

[url]http://myportfolio.x10hosting.com/[url]
visit my site.(still in progress)
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 11th Feb 2010 20:43
It would bring it in at 0. There are 2 ways to solve this, either remember the LOD Objects and add it in manually, or wait for an update which I have quickly got to work on.

Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 14th Feb 2010 15:12
Imagine I would use one word for calling ALL my entitys for example.

"InfEntity"

How would i apply the code u gave, to InfEntity, instead of the id's on spheres? It would be awesome if u would comment the source of the demo.

Thanks in forward,

Red Eye


Masqutti
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location: insanity
Posted: 15th Feb 2010 15:26
Hi!

Have you tried the fps difference when using this LOD-system, and have those 50k polygons rendering on screen, and having those objects placed into the same screen without the lod(just place the lods by manually to have sam amount of polygons without this system).. I mean, how much does it consume fps(cpu/gpu) to check these objects when to change the lod on all the objects etc.. ?

i guess it's low priority task not to consume whole cpu ?

hmmmh.. that didn't compile
General Jackson
User Banned
Posted: 26th Apr 2010 05:08
Sorry for the bump
But For this plugin, do I need to make several different stages for each model, then load them all in? or does it automatically lower the polygons for the models?


Sorry if this is a dumb question.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 26th Apr 2010 17:52
You have to make each stage first and load them into different object numbers. Once you setup the system, then you dont have to do anything to the other models. Just move the original object and the LOD will be applied automatically.

General Jackson
User Banned
Posted: 26th Apr 2010 22:00
I'm sorry but I still dont get it (never used LOD before)

What do you mean by make each stage first?

Login to post a reply

Server time is: 2024-11-23 15:20:24
Your offset time is: 2024-11-23 15:20:24