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 / Statistics Display with Shader trouble

Author
Message
Alkerak
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 9th Mar 2011 18:29
I have this code.
My FPS count is always half of the sync rate. It's unnatural.
Also, my poly count is always 2. (Probably from the plain object shown for shader rendering).
How can I get clear statistic results?


Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Mar 2011 20:47
Quote: "My FPS count is always half of the sync rate"


Your code is doing two syncs per screen refresh.

Quote: "How can I get clear statistic results?"


You need to record the statistics result separately for each sync (and if you render multiple cameras simultaneously it seems you get the combined result from all cameras rendered).

Try this:

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Mar 2011 21:22
Quote: "Also, my poly count is always 2. (Probably from the plain object shown for shader rendering)."

Not sure that there's a way for DBPro to avoid this for you, as it doesn't know you are syncing twice due to shaders. You'll just need to divide your rate by 2.

Quote: "How can I get clear statistic results?"

... er, what GG said. Looks like statistics are cleared every sync.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Mar 2011 00:37
@IanM Did you quote the right bit in your first quote there?

Looks like it's been a long day all round.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Mar 2011 20:31
Yeah, just ignore that post except where I seconded your statistics suggestion.

What I should have said: Determine what your actual rate is by using the timer command - the SCREEN FPS could be accurate or not, depending on whether or not the SYNC CAMERA command is rendering only, or is delaying as the normal SYNC command does.

Alkerak
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 11th Mar 2011 03:43
@IanM
Quote: "
What I should have said: Determine what your actual rate is by using the timer command - the SCREEN FPS could be accurate or not, depending on whether or not the SYNC CAMERA command is rendering only, or is delaying as the normal SYNC command does.
"


How would I "clock" the speed of the system with the timer command?
It returns miliseconds, but then I need to divide per frames. So one sync is basically a frame?

@Green Gandalf
I don't understand something in your code.
You have three camera's, 0, 1 and 2.
I looked at the documentation for sync mask command and it accepts a DWORD. They say there that 1 is camera 0, 2 is camera one and so forth. By this logic with "sync mask 4" should we not render camera 3? In your code it says "render camera 2" only.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Mar 2011 17:00
Quote: "They say there that 1 is camera 0, 2 is camera one and so forth"


It doesn't say that in my copy of DBPro. Mine says quite clearly (my emphasis in bold):

Quote: "Camera zero is represented in bit 1, camera one in bit 2, and so on. A bit state of zero means the camera will not be rendered, and a bit state of 1 means the camera will be rendered, as is the default behaviour."


The bits correspond to powers of 2, so 4 is camera 2, 8 is camera 3, 16 is camera 4 and so on. The values correspond to the bits in the mask so setting bits 0 and 3 say would mean cameras 0 and 3 and the decimal representation of the mask would be 9, i.e. 2^0 + 2^3 = 1 + 8 = 9. I use decimal representations because that's what I'm used to. You can use a binary or hex representaion if you find it more natural.
Alkerak
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 11th Mar 2011 17:31
I get it now, thanks a lot, makes sense indeed.
But is it not more simple to just use sync camera [number] command?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Mar 2011 21:20
They don't do exactly the same thing - camera 0 has special properties with the SYNC command, but not with SYNC CAMERA. In addition, SYNC CAMERA only comes with the shader plug-in.

Quote: "How would I "clock" the speed of the system with the timer command?"

You do it exactly the same way that DBPro does it - you count the SYNC commands until 1 second has passed, and that's your frame rate:


The difference being that you only count when you call SYNC for camera 0.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Mar 2011 23:30
Quote: "But is it not more simple to just use sync camera [number] command? "


Quote: "They don't do exactly the same thing "


I'm sure that in one of my demo programs sync camera was far slower than the corresponding sync mask/sync pair. But I was busy doing something else at the time and never investigated it properly.

Quote: "SYNC CAMERA only comes with the shader plug-in."


Is that still true? I thought the commands now came with DBPro. I've got DarkShader so can't easily tell (or don't know how ).

Login to post a reply

Server time is: 2026-07-15 03:39:37
Your offset time is: 2026-07-15 03:39:37