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 / Predicting Best Multisampling Rate

Author
Message
Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 10th Feb 2011 02:28
Is there a method for calculating the highest multisampling rate for antialiasing from data that I can collect from a user's system and data I would know about my program?

For example, in some cases I run my programs with a factor of 8 with no problem. In others, I have to back down to 4 or else objects that are supposed to move simply don't.

I know how to test whether a user's card supports antialiasing, the user's available screen resolutions, etc., and what fps I'm trying to force. Is there a way I could use such information, and/or other information that could be calculated or measured, before executing the Set Display command so that my program sets the highest multisampling rate that will not cause a problem on the highest resolution that is found available?
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Feb 2011 02:52
Check the DBP help files in the Basic3D section.

Near the bottom are the availability commands.

You can also perform a checklist for available resolutions to populate a list that you can then have the user choose from.

Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 10th Feb 2011 03:24
I know how to use those investigative commands. I'm making short programs that don't pre-suppose that the user would be interested in going through an options menu to select a resolution, so I measure the best resolution that the user's card supports and set the display to that, as full screen. What I need is guidance on how I use the information I obtain to set the multisampling rate. I have a few programs where antialiasing makes a very big difference in visual realism, and so I want to employ it if the user's machine supports it. But what rate do I set?

Let us suppose that I check the available resolutions on the user's machine and find a maximum of 1920 x 1200 pixels at 32 bit depth (which happens to be the case with my monitor), and find that the card supports antialiasing. Say also that my program shoots for a sync rate of 40. How do I use this information, either alone or in conjunction with other information I could measure concerning my program, to determine whether to set the multisampling rate at 2, 4, 8 or 16? I want to avoid a situation where the user has to select it from an options menu. I hope to find a way to predict what it should be without causing a problem.
CodemanV
20
Years of Service
User Offline
Joined: 25th Aug 2005
Location: South Wales Valleys, UK
Posted: 10th Feb 2011 04:26 Edited at: 10th Feb 2011 07:16
Hello

I've only just installed the newest DBPro 7.7 RC4 so I have yet to familiarise myself with any new commands and do not know if the following suggestion is feasible.

Would it be possible to create small scenes for benchmarking in the background implementing the various settings?

i.e.
Create 3 small benchmark scenes,
scene 1 is low activity
scene 2 is typical of how the program usually runs
scene 3 is intense with high activity

On installation or in the options , have a "Detect Optimal Settings" part.

Loop through the settings (Off, 2x, 4x, 8x, 16x)

At each setting, render each of the 3 scenes to the backbuffer only. For each scene, you could record memory usage, how long the scenes take to complete, average backbuffer FPS, etc.

Taking into account memory usage and scene time, the setting with the closest "average backbuffer FPS" to 40 for all three backbuffer scenes should be the best setting for that particular PC.

At least in theory anyway

--- edit ---
Just thought, another way to stress test is to have one benchmark scene starting with a low amount of objects and calculations.

Render that scene and add some objects and calculations until FPS drops below 40 or a minimum acceptable FPS like 35 or something.

Then start again with low scene at the next setting.

--- edit 2 ---
Just tried an experiment using "Check Display Mode" with 5 parameters


but I get an error
Quote: "Parameter for 'Check Display Mode' do not match 'Width, Height, Depth' at line 48."


The help file states that these are acceptable parameters so I don't know what is wrong there.
Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 10th Feb 2011 12:50
Thank you for your interest.

Your Check Display Mode code is probably failing because you are passing 5 of 6 parameters, omitting VSYNCON and placing the multisampling rate where VSYNCON is expected.

The stress test is essentially what I use to set the multisampling rate for my particular program on my particular machine at my particular maximum resolution. I back down the multisampling rate until the program works properly at the sync rate I need. I was assuming that different user machines/graphic cards would have different tolerances, even at the same resolution.

If, at a given resolution, and for a given program, the maximum multisampling rate that my setup can tolerate is necessarily the same that everyone else's setup could tolerate, then there is no problem. I simply include a table that sets the multisampling rate according to the resolution. However, I'm not sure that everyone's machine would actually have the same tolerance.
CodemanV
20
Years of Service
User Offline
Joined: 25th Aug 2005
Location: South Wales Valleys, UK
Posted: 10th Feb 2011 19:15
I shouldn't post when I'm tired and coffee-less!

I worked that out earlier (after a snooze and a nice mug of coffee!) and have been experimenting with a benchmark thingy on and off today.

Is your project using 2D or 3D? I only ask as I use different methods for benchmarking them and would like my example to be relevant to your query.

Quote: "However, I'm not sure that everyone's machine would actually have the same tolerance. "


I doubt that they will. The screen resolution isn't the only influencing factor on performance, the FPS will be affected by all the various PC components installed and also background tasks and services might come into play also.

An automatic mini stress test is most probably the way to go. But even then, I've played games that do auto-configuration and after checking what has been configured, I've thought "Hang on a minute, my PC's better than that, surely!?" and manually changed the game settings anyway!
Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 10th Feb 2011 21:01
I'm doing 3D, and I specifically need to run at sync rate 40. Some programs I've bought "propose" a choice of multisampling rates in an options menu. Even if I select the highest, they might run slower but they still run from a functional standpoint. It's as if they have figured out what my machine can tolerate and restricted my choices accordingly. How they do that is what I'm interested in. Might they be quietly checking my video card memory or some other information that could be probed from the card? All I am retrieving so far are available resolutions and the yes/no availability of antialiasing.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Feb 2011 22:35
They may even be checking CPU speed, amount of memory installed, shader level version supported (which you can also do with DBP), and video memory available. Then they come up with a group of settings that they think will be suitable for that system's capabilities.

Just a quick thought, if the current camera is set to 0 and there's nothing in front of it, and camera 1 has 10,000 sphere's rotating in it, and you use sync mask to only sync camera 1, would that still use up as much processing power as if you were displaying it on the screen? Maybe setting camera 1 to an image would work too.

If so, then you could set up that scene pretty easily and test your settings in the background. If it doesn't meet the FPS requirement then you can reduce whatever settings you want until the requirement is met. Then set that as the default setting in an options file. The test would only have to be run the first time they run the program.

Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 11th Feb 2011 00:53 Edited at: 11th Feb 2011 00:54
Hmm. I suppose I could try such a stress test like that as a splash screen, or short series of them. A problem arises when you execute a Set Display Mode command after the program has begun (like using it to adjust the multisampling rate down). It dumps all your assets loaded to that point. Whatever I create for the stress test has to be loaded up again each successive test. Then after the last test I start loading the regular assets, which is a process that the splash screen normally conceals.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Feb 2011 01:12
..and it only has to run the first time.

Set up a screen that just says "Optimizing Display Settings - Please Wait" and sync that to camera 0 on screen, then setup your test on camera 1. They'll see it flicker a few times as it tests and change settings, but since it only has to run once it shouldn't be a big deal. Then you can proceed with loading the game's normal splash screen and assets.

Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 11th Feb 2011 16:24
Thanks for the advice. I'll start working on it.
bitJericho
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 11th Feb 2011 17:57
You should use the user's desktop resolution, rather than the maximum supported resolution. If I were on a CRT, I'd be pissed if the program tried the maximum resolution and I couldn't change it:S

[center]
Join the TGC Group!
http://tehcodez.groups.live.com

Login to post a reply

Server time is: 2026-07-16 01:44:29
Your offset time is: 2026-07-16 01:44:29