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 / Anything better than EXCLUDE OBJECT ON ?

Author
Message
The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 10th Nov 2012 15:27 Edited at: 10th Nov 2012 15:27
Hi folks,

I've been doing some experiments with large numbers of objects and have noticed slow frame rates even if objects are excluded. I'm talking 80,000 objects ALL excluded.

It seems the render loop must still be checking excluded objects for some reason, maybe just to check an exclusion flag?

I was hoping that EXCLUDE OBJECT ON would move the object pointer out of the render lists and into an offline list so it isn't processed at all until EXCLUDE OBJECT OFF, this doesn't seem to be happening.

Any thoughts?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Nov 2012 15:55
What happens if you remove those 80000 objects from your program completely?
The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 10th Nov 2012 16:00 Edited at: 10th Nov 2012 17:46
My FPS jumps from 26 to 60.

edit - I meant My FPS jumps from 26 to 2500.

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Nov 2012 16:36 Edited at: 10th Nov 2012 16:39
I sense weak hardware... what is your development box specs? or are you VSYNC'ing? / SYNC RATE 60'ing?

The sample code with EXCLUDE OBJECT ON sample code gave me 1500~ when run and then 1700~ when excluded...

My graphics are not currently optimised either...

EDIT

I think at that level, you should look at Culling systems...

The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 10th Nov 2012 17:35 Edited at: 10th Nov 2012 17:50
@MrValentine

Intel Q6600 @ 3 GHz
Radeon HD 6850
3.5GB system ram
Windows 7 32

I am looking at culling systems, hence the experiments



1 box
EXCLUDE ON = 2500 FPS
EXCLUDE OFF = 2500 FPS

10000 boxes
EXCLUDE ON = 208 FPS
EXCLUDE OFF = 16 FPS

20000 boxes
EXCLUDE ON = 105 FPS
EXCLUDE OFF = 7 FPS

80000 boxes
EXCLUDE ON = 26
EXCLUDE OFF = FPS = too slow to measure i.e. 0

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Nov 2012 19:30 Edited at: 10th Nov 2012 19:38
creating your own is good, but Dark Occlusions is being made into a DLL form, so maybe have a look into that?

EDIT

WOW that is some really bad code!!!

with 80000 I got 40 off and at best 8 on...

The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 10th Nov 2012 19:40
I'm aware of Dark Occlusion, it's not suitable for my project. In fact I can't use any plug-ins except IanM's matrix utils because my project will be ported to c++ at some point.

I only use db pro for testing out ideas. Anyways it seems there is no way to completely remove an object from SYNC, even EXCLUDE ON objects carry a performance hit

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Nov 2012 19:42
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 10th Nov 2012 19:57
And how would you frustum cull an object without using exclude object...?
Sure, you could delete it but then you'd have to waste large amounts of time reloading it again later (unless you manage to implement streaming). What I usually do is keep a copy excluded and then instance / clone from this one and delete when something is too far away to likely be visible for some time. The same could be done with ie. frustum culling but then you'd have to delete / recreate very often when moving about.
This might be worth considering as you likely don't have 80 000 different objects?


"Why do programmers get Halloween and Christmas mixed up?"
GregA
15
Years of Service
User Offline
Joined: 21st Jun 2011
Location:
Posted: 10th Nov 2012 20:02
Well, make the GPU do it... Is there any particular reason that the 80k objects, (or some portion of them) can't be put into a single object? Then just let the GPU do its thing? My primitive GPU on my laptop computer here is more than capable of culling 250k vertex islands in a single object... Granted in that case they were all billboards...
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Nov 2012 20:04
Object primitives are costly; could you not use limbs in place of certain objects? Furthermore, static vertex groups in place of limbs?

Do these objects need to move? Can they be instanced? Can they be billboarded?

The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 10th Nov 2012 20:07 Edited at: 10th Nov 2012 20:16
Frustum culling is already implemented in db pro.

Anways...The problem isn't about poor code in my post or GPU speeds or CPU speeds. It's the fact that SYNC still "touches" objects that are EXCLUDE ON when it shouldn't.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Nov 2012 21:00
I see what you mean. You still get a noticeable performance boost compared to hide object though.

It would be interesting to know what exactly causes the drop in FPS as you increase the maximum number of objects.
The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 10th Nov 2012 21:17 Edited at: 10th Nov 2012 21:18
@Green Gandalf

yep. I'm currently examining the DB Pro source code at code.google.com to understand whats causing this.

the heart of the EXCLUDE ON command simply sets

pObject->bExcluded = true;

I was expecting it to remove its pointer from g_ObjectList into a temporary list but it doesn't do that.

Need to keep digging.....

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 10th Nov 2012 22:05
DBPro's implementation is just... weird at times.
For example pick object seems to go through all objects and then select the ones with the ID's you give it.
You'd think there should be a dictionary mapping the ID's to the actual resources / pointers to them (and I'm most certain there is, but why isn't it used in that particular function? Would speed up things a lot compared to linearly searching through all objects).


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2026-07-10 13:17:47
Your offset time is: 2026-07-10 13:17:47