I am not much of a graphics coder, but I have previously succeeded doing this by referring to the photoscenery patches that are to be found in the wiki:
http://wiki.flightgear.org/Photoscenery ... otosceneryI used that code as a template to come up with effects/shader support for Canvas textures:
http://wiki.flightgear.org/Canvas_Devel ... 2F_ShadersThese days, I believe it would be more appropriate to skip this step and directly integrate the Canvas system with the SGMaterial infrastructure - but I didn't realize that back then. If done properly, any Canvas would become available as a material, and any material can use effects and shaders - i.e. you could have nested chains of materials using one Canvas as the input, and another as the output - ultimately, approaching what Tim Moore and Stuart originally discussed on the devel list a while ago:
http://www.mail-archive.com/flightgear- ... 37873.htmlTim Moore wrote:It would be nice if the Effects framework had a way to load arbitrary textures and make them available to effects.I don't know if there is a better way to create your texture offline than write C++ code in simgear. OSG will read a TIFF file with 32bits per component as a floating point texture... assuming you can create such a thing
In general, this is one of the more commonly requested features:
https://sourceforge.net/p/flightgear/ma ... /32072598/James Turner wrote:If you want to pass substantial amounts of data, I’d suggest to use a texture (with filtering disabled, probably) to pass the info. Since we don’t have much chance of using the ‘correct’ solution (UBOs) in the near future.
If you need help generating a suitable texture on the CPU side, let me know.
Thus, if/when the Canvas system is sufficiently integrated with the effects/shader system, any camera (MFD/scenery, offscreen or not) can trivially make use of this functionality without requiring tons of custom code - at the mere cost of adding the corresponding Canvas Elements to the Canvas::Group registry, which would also work for slave-cameras (or those using OSG CompositeViewer):
http://wiki.flightgear.org/Canvas_Sandbox#CanvasCamerahttp://wiki.flightgear.org/CompositeViewer_SupportThis would also provide an excellent extension mechanism for alternate scenery/terrain schemes like psadro_gm's work or the osgearth work created by poweroftwo.
As usual, most of the functionality is already there, it's just not very well integrated (yet), because many features were/are being developed independently (so far).