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 to measure the polygon count of an object or mesh at runtime ?

Author
Message
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 4th Apr 2012 20:35
Hello,

How do I measure the polygon count of an object / mesh at runtime ?

Thanks,
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Apr 2012 20:51
With the statistic() command.



TheComet

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 4th Apr 2012 21:17
Hello TheComet,

Thank you for your fast and detailed response. This is just awsome.

Thanks,
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 4th Apr 2012 21:36
@TheComet: Any idea about how to measure the RAM consumption ?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 4th Apr 2012 21:42
Too tired to say anything right now... argh... brb

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 4th Apr 2012 22:17
@MrValentine: Thanks anyway for giving it a look.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 4th Apr 2012 22:19


Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 4th Apr 2012 22:42
Quote: "Any idea about how to measure the RAM consumption ?"

task manager

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 4th Apr 2012 22:55
@Brendy boy: Yes that is definitely one way to achieve but can we get the value using dark basic pro code ? Or more specifically on a per object / mesh basis ?
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 4th Apr 2012 23:30
You could take a look here:
http://forum.thegamecreators.com/?m=forum_view&t=195284&b=1
Helpful a conversation about determining the memory usage of a cube.

I don't think there is any real way to do it inside DBP.

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th Apr 2012 23:32 Edited at: 4th Apr 2012 23:34
@Juggernaut

I don't know if these commands exist in DBPro or not but they are in DBC:

SYSTEM DMEM AVAILABLE() will return the total video memory available
SYSTEM SMEM AVAILABLE() will return the total system memory available
SYSTEM TMEM AVAILABLE() will return the overall system memory available

So you could take a memory profile before creating/loading your objects then take a profile after and find the difference.

Enjoy your day.
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 4th Apr 2012 23:42
Quote: "but can we get the value using dark basic pro code ?"

yes, using this commands:
Quote: "
return integer = GET INSTALLED MEMORY( Type )
return integer = GET MEMORY AVAILABLE( Type )
return integer = GET MEMORY PERCENT USED( )
return integer = GET MEMORY PERCENT FREE( )
"

which are part of this plugin

Quote: " Or more specifically on a per object / mesh basis ?"

no

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Apr 2012 08:45
Quote: "no"


You can't say that, you just don't know if it's possible. Of course there's a way to determine the RAM consumption...

TheComet

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 5th Apr 2012 09:04
@zeroSlave: Thank you for pointing out the thread. Yes it is very much related to this current thread. It will take me some time to get to the bottom of that discussion.

@Latch: This is as far as I could get with your hint -



But the result does not exactly tally with the task manager readings. Maybe I am missing something here .....

@Brendy boy: The commands mentioned by you can also be used in the similar fashion as mentioned in the above code - I guess

Thanks,
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 5th Apr 2012 09:48
The code above would surely only find the memory used by the new sphere object you've created and not what is used by the application as a whole so it probably wouldn't tie up with what is in task manager. Sorry if I'm misunderstanding.


Previously TEH_CODERER.
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 5th Apr 2012 10:19
@Andrew_Neale: Thank you Andrew for pointing out the fact regarding the task manager anomaly. By the way .... you are from the most historically famous geographical region of world war II ! Glad to know.... you are among us .....
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Apr 2012 15:50
not sure if this has been mentioned before but you could do a check for memory available and then create the cube then check for memory again?

surely it would give somewhat of an estimate I think I did this a while back...

so

Quote: "
A=check free memory
create cube
B=check free memory
subtract A from B
C=result
"


something like that...

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Apr 2012 20:12 Edited at: 5th Apr 2012 20:14
@Juggernaut
Quote: "This is as far as I could get with your hint - ... But the result does not exactly tally with the task manager readings. Maybe I am missing something here ....."

Memory usage will be volatile. It can change at any time. The commands are guides and not absolutes but can give you a pretty good idea of memory usage.

Also, the memory use can be different if you run in full screen exclusive mode where most of your system resources will be used for your game. In windowed mode, you'll be sharing a lot more stuff with Windows OS so the values may not match up as you expect.

Here's the commands usage example:



Also if you have over 2 gigs of ram, the value might show as negative because of the size of a 32 bit integer. You may be able to cast the variable as a double.

Enjoy your day.

Login to post a reply

Server time is: 2026-07-10 01:06:46
Your offset time is: 2026-07-10 01:06:46