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 icecode » Fri Nov 29, 2019 11:06 pm

Can you even get exterior shadows with the default rendering pipeline (simple)?


Nope, shadows are only supported on the ALS pipeline.

Still a little confused, It did until I activated the compositor, what changed that isn't supported? My hardware didn't change?


No idea then, sorry.
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby wlbragg » Sat Nov 30, 2019 6:10 am

@Icecode GL I guess you are at least partially correct, the anti-aliasing switch in the GUI being on is causing the transparency to fail.

One thing I always have done from something I read a long time ago was to use the following switches to get anti-aliasing.

--prop:/sim/rendering/multi-sample-buffers=1
--prop:/sim/rendering/multi-samples=4

And more recently the QT GUI has the anti-aliasing switch choice of either 2 or 4 built into the GUI.

Is the Anti-aliasing switch in the GUI (either 2 or 4) the same as using the command line switch --prop:/sim/rendering/multi-samples=4?
If so then do you still need the --prop:/sim/rendering/multi-sample-buffers=1 switch if you are using either the GUI Anti-aliasing switch or --prop:/sim/rendering/multi-samples=4?

Why is anti-aliasing breaking in the compositor ALS pipeline when it doesn't break in any of the following three rendering schemes?

Original default rendering
Original ALS rendering
Compositor (simple) pipeline rendering
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: The Compositor

Postby wlbragg » Sat Nov 30, 2019 6:25 am

I notice the exterior shadows are working for AI, buildings, aircraft but not trees (AI trees work). Does anyone have regular scene tree shadows working?
Is the approach to get tree shadows supposed to be to port the ALS tree shadow method or should they be working by default?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: The Compositor

Postby wlbragg » Sat Nov 30, 2019 8:26 am

Are interior shadows supposed to be handled by the ALS cubemap method or are they supposed to work real time like the exterior shadows?

The verbiage in the documentation about
<model>
<name>interior</name>
<usage>interior</usage>
<path>Aircraft/JA37/Models/ja37-interior.xml</path> <!-- All the objects that should only be seen when inside the cockpit are in this file -->
</model>

isn't clear to me as to how to use or make shadows work. Is the tag name = "interior" supposed to always be interior or is that to reference thy type of object or model. IE; should it always be
<model>
<name>interior</name>
<usage>interior</usage>
<path>Aircraft/JA37/Models/ja37-panel.xml</path> <!-- All the objects that should only be seen when inside the cockpit are in this file -->
</model>

<model>
<name>interior</name>
<usage>interior</usage>
<path>Aircraft/JA37/Models/ja37-rotorbrake.xml</path> <!-- All the objects that should only be seen when inside the cockpit are in this file -->
</model>

or something like
<model>
<name>panel</name>
<usage>interior</usage>
<path>Aircraft/JA37/Models/ja37panel.xml</path> <!-- All the objects that should only be seen when inside the cockpit are in this file -->
</model>

<model>
<name>rotorbrakehandle</name>
<usage>interior</usage>
<path>Aircraft/JA37/Models/ja37-rotorbrake.xml</path> <!-- All the objects that should only be seen when inside the cockpit are in this file -->
</model>
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: The Compositor

Postby Necolatis » Sat Nov 30, 2019 8:49 am

The <usage> tag can only be used once in entire aircraft file, it should be "interior". That will make it be culled when your camera is more than the interior LOD setting away from it.
The name can be whatever you want.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2232
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: The Compositor

Postby Hooray » Sat Nov 30, 2019 9:52 am

Ok, I took the liberty and added wlbragg's screen shots/videos to the wiki, and also added a new "Gallery" section to the compositor article: http://wiki.flightgear.org/Compositor#Gallery
Please do use and update the article/gallery, so that we can reuse such screen shots elsewhere (newsletter, changelog, release announcement).

It would be cool if you could also add some "meta" information (date, FlightGear version, so that we can use that to compare features in the future, e.g. 3+ years from now)
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: The Compositor

Postby icecode » Sat Nov 30, 2019 1:19 pm

Why is anti-aliasing breaking in the compositor ALS pipeline when it doesn't break in any of the following three rendering schemes?


I already told you I unfortunately have no idea. I'll investigate it further when I have more time.

I notice the exterior shadows are working for AI, buildings, aircraft but not trees (AI trees work). Does anyone have regular scene tree shadows working?


This is a deliberate choice. Vegetation shadows will be done by the "legacy" method currently in use. Shadow mapping on vegetation is much more expensive in terms of performance and the current algorithm does the job well enough.

Are interior shadows supposed to be handled by the ALS cubemap method or are they supposed to work real time like the exterior shadows?


Both. You choose which one you want. If you decide to use ALS cubemap, then you need to add <noshadow> to every object that uses the ALS cubemap Effect so they don't cast shadows twice.
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby wlbragg » Sat Nov 30, 2019 6:11 pm

Thanks for the reply's.

I already told you I unfortunately have no idea

@Icecode GL OK, That additional information and comment was meant for anyone working with the compositor in the hopes someone else may have come across this and already resolved it. Wasn't meant to prod you or anyone else for that matter. Only to clarify why I think it may not be my card but something else.

I'll keep poking around and see if I can't figure out on my own as well.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: The Compositor

Postby wlbragg » Sat Nov 30, 2019 6:36 pm

Here is a rendering of a scene rich in shadows for various types of structure. Note the tower, aircrafts, buildings and poles all have nice clean shadows yet the trees don't. Those are trees added to the scene same as any model. Any idea as to why?

The ALS tree shadow is not working on the rest of the scene trees. Does that need to be accounted for and ported or should it just be working if it was working prior under the non-compositor ALS?

Only other noticeable issue is the rotor blade shadow intensity. Can that be adjusted?

Please note, all my postings are for informational purposes and not meant to gripe, prod or poke anyone into doing anything. Only to point out potential issues that may not be currently known and/or to possibly get information on how to correct if already known and a fix is available.

Image
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: The Compositor

Postby Thorsten » Sat Nov 30, 2019 6:42 pm

Those are trees added to the scene same as any model. Any idea as to why?


Shadow maps conceptually never work for surfaces which have alpha channel - it's a limitation of the technique.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: The Compositor

Postby icecode » Sat Nov 30, 2019 6:48 pm

Shadow maps conceptually never work for surfaces which have alpha channel - it's a limitation of the technique.


They actually do, but some tweaking is required. You can discard the depth value of transparent pixels in the shadow map.

Only other noticeable issue is the rotor blade shadow intensity. Can that be adjusted?


Rotor blades have the same issue as trees: semi-transparent objects aren't gracefully handled yet. Completely transparent objects (cockpit glass for example) that have been marked as transparent (via model-transparent) will behave properly and won't cast shadows. Surfaces with textures that have opaque and transparent pixels won't behave properly.
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby Necolatis » Sat Nov 30, 2019 6:49 pm

wlbragg I just noticed something in 2019.1.2:

If anti-aliasing is on, the trees looks dithered with holes.
If FXAA is on in the driver, the trees have no transparency.
If all kinds of AA is off, then trees look okay.
If AA is on, plus MFAA is on, then the trees look okay also.

But I am using NVidia, so not sure it helps you.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2232
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: The Compositor

Postby wlbragg » Sat Nov 30, 2019 6:53 pm

Those are trees added to the scene same as any model.


What is the difference between the trees and the tower in the way it is rendered? Don't both contain alpha channel? Repeating, those particular trees are models placed in the scene as models by me using the same method as I placed the tower.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: The Compositor

Postby icecode » Sat Nov 30, 2019 6:59 pm

Don't both contain alpha channel?


Yes. In the case of the tower, all values in the alpha channel are 1.0, that is, they are opaque. No problem here because the Compositor renders a shadow for them. In the case of the tree, some values in the alpha channel are 1.0 and others are 0.0. The Compositor will render a shadow for both alpha values (0.0 and 1.0), but that's incorrect, because transparent pixels should not cast shadows. The Compositor should render a shadow for alpha values of 1.0 only.



Random vegetation trees don't have a shadow for a different reason (performance issues), so they are gonna be using the current method for random vegetation shadowing and it's normal that they don't have the same "type" of shadows as "manually placed" trees.
icecode
 
Posts: 708
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby wlbragg » Sat Nov 30, 2019 7:04 pm

If FXAA is on in the driver
....
But I am using NVidia


I had trouble getting the AMD proprietary drivers working on my Linux install and I think I ended up with open source drivers. I need to research how to throw any of those switches at the gpu driver level.

I do have Windows running now on an SSD and can also get that platform up and running. I would have greater flexibility I think with a proprietary driver and the GUI that goes with it (or at least easier to change settings).

some values in the alpha channel are 1.0 and others are 0.0.

Ah, OK.

Random vegetation trees don't have a shadow for a different reason (performance issues), so they are gonna be using the current method for random vegetation shadowing

Understood, should it be working "as is" then if I turn it on in the GUI under the compositor build (ALS pipeline) or does it require the shaders to still be ported to compositor/ALS?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests