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.

Dark GDK / dbExcludeObjectOn question

Author
Message
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 19th Mar 2011 05:46
Does dbExcludeObjectOn remove the mesh from GPU memory? I want to load several object but I don't want to show them at the same time.

The fastest code is the code never written.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th Mar 2011 13:19
I don't think so, I think they are just excluded from the DGDK render loop... Anyway it is suitable for your purpose

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 21st Mar 2011 19:01
Quote: "I don't think so"

Then how is dbExcludeObjectOn different than dbHideObject?

The fastest code is the code never written.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 22nd Mar 2011 04:21
I've never used it but the manual says it excludes it from collision detection.

Warning! May contain Nuts!
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 22nd Mar 2011 11:38
Quote: "Then how is dbExcludeObjectOn different than dbHideObject?"

Eeem, good question. Hide object makes the object to not to be rendered, but it still resides in the 'object stack' and so, it is checked every loop to see if it should be shown or not, while exclude object takes the object out of the DGDK stack and no further checking is performed per loop for it, until it is un-excluded.

Bear in mind that I just talk about the documentation, I haven't really looked into the insights of the source code, but that should be the concept behind excluding objects, as far as I understood

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 24th Mar 2011 08:38 Edited at: 24th Mar 2011 08:40
I searched the forum for "exclude object" (by the way it's worth to search in two words because then you find the DB Pro references as well). I found some posts in which they say that excluding makes faster performance than hiding, because it removes the object from every rendering check. The price is that you cannot manipulate the object data while it is excluded. (I only write what I found on the forum because I don't have personal experience with this command, but it confirms what Morcilla said.)
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Mar 2011 19:04
Thanks for the insight. I have been using dbExcludeObjectOn() for everything that I would not want in a specific scene but would want it in a different scene. The problem is that video cards have a specific amount of memory and a good chunk of that is taken up by textures. A smaller portion is normally used for mesh data, but every bit counts. If you dbCloneObject() it will make a completely different mesh and it would be sent to the GPU allong with all the others--this means memory usage. dbInstanceObject() does not take up extra memory, but you can't have an animated "instanced" object animate independantly from it's source mesh. So if I want to have animated objects, I have to clone them--which means more memory. I don't want to delete them and re-clone them, so I wanted to be sure that dbExcludeObjectOn() kept it out of GPU memory....

At this point, I don't think I have a memory problem or a performance problem; I just wanted to make sure I wouldn't have it in the future when my game gets bigger and more complex.

The fastest code is the code never written.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 25th Mar 2011 16:22
If you want to store stuff in ram memory, instead of video ram memory, you could check Oneka's thread, it tells how to do so:

Ever wanted to control how GDK loads resources?

Login to post a reply

Server time is: 2024-09-28 12:41:16
Your offset time is: 2024-09-28 12:41:16