API Question Getting list of object in ground base

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Hello to all,

I'm working on graphics client plugin for the Orbiter using new DirectX 11 API, and I came across the issue that there seems to be no way to get a list of objects that ground bases consist of (like RUNWAYLIGHTS, RUNWAY and so forth), along with their settings. This information is in bases' config files, and so in worst case scenario I can just manually parse those files and get this info, but I'm hoping that there is some sort of API call(s) which will return that info. This will provide me more flexibility as if the format of those files will be changes in future versions, I will not have to re-write that code.

Thanks in advance for any help!
 
RUNWAYLIGHTS, BEACONARRAY, SOLARPLANT, etc. (animated objects) aren't currently available for external graphics client via Orbiter API. You need to parse the scenario file being loaded to get system name, MJD and CONTEXT (existence of some bases may depend either on PERIOD/CONTEXT), parse configuration of system, planets & moons, and parse configuration files of eventual surface bases.

I was writing once a plug-in that does the same and exports all parameters of those objects via its API: [Project] Enhanced Bases Environment [0.1.0.0 alpha], but it was never finished, and only initial alpha version was uploaded to forum (its API changed in next private builds, so people who used that alpha version would need to rewrite their code, anyway).

The configuration files' format will less likely change, than those objects will be finally added to graphics server-client interface. Adding them was low priority for release of Orbiter 2010. The Orbiter's external graphics API isn't final, so you'll more likely need to change your code when the graphics interface changed than configuration files' format changed.
 
Thank you for your reply! I will take a look at your project - maybe it's time to bring it back to life? :)

As for graphics API - you're absolutely right, and there are certain things that absolutely needs to be done - first and the most important being getting rid of GDI in graphics core, and moving on to Sketchpad's instead :) Neccessity to support GDI is seriously limiting ways I can go about doing some things, for example I can't use multisampled backbuffer and textures, which would be very useful for many things - mostly shadow maps and per-pixel lighting model that I use now.
 
Last edited:
Hello to all,

I'm working on graphics client plugin for the Orbiter using new DirectX 11 API,
Are you working on another D3D11Client ? Do you have some working result already ?

Thank you for your reply! I will take a look at your project - maybe it's time to bring it back to life? :)

As for graphics API - you're absolutely right, and there are certain things that absolutely needs to be done - first and the most important being getting rid of GDI in graphics core, and moving on to Sketchpad's instead :) Neccessity to support GDI is seriously limiting a ways I can go about doing some things, for example I can't use multisampled backbuffer and textures, which would be very useful for many things - mostly shadow maps and per-pixel lightning model that I use now.
If you create a GDI-compatible texture with the same size that the back buffer has and use it for GDI, then you can use multisampled back buffer. I did it in my version of D3D11Client and it works with any multisampling mode. Also old MFDs seems to directly use HDC, so I don't think you will be able to get rid of GDI completely.
 
Are you working on another D3D11Client ? Do you have some working result already ?
Sort of - some of major things - like planet's rendering (including high detail levels - tested up to level 11 as I don't have more detailed textures), vessels, atmospheric effects are implemented and working reasonably well. Now I'm fighting with GDI-related tricks - mostly MFDs.

If you create a GDI-compatible texture with the same size that the back buffer has and use it for GDI, then you can use multisampled back buffer. I did it in my version of D3D11Client and it works with any multisampling mode. Also old MFDs seems to directly use HDC, so I don't think you will be able to get rid of GDI completely.
Yes I know that - that's why I'm saying that unless GDI is removed from Orbiter core, I can't afford dropping a support for it :) The problem with GDI is that in literally destroys performance as textures are going back and forth between video and system memory, and GPU hasn't got anything to do during that. Try removing GDI and compare your framerate :)
Its actually pretty interesting that orbiter core is requesting a Sketchpad for the back buffer once during the start-up, but doesn't seem to use it for any rendering. But that is the reason I've made my back-buffer GDI-compatible - I can't know for sure that in won't be neccessary so I'm stuck without MSAA :(
And last thing - allthough I live in Canada, I'm Russian, originally from Moscow ;)
 
Last edited:
Sort of - some of major things - like planet's rendering (including high detail levels - tested up to level 11 as I don't have more detailed textures), vessels, atmospheric effects are implemented and working reasonably well. Now I'm fighting with GDI-related tricks - mostly MFDs.
all these GDI/2D problems solved in D3D11Client, so may be you should take a look at it.

Yes I know that - that's why I'm saying that unless GDI is removed from Orbiter core, I can't afford dropping a support for it :) The problem with GDI is that in literally destroys performance as textures are going back and forth between video and system memory, and GPU hasn't got anything to do during that. Try removing GDI and compare your framerate :)
I tried and yes, GDI can reduce framerate by 2-2.5, but it can only happen in VC (redraw of HUD) or with some big annotations. I solved it by using D3D11pad for HUD, markers and backbuffer, so GDI now can use only MFDs. So there's no significant fps drop now.

Its actually pretty interesting that orbiter core is requesting a Sketchpad for the back buffer once during the start-up, but doesn't seem to use it for any rendering.
AFAIR, it uses it for rendering some strings on splash screen. Though, in my version it is not visible because of splash screen constantly redraws itself.

But that is the reason I've made my back-buffer GDI-compatible - I can't know for sure that in won't be neccessary so I'm stuck without MSAA :(
I did the same thing in earlier versions of D3D11Client but due to some problems with multisampling, multithreading and ClaerRTV() I decided to use GDI buffer + multisampled BB, and draw GDI buffer only if was some GetDC/Sketchpad call for backbuffer (rare). This approach create no or very small fps drop.

And last thing - allthough I live in Canada, I'm Russian from Moscow ;)
получается что мне не обязательно все писать на английском. :) Вы планируете разрабатывать свой клиент параллельно уже существующему ? открытый ли будет код ? можно ли посмотреть на текущий результат ?
 
I actually had no idea D3D11Client exist in the first place :) I will take a look and see how things are over there. Maybe it would be easier for me to take it and switch to working on it instead.
получается что мне не обязательно все писать на английском. :) Вы планируете разрабатывать свой клиент параллельно уже существующему ? открытый ли будет код ? можно ли посмотреть на текущий результат ?
I think we'll have to stick to English as this is a public forum and there are readers who doesn't speak Russian, but in private nothing prevents us from talking on our native language :)
And yes it will go open source after it will be ready for use and sort of stable enough for that. Now it's just too earlier - I'm working on it during my spare time for less than one month :)
 
Last edited:
Back
Top