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 / A question of Framerates using all the flavours

Author
Message
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 27th Jun 2006 20:09 Edited at: 27th Jun 2006 20:11
I've been trying to figure out why there is a performance issue with the DGDK, compared to DBP when running an application in full screen exclusive mode.

All these following examples use the same means to fire up an application, yet the first one (DBP) gets a nice steady frame rate of around 70fps. The rest, I can't even top 30fps. Even the DGDK C++ version won't go any faster than 30fps. Yet if I run them all in normal windowed mode, they all run more or less at the same framerate as the DBP one, which is to say on my GPU, pretty fast.

Anybody else had this problem with the DGDK version?

DarkBASIC Professional



C++ using the DGDK



C# version soon to be usable with the DGDK.NET



Lastly, Visual Basic.NET



Paul.

[EDIT] Minor ajustments to typos


Home of the Cartography Shop - DarkBASIC Professional map importer
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 27th Jun 2006 22:42
I've just run your examples, I got these results

DBP: 380fps (avg)
DGDK: 55fps (avg)

Very strange indeed...

I know the voices aren't real, but they have good ideas!
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 27th Jun 2006 23:14
Wow!! Good, so It's not just me then. I honestely thought it was a problem with my version of DX, or that it was a debugging version of the libraries, but I cannot put my finger on it.

Thanks for the feedback


Home of the Cartography Shop - DarkBASIC Professional map importer
Kaiyodo
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 27th Jun 2006 23:24
DB pro's default fullscreen mode isn't quite the same as DGDK's. if I run your DBPro example in a fairly high res (1600x1200 in my case) I can see rounded eges to the pixels indicating that DBPro hasn't actually changed the screen res but just stretched the window to full screen size and hidden the start bar.

In this situation you're technically running in windowed mode which means the vsync is turned off, hence the high framerate.

Running the DGDK example really does change the screen res (sharp edges on the pixels and a big pause while my monitor resyncs itself). This enables the vsync and will limit the framerate to whatever the refresh rate of the monitor (60 in my case).

You can get DBPro to force a screen res change rather than scaling the screen by adding a 'Set Window Off' at the start just like you do in the DGDK version. It'll make things consistent at least

Kaiyodo.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 27th Jun 2006 23:24 Edited at: 27th Jun 2006 23:27
I wonder why DGDK bottoms out at such low fps when there is nothing going off in the scene?

So DGDK's frame rate is set by the monitor refresh rate, by default?

Edit: due to simultaneus post

I know the voices aren't real, but they have good ideas!
Kaiyodo
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 27th Jun 2006 23:35
If you're in DGDK fullscreen then yes, you will be limited by the monitor refresh. I don't think DB or DGDK let you turn the vsync on or off (there may be a video driver option you can set to affect it though), but it's probably best to have it on anyway to avoid nasty tearing effects.

Kaiyodo.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 27th Jun 2006 23:37 Edited at: 27th Jun 2006 23:40
Kaiyodo, Yeah, I understand that DBP does this, but DBP isn't the problem. The framerate I get in DBP no matter whether it's full screen exclusive, Windowed or fullscreen Windowed, the frame rate is a nice round 60-70 frames per second. This problem stems to the DGDK. Using the exact same code, the frame rate in Full screen exclusive mode drops to 30fps, or around 25 at least. This is consistant with ALL applications written with the DGDK that turn Window mode off. The unfortunate business here is that if we want to use a fixed size resolution (fullscreen), the only way to do this is to apply the dbSetWindowOff() at the start of our applications.

Anyway, the following code in DBP works correctly for fullscreen exclusive. Even without the 'Set Window Off' call. However, DGDK bahaves alot differently. At some point within the DGDK, some timing code is b0rked I think.



Paul.

[EDIT] Ignore the fF addition, this was just me farting about with the spin of the cube, but took it out again, except for the REM'd bit


Home of the Cartography Shop - DarkBASIC Professional map importer
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 27th Jun 2006 23:38
Yeah your correct, I run the same example in windowed mode and I got 530+ fps, I think in the new update for dbp there is an overloaded version of the set display mode which allows you to turn vsyn on or off.

I know the voices aren't real, but they have good ideas!
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 27th Jun 2006 23:42
My video Sync rate for varying modes is 70Mhz, which normally results in a consistant frame rate at full screen mode. 30fps in the DGDK at full screen is in no way contrary to what the monitor Vysnc refresh rate is (30fps???) Something's definately wrong here.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 27th Jun 2006 23:46
Quote: "Something's definately wrong here."


Absolutly.

I know the voices aren't real, but they have good ideas!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Jun 2006 00:11
I'm not convinced.

Your DBPro app is running in a fullscreen window, while your DSDK app is running in fullscreen exclusive mode which is subject to vsync.

To get like-for-like you should use (from memory):


Don't turn the window off! Try it and see.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Jun 2006 00:14 Edited at: 28th Jun 2006 00:20
I'll try Ian

[EDIT] OMG!!!! How, how cou... How could I be so Stupid!!!!! :/ :

Ian, your a scholar and a gentleman. Of all the things I've been trying to do to get to full screen mode (bar the actual resolution setting, this has been plagueing me for ages and a day! )

Many thanks Ian

[EDIT2] Even so, it must be for the next update, to turn off VSync when setting full exclusive, althouth I thought that dbFastSync already did this.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 28th Jun 2006 00:16
Yep that does it!

Although the dbMaximizeWindow uses the english spelling dbMaximiseWindow.

I know the voices aren't real, but they have good ideas!
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Jun 2006 02:12
Honest peeps, Ian's suggestion!!! I look back now, and think to myself, WTF was I thinking in trying to go full screen and use Exclusive. It's transformed my life going fullscreen windowed. My framerates are so fast now, I 'm having to manually reduce the SyncRate calls to slow things down!!!

I've been in this game for years right, and yet all the time I've been using the DGDK, I've never actually (EVER) called the dbMaximiseWindow and dbSetWindowLayout functions!! ROFLMAO!!!

What? Talk about stating the obvious. Sorry people, but I'm just dumbfounded at my complete and utter lack of ability to spot this stupid and obvious error on my part.

.. (Reaches for the nearest sugarformed glass bottle and proceeds to headbut..)

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Jun 2006 10:58
*Everyone points and laughs at ApexNow*

Come to the last Unofficial DBPro Convention (http://convention.logicstudios.net/)
Dont do anything I wouldn't do. But if you do, take pictures.
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 28th Jun 2006 11:21
Quote: "Sorry people, but I'm just dumbfounded at my complete and utter lack of ability to spot this stupid and obvious error on my part."


We'll let you off this time but only because you're doing the .Net port!

I have vague plans for World Domination
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 28th Jun 2006 11:47
WOW! All this time I had been running in window mode cause my monitor would freak out (like it was changing res) when I just did dbSetWindowOff();. It was a pain in the ass, I was always clicking the startmenu, ect.. Now I can click away and never jack the window! Hurray!

All you need is zeal
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Jun 2006 12:28 Edited at: 28th Jun 2006 12:31
Has anyone noticed that windowed mode looks much more blurry than fullscreen exclusive mode?

It can be easily noticed with 2d drawing or text print and harder to notice with 3d objects.

It seems windowed mode expands or shrinks whatever the resolution choosen to the windows desktop resolution.
That would mean that it if windowed mode is used, it is better always to set the same resolution that windows has, so no deformation occurs.

You may check the code as well as the pic, and do your own tests:





So windowed mode has this disadvantage, or should it work differently? I don't know, but it should be taken into account.
What do you think?

Attachments

Login to view attachments
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Jun 2006 14:23
I think that in fullscreen mode, the DX rendering surface isn't streteched, and isnt taken into account with the rest of the display as being antialiased, therefore line edges and such would not be smoothed off. In windowed mode, the resolution is the same as your desktop, but the actual rendering surface is stretched to accomodate what resolution you set it to with SetDisplayMode.

The way I've found it to work now, is that if I set up windowed fullscreen mode, where my actual screen resolution is 1024x768, but I then call dbSetDisplayMode(800,600,32) before calling the MaximiseWindow and WindowLayout functions, the DX rendering surface is stretched or scaled to accomodate the 1024x768 surface, but DGDK still assumes that I'm rendering at 800x600. Lines and such will be more prominent in Windowed mode. You can rectify the problem by actually adjusting your rendering resolution when calling SetDisplayMode() and passing in the same resolution as your desktop.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Jun 2006 15:25
I think that's the best that can be done.

A possible alternative is to switch the screen resolution (which is fairly simple), but the problem is that causes you to lose all of your DirectX graphics resources, and if the user switches tasks, they end up with a reduced desktop size ... unless you detect this and switch back ... losing your resources again

For free Plug-ins and source code http://www.matrix1.demon.co.uk
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 28th Jun 2006 15:30
apex how does all of this affect asteroids?
do I still need to fix those issues with the graphics?

Science, Mathematics, and Physics do not lie - only people do.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Jun 2006 16:01
Cattle, I've tried this with Asteroids and the issue still exists. The lines do need to be thicken'd to get rid of the choppiness.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 28th Jun 2006 17:45
okies

Science, Mathematics, and Physics do not lie - only people do.

Login to post a reply

Server time is: 2024-11-19 06:53:47
Your offset time is: 2024-11-19 06:53:47