Board index FlightGear Development New features

a kind of ENB for Flightgear?

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

a kind of ENB for Flightgear?

Postby lomar » Sat Aug 22, 2015 10:17 pm

Well, some days ago an user posted two images on the forum, one is a screenshot taken from FG and the other one is this screenshot with some modifications in GIMP:

Image

Image

Would be possible to do this in real time? like using some kind of layer or glow over the simulator's image? would OpenSceneGraph have this kind of feature?

well, i know almost nothing about coding, so i just wanted to hear some suggestions of how you think i could do this. It doesn't need to be something integrated to FG, maybe it could be some standalone tool...

I look forward to hearing to you guys.
Regards!!!
lomar
 
Posts: 224
Joined: Mon Jun 30, 2014 1:38 am
Location: Rio de Janeiro, Brazil
Callsign: lomar
Version: latest
OS: win 10

Re: a kind of ENB for Flightgear?

Postby Thorsten » Sun Aug 23, 2015 6:22 am

If you render to a texture (like Rembrandt does) you can do post-processing on the texture like a filter - see the old movie or night vision effects. In principle, a forward renderer (like default or ALS) can also do a limited range of post-processing operations if done cleverly.

To me, the issue seems to be different though - the first picture simply has poor lighting and fogging - light on the ground is too instense given the clouds, fog color doesn't match the clouds but should be darker, the amount of fog should probably be somewhat larger.... So what should be corrected is the scene lighting (no idea what weather or renderer you've been running) - a post-processing filter just mocks up such a correction, but it would be difficult to find a filter which works for all lighting situations.

For instance, I think the blurry outline of the hills created by the filter looks quite unrealistic - in fact like someone ran a gimp filter :-)
Thorsten
 
Posts: 11378
Joined: Mon Nov 02, 2009 8:33 am

Re: a kind of ENB for Flightgear?

Postby Hooray » Sun Aug 23, 2015 10:01 am

what Thorsten said, the mechanism for such "post-processing" are so called "effects" (see $FG_ROOT/Docs/README.effects) and shaders: http://wiki.flightgear.org/Shader

But for that to be supported, you need to render to an offscreen rendering target (aka a texture/memory buffer) - Rembrandt basically consists basically of multiple such buffers chained together in a cascaded fashion.

By default, the standard rendering pipeline will not do this currently. However, to some extent, custom cameras can be used to emulate this: http://wiki.flightgear.org/Howto:Config ... ew_windows

For example, here's Chris Calef's custom camera setup for his "SkyBox server": http://wiki.flightgear.org/Howto:Config ... rences.xml

These cameras can also be rendered to a buffer/texture: http://sourceforge.net/p/flightgear/fgd ... ultiscreen

Concerning external tools, you could use streamed httpd images and post-process those arbitrarily using a chain of VLC/GIMP etc
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11493
Joined: Tue Mar 25, 2008 8:40 am

Re: a kind of ENB for Flightgear?

Postby hamzaalloush » Sun Aug 23, 2015 12:11 pm

Hooray wrote in Sun Aug 23, 2015 10:01 am:Concerning external tools, you could use streamed httpd images and post-process those arbitrarily using a chain of VLC/GIMP etc


that's a very elegant solution for the advanced user of such tools, without requiring any modification/configuration of FG, but can use a pipe to ffmpeg/libav and such you can achieve what you want indirectly,

provided this is a stream of images, there will be no OpenGL context switching cost for multiple windows like that mentioned in the README.multiscreen,

in the The_FlightGear_Rendering_Pipeline wiki article, it mentions the following about flightgear::CameraGroup, which i thought relevant:

CameraGroup objects are the bridge between an FGViewer and the OSG cameras that render the view. An FGViewer points to one CameraGroup, and only one active view can drive a CameraGroup at a time. The CameraGroup manipulates osg::Camera objects as necessary. Subclasses of CameraGroup might not respond to FGViewer requests to change camera parameters.

CameraGroups allow the specification of graphics windows to which slave cameras in CameraGroup objects are assigned. Allow the full specification of viewing parameters -- position, orientation -- either as relative to a master camera or independent. Allow the camera parameters to be specified relative to the master

Camera groups can be created and destroyed on the fly; the CameraGroup will create OSG cameras as necessary and attach them to the proper graphics window.

FGViewer objects can either use named camera groups or can create new ones on the fly.

The cameras in a camera group don't need to render directly to the screen. They can render to a texture which can be used either in the scene, like in a video screen in the instrument panel, or for distortion correction in a projected or dome environment.
hamzaalloush
 
Posts: 632
Joined: Sat Oct 26, 2013 9:31 am
OS: Windows 10

Re: a kind of ENB for Flightgear?

Postby Hooray » Sun Aug 23, 2015 1:34 pm

right, but as far as I can tell, indirect rendering to a texture isn't explicitly documented anywhere - but looking at the pipeline builder, the corresponding settings seem to be (as per: http://sourceforge.net/p/flightgear/fli ... p.cxx#l994 ):

  • a <texture> node
  • a texture/name node
  • texture/width and texture/height nodes

or, in XML terms:
Code: Select all
<texture>
<name>myTexture</name>
<width>1024</width>
<height>768</height>
</texture>


which is also used for building the distortion camera: http://sourceforge.net/p/flightgear/fli ... p.cxx#l752

Note that I haven't tested any of this recently, and I guess that people regularly using/creating and maintaining effects/shaders (like Thorsten) are in a much better position to judge if/how this might work or not.

Otherwise, most of this isn't currently exposed to the rest of the sim (certainly not at run-time), but this is touching on the idea of providing a dedicated "camera" element for Canvas, so that Cameras can be rendered to Canvas FBOs: http://wiki.flightgear.org/Canvas_Devel ... ng_Cameras

As well as supporting independent Camera positions (=non slaved cameras) using OSG's CompositeViewer: http://wiki.flightgear.org/CompositeViewer_Support

For the time being, non-coders are probably well advised to investigate using the httpd streaming module, in conjunction with 3rd party software like ffmpeg/libav etc
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11493
Joined: Tue Mar 25, 2008 8:40 am


Return to New features

Who is online

Users browsing this forum: No registered users and 3 guests