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 amue » Thu Mar 12, 2020 1:28 pm

vnts wrote in Thu Mar 12, 2020 11:25 am:Wondering: With a logarithmic z-buffer there will be fewer levels far away.

It's the other way around and actually the reason to use a logarithmic depth buffer. You get a better resolution (more levels) far away than with the standard 1/z depth buffer (the standard depth buffer wastes almost all resolution in the near).

Wondering what might a hypothetical issue look like..

The hypothetical issue is exactly the z-fighting/flickering of far objects you get with the standard depth buffer.
amue
 
Posts: 92
Joined: Tue Apr 03, 2018 10:13 am

Re: The Compositor

Postby icecode » Thu Mar 12, 2020 1:31 pm

I think the scale of FG doesn't require a logarithmic depth buffer. In something like Outerra you need to be able to render the Earth from space as well. In a flightsim fog and atmospheric effects prevent the pilot from seeing too far out. I think a reverse Z-buffer (1.0 being near and 0.0 being far to get more precision further away) with 24 bits is enough. Logarithmic Z-buffers have too many disadvantages in my opinion to be a good choice in this case.
icecode
 
Posts: 709
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby Hooray » Thu Mar 12, 2020 1:55 pm

Then again, the point of having a framework like the compositor is to enable people to tinker with different schemes so that they can compare the pros & cons more easily ;-)
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 vnts » Thu Mar 12, 2020 2:29 pm

amue wrote in Thu Mar 12, 2020 1:28 pm:
vnts wrote in Thu Mar 12, 2020 11:25 am:Wondering: With a logarithmic z-buffer there will be fewer levels far away.

It's the other way around and actually the reason to use a logarithmic depth buffer. You get a better resolution (more levels) far away than with the standard 1/z depth buffer (the standard depth buffer wastes almost all resolution in the near).


I meant that the distance between levels could still be large compared to closeness of objects and surrounding terrain with differing colour. As FG with large rough LoD can have close trees and buildings with different colours that are far away. e.g. with bare lod distances set large (IIRC Thorsten uses several 100 (?) kilometers), and if the accompanying rough lod is also large.

Yeah, I guess haze would hide problems (unless very high up so view ray passes through a thinner atmosphere)

Kind regards
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: The Compositor

Postby wkitty42 » Fri Mar 13, 2020 4:35 pm

Icecode GL wrote in Thu Mar 12, 2020 1:31 pm:I think the scale of FG doesn't require a logarithmic depth buffer. In something like Outerra you need to be able to render the Earth from space as well. In a flightsim fog and atmospheric effects prevent the pilot from seeing too far out.

while this is true, FG does have working space craft that are flown fairly regularly... it does switch to the earthview, though, when above certain altitude so the problems of ""normal"" atmospheric effects and fog are removed/mitigated...
"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: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: The Compositor

Postby icecode » Fri Mar 13, 2020 5:20 pm

Earthview doesn't use real distances. Quoting the wiki article about it: "Technically, Earth is rendered as a ~58 km sized sphere positioned 1/100 of the actual altitude away from the spacecraft."
icecode
 
Posts: 709
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby wkitty42 » Fri Mar 13, 2020 5:59 pm

i understand that and only pointed it out because it is currently one way around the existing earth rendering to avoid the problems one would currently see if one is (eg) at 100000 altitude or higher and not using earthview ;)
"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: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: The Compositor

Postby vnts » Tue Mar 31, 2020 11:10 am

I was able to get the compositor working on windows after the recent update by using the latest artifact zip from here (for those who don't know, by installing a nightly (link) and copying the zip file over the /bin folder and activating the ALS pipeline with --compositor=Compositor/als ). :mrgreen:

Here are some oddities on a 10 series card. Not sure if these are known, or just the result of shaders at some quality levels not being ported over yet.

Quick check for oddities (ENBR, PHNL, Truman): https://imgur.com/a/KTDgvyk

For cockpit shadows, it may be fast to generate the precomputed opacity maps used by ALS within the sim as the compositor supports (?) rendering environment maps (like cubemaps) to texture. The idea being to generate one at start up if a craft doesn't have them, and the results could be cached by model hash id if it's not fast. It would need the ability to load/unload scenes at startup and render(?). Objects inside the cockpit that cause a lot of shadowing may (??) need a flag to be turned off, or multiple maps generated for some areas. If it's hard to automate using existing camera positions, maybe an aircraft specified list of points to generate opacity maps around will work. It may even be possible to bake canopy tints and scratches into the window opacity map. Just a thought.

Kind regards
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: The Compositor

Postby Hooray » Tue Mar 31, 2020 3:45 pm

For cockpit shadows, it may be fast to generate the precomputed opacity maps used by ALS within the sim as the compositor supports (?) rendering environment maps (like cubemaps) to texture. The idea being to generate one at start up if a craft doesn't have them, and the results could be cached by model hash id if it's not fast.


I don't think there's currently any support for persistent textures/caching - however, Fernando once had working Canvas integration, and we do have patches that demonstrate how to serialize a canvas buffer to a texture on disk. And it would be a good feature to have regardless of the use case - TheTom actually mentioned persistence support back when he was still prototyping the Canvas several years ago.

It would need the ability to load/unload scenes at startup and render(?). Objects inside the cockpit that cause a lot of shadowing may (??) need a flag to be turned off, or multiple maps generated for some areas.


There is also an existing patch to load/render arbitrary 3D models from disk to a Canvas: http://wiki.flightgear.org/Howto:Extend ... _3D_models
Image

If it's hard to automate using existing camera positions, maybe an aircraft specified list of points to generate opacity maps around will work. It may even be possible to bake canopy tints and scratches into the window opacity map. Just a thought.


The original "canvas view" patches were all about implementing support for custom camera views to be rendered to a canvas texture, where the camera position/offset would be specified via properties, analogous to how the view manager works - this would also be required to support tail-cam view, mirror textures etc:

http://wiki.flightgear.org/Howto:Canvas ... ra_Element
Image

As you can surely see, we do have quite a few patches related to your idea, it's just that those are currently not yet integrated - however, Stuart offered to help getting the canvas/view patches committed, because he was planning on using that feature for a synthetic terrain view/mode for his FG1000 effort:

Gear view in cockpit computer
stuart wrote:Hi,

I'm happy to review any patches and get them committed. Please ping me when you think the code is worth checking in. It doesn't have to be perfect - Particularly once the current release is out.
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 » Tue Mar 31, 2020 5:02 pm

vnts wrote in Tue Mar 31, 2020 11:10 am:Here are some oddities on a 10 series card. Not sure if these are known, or just the result of shaders at some quality levels not being ported over yet.


All of those issues are caused by some effects not being ported to use the logarithmic depth buffer. The screenshots provide some useful insight on which ones are left though, so thanks for taking the time to post them.

vnts wrote in Tue Mar 31, 2020 11:10 am:For cockpit shadows, it may be fast to generate the precomputed opacity maps used by ALS within the sim as the compositor supports (?) rendering environment maps (like cubemaps) to texture. The idea being to generate one at start up if a craft doesn't have them, and the results could be cached by model hash id if it's not fast. It would need the ability to load/unload scenes at startup and render(?). Objects inside the cockpit that cause a lot of shadowing may (??) need a flag to be turned off, or multiple maps generated for some areas. If it's hard to automate using existing camera positions, maybe an aircraft specified list of points to generate opacity maps around will work. It may even be possible to bake canopy tints and scratches into the window opacity map. Just a thought.


It's a good idea, but it's currently not very high on the priority list as aircraft devs can just generate them in Blender very easily.
icecode
 
Posts: 709
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby vnts » Fri Apr 24, 2020 1:09 pm

Tried a new nightly. :mrgreen: A lot of quality combinations have effects/shaders now.

You likely know what's not been fully ported, but here are a few things from a quick test:

- Urban effect. Issues at close range (1). Underground parts of building models show. Likely caused by the alternate method of doing logarithmic z values.
- Rocks & grass on mountain tops near LOWI (2).
- Some roads e.g. PHNL. Black roads etc. (3) Lack of moving cars on all.
- Terrain overlays. Keep grass overlays work.
- ec135, latest fgaddon update. Missing some surfaces (4). Just in case it's not some required aircraft-side porting, for things other than lights

Kind regards
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: The Compositor

Postby slawekmikula » Tue Apr 28, 2020 11:56 pm

Additionally to what vnts said (about (4)) there is small glitch with model shader. Testing on Cessna C182S. When the model shader is on full there is a nice visual of the cockpit (https://imgur.com/e9gIK8I) but when the model shader is moved to lower setting the cockpit is mostly lost :) (https://imgur.com/FSaX8XF). At first glance I was looking what had happened to the fg/fgdata/aircraft. Only after some time i went to shader settings.

Maybe there is a way to not make cockpit disappear on lower shader setting ?
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: The Compositor

Postby vnts » Mon May 11, 2020 11:21 pm

Seems 2020.1 is about to release. Wiki homepage says May 11 release (link) and links the changelog
(link).

Perhaps :?: a quick note should be added about the wip state of compositor, what's new from a user pov (shadow maps in certain instances), and that clustered rendering isn't in yet. I mean before any news sites headline saying it's a final compositor release, or imply it's a new graphical overhaul instead of mainly testing porting ALS first before adding graphical features using expanded capabilities of the framework. Maybe advice to try changing shader quality levels to find something that works should be added so people who glance at the changelog see it.

Kind regards

Eidt: There is no mention of the low spec pipeline, so people with older hardware glancing at patch notes may start worrying.
Last edited by vnts on Mon May 11, 2020 11:36 pm, edited 2 times in total.
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: The Compositor

Postby Necolatis » Mon May 11, 2020 11:31 pm

Just edited the changelog to say NOT part of 2020.1
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
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 vnts » Mon May 11, 2020 11:42 pm

Recent nighties have a second fgfs-compositor.exe binary, with a shortcut to that. AIUI the release candidates do too, unless I'm mistaken, or that decision changed?

Kind regards

(Unrelated , didn't the f-14 receive a lot of carrier related work, or was that 2019.1 era..)
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 6 guests