Board index FlightGear Development Effects and shaders

The Compositor

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: The Compositor

Postby wlbragg » Sun Dec 22, 2019 10:33 pm

FYI:

There is now a compositor branch for the c172p in the developer repository.

There was an issue raised identifying some of the problems at https://github.com/c172p-team/c172p/issues/1307

The branch is at https://github.com/c172p-team/c172p/tree/Issue-1307

Please feel free to submit ports and patches. I would like to get the exterior lighting ported so we can see the nav, strobes and beacon, reflecting off the fuselage, wings and tail. If someone beats me to it, I certainly wouldn't complain.

Image
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5452
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: The Compositor

Postby Thorsten » Fri Dec 27, 2019 7:13 am

I'm happy to report that I've finally succeeded to get a working compositor Windows setup - seems the issue was that for whatever reason a too-old nightly FGData had crept in, re-installing a recent one and then dumping the compositor binary on top did the trick.

Yay! Now to some testing and other fun 8)

(And yeah, I know, this has taken very long to test - don't ask, life is sometimes complicated...)
Thorsten
 
Posts: 11580
Joined: Mon Nov 02, 2009 8:33 am

Re: The Compositor

Postby wlbragg » Fri Dec 27, 2019 7:27 pm

I decided to try to get multi-monitor working under compositor and it isn't working to the point of sometimes crashing the computer. It crashes if I get a certain error message that loops to grow the log too big. The error was something about triangle intersect, nan, I think it was. That only happens sometimes. It happened the first time when clipping was prevalent and I was trying to change the view direction. The second time I tried it I immediately used right and ctrl right mouse to move the view position to where it was not clipping the interior fuselage in most view directions.

The error may have had to do with the monitor views configuration as clipping appears to be different in the non-compositor multi-monitor than it is in compositor multi-monitor. In compositor multi-monitor I was getting clipping of the interior fuselage that I don't get in the non-compositor build.

This is using the same multi-monitor configuration used with the default rendered and the same rendering configuration I use for single monitor compositor build.

Basically I get a black sky in the center monitor and totally black screens in left and right monitors. This happens in both one window + three screen setup or three window + three screen setups.

Am I missing any extra setup or switches needed to use multi-monitor under the compositor?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5452
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: The Compositor

Postby Icecode GL » Sat Dec 28, 2019 9:45 am

I'm happy to report that I've finally succeeded to get a working compositor Windows setup


Very glad to hear that! Feel free to ask about anything else you have problems with.


Am I missing any extra setup or switches needed to use multi-monitor under the compositor?


Nope, it's just probably filled with bugs. I don't have multiple monitors so I don't have an easy way to test this. We'll see in the future.
Icecode GL
 
Posts: 610
Joined: Thu Aug 12, 2010 12:17 pm
Location: Spain
Callsign: icecode
Version: GIT
OS: Arch Linux

Re: The Compositor

Postby Hooray » Sat Dec 28, 2019 10:04 am

The first thing to check, is probably making sure that multiple windows works as expected and then take it from there?
X11 can be used to set up virtual screens/monitors - so that might be another option to emulate multiple screens and see if anything obvious is broken?
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: 11738
Joined: Tue Mar 25, 2008 8:40 am

Re: The Compositor

Postby wlbragg » Sat Dec 28, 2019 4:27 pm

The first thing to check, is probably making sure that multiple windows works as expected and then take it from there?
X11 can be used to set up virtual screens/monitors


Already use these multi-screen setups with default renderer (non-compositor), they work fine, it probably is as Icecode GL has stated.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5452
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: The Compositor

Postby slawekmikula » Sat Dec 28, 2019 4:48 pm

wlbragg wrote in Sat Dec 28, 2019 4:27 pm:Already use these multi-screen setups with default renderer (non-compositor), they work fine, it probably is as Icecode GL has stated.


Could you share your settings for multi-monitor ? I can try it at my desk to double check what the result is.
slawekmikula
 
Posts: 82
Joined: Sun Feb 19, 2017 9:31 am

Re: The Compositor

Postby wlbragg » Sat Dec 28, 2019 4:53 pm

Either of these...

Code: Select all
    <camera-group>

        <window>
          <name type="string">left</name>
          <host-name type="string"></host-name>
          <display>0</display>
          <screen>0</screen>
          <x>0</x>
          <y>0</y>
          <width>1920</width>
          <height>1080</height>
          <decoration type = "bool">false</decoration>
          <fullscreen type = "bool">false</fullscreen>
        </window>
        <window>
          <name type="string">main</name>
          <host-name type="string"></host-name>
          <display>0</display>
          <screen>0</screen>
          <x>1920</x>
          <y>0</y>
          <width>1680</width>
          <height>1050</height>
          <decoration type = "bool">false</decoration>
          <fullscreen type = "bool">false</fullscreen>
        </window>
        <window>
          <name type="string">right</name>
          <host-name type="string"></host-name>
          <display>0</display>
          <screen>0</screen>
          <x>3600</x>
          <y>0</y>
          <width>1920</width>
          <height>1080</height>
          <decoration type = "bool">false</decoration>
          <fullscreen type = "bool">false</fullscreen>
        </window>

        <camera>
          <name type="string">middlecamera</name>
          <window>
            <name>main</name>
          </window>
          <view>
            <heading-deg type = "double">0</heading-deg>
          </view>
          <master-perspective>
            <eye-distance type="double">0.736</eye-distance>
            <y-offset type="double">0.2</y-offset>
          </master-perspective>
          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1680</width>
            <height>1050</height>
          </viewport>
          <physical-dimensions>
            <width>0.474</width>
            <height>0.296</height>
            <bezel>
              <top>0.0</top>
              <left>0.0</left>
              <bottom>0.0</bottom>
              <right>0.0</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <camera>
          <name type="string">leftcamera</name>
          <window>
            <name>left</name>
          </window>
          <view>
            <heading-deg type = "double">35</heading-deg>
          </view>
          <left-of-perspective>
            <parent-camera>middlecamera</parent-camera>
          </left-of-perspective>
          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1920</width>
            <height>1080</height>
          </viewport>
          <physical-dimensions>
            <width>0.474</width>
            <height>0.296</height>
            <bezel>
              <top>0.0</top>
              <left>0.0</left>
              <bottom>0.0</bottom>
              <right>0.022</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <camera>
          <name type="string">rightcamera</name>
          <window>
            <name>right</name>
          </window>
          <view>
            <heading-deg type = "double">-35</heading-deg>
          </view>
          <right-of-perspective>
            <parent-camera>middlecamera</parent-camera>
          </right-of-perspective>
          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1920</width>
            <height>1080</height>
          </viewport>
          <physical-dimensions>
            <width>0.474</width>
            <height>0.296</height>
            <bezel>
              <top>0.0</top>
              <left>0.022</left>
              <bottom>0.0</bottom>
              <right>0.0</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <gui>
          <window>
            <name type="string">main</name>
          </window>
        </gui>
      </camera-group>


Code: Select all
      <camera-group>

        <window>
          <name type="string">main</name>
          <host-name type="string"></host-name>
          <display>0</display>
          <screen>0</screen>
          <x>0</x>
          <y>0</y>
          <width>5500</width>
          <height>1080</height>
          <overrideRedirect type = "bool">true</overrideRedirect>
          <decoration type = "bool">false</decoration>
          <fullscreen type = "bool">true</fullscreen>
        </window>

        <camera>
          <name type="string">middlecamera</name>
          <window>
            <name>main</name>
          </window>
          <view>
            <heading-deg type = "double">0</heading-deg>
          </view>
          <master-perspective>
            <eye-distance type="double">0.736</eye-distance>
            <y-offset type="double">0.177</y-offset>
          </master-perspective>
          <viewport>
            <x>1920</x>
            <y>0</y>
            <width>1680</width>
            <height>1050</height>
          </viewport>
          <physical-dimensions>
            <width>0.474</width>
            <height>0.296</height>
            <bezel>
              <top>0.0</top>
              <left>0.0</left>
              <bottom>0.0</bottom>
              <right>0.0</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <camera>
          <name type="string">leftcamera</name>
          <window>
            <name>main</name>
          </window>
          <view>
            <heading-deg type = "double">45</heading-deg>
          </view>
          <left-of-perspective>
            <parent-camera>middlecamera</parent-camera>
          </left-of-perspective>
          <viewport>
            <x>0</x>
            <y>0</y>
            <width>1920</width>
            <height>1080</height>
          </viewport>
          <physical-dimensions>
            <width>0.474</width>
            <height>0.296</height>
            <bezel>
              <top>0.0</top>
              <left>0.0</left>
              <bottom>0.0</bottom>
              <right>0.019</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <camera>
          <name type="string">rightcamera</name>
          <window>
            <name>main</name>
          </window>
          <view>
            <heading-deg type = "double">-45</heading-deg>
          </view>
          <right-of-perspective>
            <parent-camera>middlecamera</parent-camera>
          </right-of-perspective>
          <viewport>
            <x>3600</x>
            <y>0</y>
            <width>1920</width>
            <height>1080</height>
          </viewport>
          <physical-dimensions>
            <width>0.474</width>
            <height>0.296</height>
            <bezel>
              <top>0.0</top>
              <left>0.019</left>
              <bottom>0.0</bottom>
              <right>0.0</right>
            </bezel>
          </physical-dimensions>
        </camera>

        <gui>
          <window>
            <name type="string">main</name>
          </window>
        </gui>

      </camera-group>
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5452
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: The Compositor

Postby Thorsten » Mon Dec 30, 2019 11:38 am

Okay, I've now taken about an hour to test the compositor.

* referencing shaders for aircraft-side effects doesn't seem to work gracefully - the Shuttle is full of broken effects on the grounds that the compositor expects secondary_lights.frag under Compositor/Shaders/secondary_lights.frag whereas it is under Compositor/Shaders/ALS/secondary_lights.frag, i.e. the lookup doesn't seem to take into account that the ALS pipeline is on here

* performance seems to be good, in Hawaii I've not seen any difference to standard ALS - yay!

* exterior shadows look pretty good - the Shuttle launch gantry surely looks nice when the shadow map is detailed enough

* interior shadows are (like with Rembrandt) too flickery for my taste - unfortunately flickering is something I do not tolerate well, it (literally) gives me headaches

* that's pretty bad because low vegetation (and vegetation shadows) show pretty bad z-fighting, making a view of shrubland a rather painful experience for me :( There's also substantial z-fighting with scenery models - the shuttle launch ramp in Florida is a rather obvious example

* some planes seem to be messed up without showing a shader error message - the EC-135 basically has grey panels while I didn't see an error message (maybe I just missed it, FG has become terribly talkative...)

* the geometry shader overlay is broken for me, whereas geometry shader grass works fine - not sure why that is as they're pretty much the same bit of technolgy

* some nit-picking, but the shadow map should be disabled when the sun is below the horizon. ALS still uses /some/ amount of light under these conditions - the sky is still bright and offers sort of directional light - however this ain't the light that casts sharp shadows any more as it comes not from a small spot but from a sky hemisphere


So it seems there's still a lot of work ahead - we must be able to handle aircraft-side shaders and effects gracefully, we simply can't assume they will be fixed one by one, and right now the flickering really is a big problem (I had to end my flight prematurely, got too dizzy...)
Thorsten
 
Posts: 11580
Joined: Mon Nov 02, 2009 8:33 am

Re: The Compositor

Postby wkitty42 » Mon Dec 30, 2019 1:20 pm

AIR we're still waiting on the compositor updates to be reviewed and merged into the repo... after that, some of the fixes for the frag and eff files follow... that's based on my reports and conversation with ice in one of the discords... not sure what the delay is with the review, though, and i haven't poked our movie creator/director to inquire about it... they are the one doing the review, IIRC...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6328
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: The Compositor

Postby Thorsten » Mon Dec 30, 2019 1:39 pm

AIR we're still waiting on the compositor updates to be reviewed and merged into the repo...


Only lights are pending as far as I know - nothing of the sort of things which would fix what is already merged and doesn't yet work.

At least I would like to have a working state to review changes on top of that, otherwise it's a mess and I have no comparison what might (or might not) be broken.

(Oh, and the delay is 2019.2 being so royally messed up that it took me a while to install a working version while reporting one bug after the other, the compositor binary creation being broken on Jenkins and me reporting that, the nightly handing me a wrong FGData version at some point, needing some extra time to figure out why the compositor didn't work, Christmas preparations, a death in the family and me having health issues making long computer sessions difficult)
Thorsten
 
Posts: 11580
Joined: Mon Nov 02, 2009 8:33 am

Re: The Compositor

Postby Hooray » Mon Dec 30, 2019 1:54 pm

at least those lookup errors you mentioned should be pretty straightforward to fix C++ side, it's the equivalent of adding 2-3 SGPath operations to concatenate the path properly.
However, I believe Richard and Fernando mentioned a scheme with compositor effects and shaders would go into a dedicated compositor specific directory, which sounds like a good idea - and which should also make it easier to track important changes (git logs)

I think the idea was to have $FG_ROOT/Compositor/Pipelines with dedicated directories for effects and shaders - and presumably some kind of "common" or "include" directory for resources that are to be shared ?

Again, I think Richard posted a PDF link detailing the setup, and we originally discussed this one year ago, the idea being to keep things nicely separated, so that we can grow a number of truly independent pipelines, without people having to fear stepping on anyone's toes.
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: 11738
Joined: Tue Mar 25, 2008 8:40 am

Re: The Compositor

Postby wlbragg » Mon Dec 30, 2019 5:17 pm

* interior shadows are (like with Rembrandt) too flickery for my taste - unfortunately flickering is something I do not tolerate well, it (literally) gives me headaches

I'm not sure what your seeing for interior shadows, unless you did some specific porting. As far as I was aware, and was told, interior shadows are not ported yet.

I never tried the shuttle with the compositor. Now you got my curiosity up, will try.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5452
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: The Compositor

Postby Thorsten » Mon Dec 30, 2019 5:20 pm

I'm not sure what your seeing for interior shadows, unless you did some specific porting.


A 4096x4096 shadow map - if the surface isn't 'special', you see that as interior shadow, and while it works fine outside the aircraft, from close-up it's very flickery.

I never tried the shuttle with the compositor.


Don't - you'll be disappointed, it's not usable, too many aircaft-side effects which aren't handled.
Thorsten
 
Posts: 11580
Joined: Mon Nov 02, 2009 8:33 am

Re: The Compositor

Postby Icecode GL » Mon Dec 30, 2019 9:42 pm

Thorsten wrote in Mon Dec 30, 2019 11:38 am:* referencing shaders for aircraft-side effects doesn't seem to work gracefully - the Shuttle is full of broken effects on the grounds that the compositor expects secondary_lights.frag under Compositor/Shaders/secondary_lights.frag whereas it is under Compositor/Shaders/ALS/secondary_lights.frag, i.e. the lookup doesn't seem to take into account that the ALS pipeline is on here


The shader lookup is not automatic. If you have aircraft-side shaders or custom techniques, you'll have to port them accordingly as I did with the FGData Effects. I can provide a python a script that does this automatically though.

Thorsten wrote in Mon Dec 30, 2019 11:38 am:* interior shadows are (like with Rembrandt) too flickery for my taste - unfortunately flickering is something I do not tolerate well, it (literally) gives me headaches


With your graphics card you might probably want to increase the shadow map resolution to 8192 or 16384. The flickering will be very much reduced. Also, non-moving objects don't flicker (if they do it's because of FDM floating point errors, you can pause the sim to test).

Thorsten wrote in Mon Dec 30, 2019 11:38 am:* that's pretty bad because low vegetation (and vegetation shadows) show pretty bad z-fighting, making a view of shrubland a rather painful experience for me :( There's also substantial z-fighting with scenery models - the shuttle launch ramp in Florida is a rather obvious example


With near and far cameras gone we need an alternative method for increasing the depth precision. Tim Moore mentioned some time ago that he had been working on implementing reversed z-buffer in FG, so I just ignored this problem for now. I'll try to write him in the coming days about it.

Thorsten wrote in Mon Dec 30, 2019 11:38 am:* some planes seem to be messed up without showing a shader error message - the EC-135 basically has grey panels while I didn't see an error message (maybe I just missed it, FG has become terribly talkative...)


Could be caused by:
  • Unported custom aircraft-side effect
  • Bug in porting an FGData effect
  • Relative pathing when referencing the effect in the model XML

Without a log output there's not much I can do.

Thorsten wrote in Mon Dec 30, 2019 11:38 am:* the geometry shader overlay is broken for me, whereas geometry shader grass works fine - not sure why that is as they're pretty much the same bit of technolgy


I forgot to port the overlay shader.

Thorsten wrote in Mon Dec 30, 2019 11:38 am:* some nit-picking, but the shadow map should be disabled when the sun is below the horizon. ALS still uses /some/ amount of light under these conditions - the sky is still bright and offers sort of directional light - however this ain't the light that casts sharp shadows any more as it comes not from a small spot but from a sky hemisphere


Shadow maps in the Compositor have been designed to work with any light source (yes, even a point light). I have plans to refactor the code a bit and add two separate implementations: Sun and generic light source.

Thorsten wrote in Mon Dec 30, 2019 11:38 am:So it seems there's still a lot of work ahead - we must be able to handle aircraft-side shaders and effects gracefully, we simply can't assume they will be fixed one by one, and right now the flickering really is a big problem (I had to end my flight prematurely, got too dizzy...)


Not much I can do about those two problems. The flickering is what it is, it's inherent to shadow maps. I even implemented shadow map stabilization, but it only works for non-moving objects. Again, try bigger resolutions, and if that doesn't work just disable them. I don't think the flickering is that bad. I don't even notice it unless I pay attention to it.
Icecode GL
 
Posts: 610
Joined: Thu Aug 12, 2010 12:17 pm
Location: Spain
Callsign: icecode
Version: GIT
OS: Arch Linux

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 1 guest