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 / How knowing if a limb is visible or not ?

Author
Message
Hell_666
16
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 21st Oct 2012 19:36 Edited at: 22nd Oct 2012 20:37
Hi, I've a giant map exported in multi limbs. My problem is that map slow down my fps.

So, I want to hide all limbs that the player doesn't see but I don't know how hide them ...

Can you help me please ?

PS: I you have other advices to optimize performances you can post it too.

Eternal suffering ...

I'm french
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Oct 2012 23:21
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 21st Oct 2012 23:36
or search for limb frustum culling functions by Lost In Thought

Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 22nd Oct 2012 00:51 Edited at: 22nd Oct 2012 01:19
Hello
Quote: "
PS: I you have other advices to optimize performances you post it too.
"

Théory:
http://forum.thegamecreators.com/?m=forum_view&t=197653&b=1&msg=2362688#m2362688
Pratique:
http://forum.thegamecreators.com/?m=forum_view&t=199373&b=11&msg=2383531#m2383531
Look at the "object grid".. the drawback of this method is it requires lot of preprocessing but the frustum culling is now done by the DBP engine...


Hell_666
16
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 22nd Oct 2012 20:37
@MrValentine : I've already dark occlusion, some parts of my map become invisible with it ...

@Le verdier : I'll look at this

@Brendy Boy : It seem interesting, I'll do some test.

Otherwise, I thought to hide all limbs that are behind the player, so I've a little code but it doesn't seem to work, I must be wrong, someone can see it please ?



Thanks a lot

Eternal suffering ...

I'm french
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 22nd Oct 2012 22:42 Edited at: 22nd Oct 2012 23:05
code:
Are the variables floats ???
...
But it is too long. Simply use a dot product camera direction vector and (limb pos-camera pos)
If negative, the limb is behind..
and avoid the costly sqrt, atanfull...

But the single object as big map with multi limbs is probably the WORST solution in terms of performance, all the vertices are transformed and all the textures are switched...

A last trick:
Don't use while/endwhile repeat/until do/sloop loops inside the main loop . These performs some engine syncs and all is slowed down...
Always use for/next

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Oct 2012 23:47
Try excluding limbs rather than hiding them. From the Help file:

Quote: "EXCLUDE LIMB ON
This command will exclude the specified limb from being rendered or processed by the engine. "


I haven't tried it myself but I understand that excluding rather than hiding is faster when you have many objects or limbs.
Hell_666
16
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 23rd Oct 2012 00:17
Ok, thanks a lot for your advices. Finally, I've tested Lost In Thought frustrum culling and it works nice

Eternal suffering ...

I'm french

Login to post a reply

Server time is: 2026-07-07 13:38:47
Your offset time is: 2026-07-07 13:38:47