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 / Fast runtime / increasing runtime speed

Author
Message
programing dude
18
Years of Service
User Offline
Joined: 22nd Jul 2008
Location:
Posted: 13th Apr 2010 04:00
Hi I was looking over my 3d models before puting them to work using dbp and all of them are really high poly.

So before I go head first can anyone please tell me any coding tips or tricks to tweak LOD, change camera distance or any sort of function to speed up the runtime so that my game isn't super slow because of all the polygons from all the objects.

thnx
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 13th Apr 2010 17:08
Concerning LOD, what I would do, is make 2 lower poly versions for your model, for example, use the high poly when your up close, then use a medium ply model when your not so close, then use a really low poly model when you can just see the outline After that just hide the object all together.

Rawwrr. Sig Fail.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 13th Apr 2010 18:36
Is there a LOD command like progressive mesh in DBP? DX progressive mesh is what I would use in C++/DX.

The fastest code is the code never written.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Apr 2010 19:07
There is automatic LOD now, probably introduced to make the tree plugin work well with the rest of the engine. You can specify additional meshes to use with a command in DBPro, but I can't remember what it's called.

Certainly worth having a look for it.


Health, Ammo, and bacon and eggs!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 13th Apr 2010 19:09
Wow. LOD is automatic in DBP? Does it have any controls like how many itterations?

The fastest code is the code never written.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Apr 2010 19:20
I think so, never looked into it, but I'm sure you specify the range when adding an LOD mesh... lemme see if I can find the commands.

Here we go:

ADD LOD TO OBJECT

This command adds two additional mesh levels to an existing object.

Syntax
ADD LOD TO OBJECT Object Number, LOD Object, LOD Level, LOD Distance
Parameters
Object Number
Integer
Object number of the main model
LOD Object
Integer
Object number of the object holding the new LOD mesh data
LOD Level
Integer
LOD level to assign the mesh data to. Use a value of zero for the medium LOD and a value of one for the lowest LOD level
LOD Distance
Float
The distance at which this LOD level is used in the scene

Returns

This command does not return a value.

Description

The two additional models must be created from the same source and almost identical except for a different number of vertices. When modelling an object, these additional files are
created by reducing the complexity of the polygons and saving out a simpler shape.

Example Code



Health, Ammo, and bacon and eggs!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 13th Apr 2010 21:07
Ok. That's not the same as the DX progressive mesh, but it could in some ways be better. If at the greatest distance you want to show a billboard, this would be ideal, but the whole thing about having to make your own LOD and then applying it is NOT ideal. I'm sure I'll find some way to live with it.... LOL

The fastest code is the code never written.
programing dude
18
Years of Service
User Offline
Joined: 22nd Jul 2008
Location:
Posted: 14th Apr 2010 16:45
Thanks Ill try fiddling around with the LOD commands to see if I can get a more effeciant function then what DBP already does for me.

Login to post a reply

Server time is: 2026-07-26 12:32:59
Your offset time is: 2026-07-26 12:32:59