DaveS said:
Hey.
Long time no speak. The reason why I'm contacting you now is that I seem to remember that you were working a replacement for the MFD rendering for SSU. This is something that the rest of us (Urwumpe, GLS, me and SiameseCat) have been talking about for a while now.
It has now taken on quite a bit of seriousness due to a severe reduction in frame rates (40-50%) in the beta version of the next edition of Orbiter. And it seems related to how Orbiter renders MFDs.
We have come up against several limitations of Orbiter MFD rendering which is hampering us. If you could detail your rendering system, I think something could be implemented.
Hi! Yeah, I remember I had something in mind
What I wanted to do is to use pure Direct3D to render MFD to texture and then paint it on VC Panel. Here some pros and cons:
Disadvantages:
- Dependence on DirectX SDK/OpenGL or other rendering sdk(maybe SDL?)
- Device acquiration - basically, graphics client is owner of the graphics device. So when we instantiate our own device, GPU drivers have to switch between instances when rendering particular stuff. And this costs time and potential bugs/memory leaks, as device will lost it's state.
- Sharing texture between devices - one device have to write to texture, second one have to read this and paint. This have to be synchronized. As far as I know, graphics client have to create texture resource for every MFD in order to render it later.
Advantages:
- pure access to Direct2D/Direct3D
- Matrix transformations of objects - f.e. ADI ball can be described as simple textured 3D Mesh, then rotated properly with Matrix and then projected on 2D Plane. I think this is much simpler and faster than manually drawing and transforming 2D shapes in GDI.
This of course is just random idea, but IMO direct access to rendering device and it's resources is key here. Access either via OrbiterAPI (and AFAIK there is no such functionality yet) or via separate instance of device.
I'll try to appear on IRC this evening, se we could discuss it further. Also feel free to paste my message in SSU thread.
I rencently gained some DirectX rendering skills, so I will do some research what can be done here.