Board index FlightGear Development New features

Script for automatic setting of some rendering options

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Script for automatic setting of some rendering options

Postby mmagnin » Mon Jan 19, 2015 8:46 pm

Hello guys, I wrote a nasal script that might be useful for another people, and I want to share it; what it does is automatically (if needed) adjust the parameters of some properties trying to maintain some fps rendering performance in an interval range.

Here is the explanation of how it works:

Each 7 seconds it checks the rendering fps performance.
If the actual fps value is below the desired range, the speed_up function is executed; in the other case where the fps is above the desired max value, it executes the slow_down function.

The default range interval is : MIN_FPS = 30, MAX_FPS = 40

Each function iteration affects incrementally one or several of these properties:

    rendering/particles
    rendering/point-sprites
    rendering/random-vegetation
    rendering/vegetation-density
    rendering/clouds3d-enable
    rendering/clouds3d-density
    rendering/clouds3d-wrap
    rendering/random-buildings
    rendering/building-density
    rendering/random-objects
    rendering/clouds3d-lod1-range
    rendering/clouds3d-lod2-range
    rendering/clouds3d-vis-range
    rendering/clouds3d-detail-range
    sim/model-hz
    sim/ai/enabled

The idea is that it will take a few iterations to adjust the properties to obtain the best clouds, trees and density of buildings configuration to keep the fps performance in the range selected.

You can check the console output to see what the script is doing o trying to do.

Look for the “SCRIPT parameters” section in the code, to tune the values that the script uses; or try it with the defaults values.

I´m no expert in the core of the simulator graphics render engine, so it is possible that the script make some nonsense changing some of the properties; but, so far, it seems to really do a decent job controlling the fps performance.
Code wise, it is not elegant or nice, sorry about that!!!, but I can give it some love if it the community is interested.
Please try it, and give me some feedback.

Link: http://1drv.ms/1J0KpWq

Greetings

Martin
Last edited by mmagnin on Tue Jan 20, 2015 12:35 am, edited 1 time in total.
mmagnin
 
Posts: 16
Joined: Mon Dec 29, 2014 6:59 pm

Re: Script for automatic setting of some rendering options

Postby legoboyvdlp » Mon Jan 19, 2015 8:52 pm

That would be cool, especially if it had an option in the gui for rendering... 3.6 anyone?
User avatar
legoboyvdlp
 
Posts: 7326
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: next
OS: Windows 10 HP

Re: Script for automatic setting of some rendering options

Postby mmagnin » Tue Jan 20, 2015 12:43 am

I updated the link because I found a bug in the building density part, now is corrected. I can work in a GUI dialog if it is of interest.
Let me know what you think. Thank you.
mmagnin
 
Posts: 16
Joined: Mon Dec 29, 2014 6:59 pm

Re: Script for automatic setting of some rendering options

Postby Hooray » Tue Jan 20, 2015 2:19 am

this has been previously discussed and even prototyped - the terms you are looking for are "feature scaling" - for a summary, see:

http://wiki.flightgear.org/Feature_Scaling
http://wiki.flightgear.org/FlightGear_Benchmark
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11493
Joined: Tue Mar 25, 2008 8:40 am


Return to New features

Who is online

Users browsing this forum: No registered users and 4 guests