Compositor: Difference between revisions

2,659 bytes removed ,  23 April 2019
no edit summary
No edit summary
No edit summary
Line 6: Line 6:


{{infobox subsystem
{{infobox subsystem
|image      = Clouds experiment.jpg
|image      = ALS Compositor pipeline.jpg
|name        = Compositor Subsystem
|name        = Compositor Subsystem
|started    = 01/2018 (Available since FlightGear 2018.4.0)
|started    = 01/2018 (Available since FlightGear 2018.4.0)
Line 71: Line 71:


== Status ==
== Status ==
'''02/2019'''
'''04/2019'''


The Compositor is in an usable state right now: it works but there are no effects or pipelines developed for it. There are also some bugs and features that don't work as expected because of some hardcoded assumptions in the FlightGear Viewer code.
The Compositor is in an usable state right now: it works but there are no effects or pipelines developed for it. There are also some bugs and features that don't work as expected because of some hardcoded assumptions in the FlightGear Viewer code. The next step would be to migrate ALS and Rembrandt effects and from there we can start adding new features. For that the Effects framework needs to know about the existence of the Compositor so it can choose between different implementations of the same Effect depending on the Compositor being used.
 
The corresponding set of patches (topic branches) were put up for review in 08/2018 to discuss the underlying approach and hopefully get this merged in 2019. <ref>https://sourceforge.net/p/flightgear/mailman/message/36355833/</ref>
 
As of 02/2019, a set of merge requests has been created for the Compositor framework for SimGear, FlightGear and FGData respectively.
 
The Compositor is disabled by default at compilation time in
FlightGear (not SimGear). Both Rembrandt and the forward pipeline are
still available if this flag is disabled.
 
(There is a known issue where FG will crash with a segfault if a valid
Compositor XML isn't found.)
 
The FGData merge request only includes the Low-spec pipeline, which
imitates the current near/far camera forward pipeline.<ref>https://sourceforge.net/p/flightgear/mailman/message/36578956/</ref>
 
James and Richard agreed that śince compilation is disabled by default, it might be easier to merge more or less as-is (unless there’s something really awkward), and then make any adjustments on top?
 
That also means we can enable this option on Jenkins to get platform coverage.<ref>https://sourceforge.net/p/flightgear/mailman/message/36579111/</ref> <ref>https://sourceforge.net/p/flightgear/mailman/message/36583393/</ref>
 
And this would make things easier for other people willing to collaborate.
 
Everything is structured so nothing is affected when the compositor is
disabled at compile time, so there shouldn't be any breakage from the
commit.<ref>https://sourceforge.net/p/flightgear/mailman/message/36583493/</ref>
 
James and Stuart are hoping to review the merge request in time for 2019.1 <ref>https://sourceforge.net/p/flightgear/mailman/message/36587786/</ref> <ref>https://sourceforge.net/p/flightgear/mailman/message/36587830/</ref>
 
Richard offered to assist making changes that are required to the animation parsing/handling; including putting stuff into the property tree. <ref>https://forum.flightgear.org/viewtopic.php?f=47&t=35095&p=339699&#p339788</ref>


== Features ==
== Features ==
Line 283: Line 255:


Rendering dynamically to a cubemap is possible. As with shadow mapping, minimizing the object count and number of forward passes is vital to get good performance in FlightGear. Rendering to six cubemap faces requires six forward passes, but we can render to a dual paraboloid map instead, reducing this number to two.
Rendering dynamically to a cubemap is possible. As with shadow mapping, minimizing the object count and number of forward passes is vital to get good performance in FlightGear. Rendering to six cubemap faces requires six forward passes, but we can render to a dual paraboloid map instead, reducing this number to two.
== Canvas integration ==
[[File:Blur_and_blue_filter_applied_to_a_buffer.png|thumb|Post processed image (right) after applying gaussian blur and a blue filter to a scene pass (left).]]
Apart from serving as a debugging tool for visualizing the contents of a buffer, integrating the Compositor with [[Canvas]] allows aircraft developers to access RTT capabilities. Compositor buffers can be accessed within Canvas via a new custom [[Canvas Image]] protocol '''buffer://'''. For example, the path <code>buffer://test-compositor/test-buffer</code> displays the buffer test-buffer declared in test-compositor.
<syntaxhighlight lang="nasal">
var (width,height) = (612,612);
var title = 'Compositor&Canvas test';
var window = canvas.Window.new([width,height],"dialog")
.set('title',title);
var myCanvas = window.createCanvas().set("background", canvas.style.getColor("bg_color"));
var root = myCanvas.createGroup();
var path = "buffer://test-compositor/test-buffer";
var child = root.createChild("image")
    .setTranslation(50, 50)
    .setSize(512, 512)
    .setFile(path);
</syntaxhighlight>


== TODO ==
== TODO ==
Line 310: Line 262:
* Some kind of versioning system to be able to make breaking changes in the future if/when the compositor is updated in any significant way, without people having to manually update their configs.
* Some kind of versioning system to be able to make breaking changes in the future if/when the compositor is updated in any significant way, without people having to manually update their configs.
* Effects registry. [http://www.zaretto.com/sites/zaretto.com/files/compositor-effects-registry.pdf Design document].
* Effects registry. [http://www.zaretto.com/sites/zaretto.com/files/compositor-effects-registry.pdf Design document].
* Bring back Canvas integration so aircraft devs have access to the rendering pipeline. This allows to render exterior views in cockpit displays etc.


== Known Issues ==
== Known Issues ==
343

edits