Hackathon Proposal: CompositeViewer and Canvas: Difference between revisions

Jump to navigation Jump to search
m
not sure why the template needs the branches specified like that ...
mNo edit summary
m (not sure why the template needs the branches specified like that ...)
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Hackathon Proposal
{{Hackathon Proposal
|title=CompositeViewer and Canvas
|title=CompositeViewer and Canvas
|image = Fg-cv-textures2.jpeg
|image = cvcanvas-777.jpeg
|sponsor=[[User:Cgdae|Cgdae]], Fernando,
|sponsor=[[User:Cgdae|Cgdae]], Fernando,
|supporters=
|supporters=
|status=
|status=
We came across some tricky issues, but made lots of progress.


Here's a demo video demonstrating a Canvas View on the panel of a Harrier-GR3 showing a view from the camera pod under the aircraft: [http://op59.net/cvcanvas-demo.ogv cvcanvas-demo.ogv].
'''Post-hackathon write-up'''


We also managed to get a 777 to show an outside view on one of the cockpit displays.
''Summary''


Things we learnt or talked about:
We came across some tricky issues, but made lots of progress and ended up with a couple of working demos.
* Some issues we came across when making an object in the aircraft model serve as a placement for a Canvas View:
 
** The object surface should uses a material with 'emis 1 1 1', otherwise it seems to only shows up when lit up by sunlight. This can be confusing if one is testing while one's aircraft is facing into the sun.
The code changes we made are very hacky and will need a fair amount of cleaning up before we think of pushing to next.
** When the surface(s) of the object reference vertices, they need to specify differing texture coordinates (not just '0 0' for each vertice reference, otherwise nothing shows up.
 
All the work we did is on branch topics/cvcanvas of the main flightgear, simgear and fgdata repositories:
 
* {{repo link
| site  = sf
| repo  = flightgear
| branch = topics/cvcanvas/~
}}
* {{repo link
| site  = sf
| repo  = simgear
| branch = topics/cvcanvas/~
}}
* {{repo link
| site  = sf
| repo  = fgdata
| branch = topics/cvcanvas/~
}}
 
''Demo videos''
 
* [http://op59.net/cvcanvas-777-tailcam.webm cvcanvas-777-tailcam.webm] Canvas View used for cockpit display of tail camera on a 777.
* [http://op59.net/cvcanvas-demo.ogv cvcanvas-demo.ogv] Canvas View on the panel of a Harrier-GR3 showing a view from the camera pod under the aircraft, plus a flying billboard and some extra view windows.
 
''Things we learnt or talked about''
 
* We ran into some minor problems making an object in the aircraft model serve as a placement for a Canvas View:
** The object surface should uses a material with '''emis 1 1 1''', otherwise it seems to only shows up when lit up by sunlight. This can be confusing if one is testing while one's aircraft is facing into the sun.
** When the surface(s) of the object reference vertices, they need to specify differing texture coordinates (not just '''0 0''' for each vertice reference), otherwise nothing shows up.
* The textures that Canvas uses are tied to graphics contexts, so aren't shared between windows. This means that extra view windows don't show in-cockpit displays. It was suggested that sharing textures was actually possible, as long as the graphics contexts are on the same GPU.
* The textures that Canvas uses are tied to graphics contexts, so aren't shared between windows. This means that extra view windows don't show in-cockpit displays. It was suggested that sharing textures was actually possible, as long as the graphics contexts are on the same GPU.
* We can't yet change a Canvas View to show a different view, e.g. swap between tail-camera and gear-camera. The underlying CompositeViewer has full support for destroying and creating new views, and Canvas supports adding/removing elements, so hopefully this will be relatively easy to address.
* We can't yet change a Canvas View to show a different view, e.g. swap between tail-camera and gear-camera. The underlying CompositeViewer has full support for destroying and creating new views, and Canvas supports adding/removing elements, so hopefully this will be relatively easy to address.
* Frame rates might be significantly affected even if a Canvas View is only showing a small part of the scene.
* Frame rates might be significantly affected even if a Canvas View is only showing a small part of the scene.
* Apparently it should be possible to make a Canvas View show different affects, such as infra-red vision.
* Apparently it should be possible to make a Canvas View show different effects, such as infra-red vision or artificial terrain. The implementation internally uses a Compositor instance to manage the view's rendering pipeline, so it is possible to completely change the Effects and shaders that the view uses.
* Canvas cameras being in the scene graph is a problem in the long run and should be revisited. The scene graph cameras are being rendered for each slave camera present in the rendering pipeline (i.e. each Compositor render pass), so there are definitely other motivations to make this happen separate from this particular proposal: [[Post FlightGear  2020.2 LTS changes#Canvas]]


|summary=[[CompositeViewer Support]] already allows us to create multiple top-level windows showing different views of the same scenery.
|summary=[[CompositeViewer Support]] already allows us to create multiple top-level windows showing different views of the same scenery.
Line 29: Line 58:
** Exterior views (tail cam, gear cam etc).
** Exterior views (tail cam, gear cam etc).
** Synthetic terrain.
** Synthetic terrain.
** [[Canvas Tile Element|moving map displays]] displaying actual FlightGear terrain data by rendering an orthographic view of the scene using custom LOD and node masks (for the time being FlightGear avionics tend to render pre-downloaded images/PDF files or data external web services that do not match FlightGear scenery) .
* Rear-view mirrors.
* Rear-view mirrors.
* Shuttle RMS arm/END EFF mode <ref>https://forum.flightgear.org/viewtopic.php?f=87&t=25747&p=282898&#p282898</ref> <ref>https://forum.flightgear.org/viewtopic.php?f=87&t=25747&hilit=&start=2160#p326104</ref> etc) <ref>https://sourceforge.net/p/flightgear/mailman/message/37147262/</ref> <ref>https://forum.flightgear.org/viewtopic.php?f=87&t=25747&hilit=&start=2160#p326182</ref>
* Shuttle RMS arm/END EFF mode <ref>https://forum.flightgear.org/viewtopic.php?f=87&t=25747&p=282898&#p282898</ref> <ref>https://forum.flightgear.org/viewtopic.php?f=87&t=25747&hilit=&start=2160#p326104</ref> etc) <ref>https://sourceforge.net/p/flightgear/mailman/message/37147262/</ref> <ref>https://forum.flightgear.org/viewtopic.php?f=87&t=25747&hilit=&start=2160#p326182</ref>

Navigation menu