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 Algernon » Mon May 18, 2020 10:03 am

I've just started playing with the compositor and it's fun so far. I also need to figure out an appropriate way of preventing light spilling out through the aircraft's geometry - the first application I'm attempting is cockpit floods. With Rembrandt, you could keep the light volume within the bounds of a mesh to do this (in this example, the cockpit tub was used to form a separate mesh of its internal space to act as a Rembrandt volume object), but that's not going to work here.

Also, are Compositor's lights able to - or planned to be able to - be dimmed dynamically with a property?
Algernon
FGUK - A FlightGear community in the United Kingdom and Republic of Ireland
Developer: Eurofighter EF2000 - English Electric Lightning - Handley Page Victor
User avatar
Algernon
 
Posts: 507
Joined: Sun Jun 27, 2010 4:55 pm
Callsign: G-ALGY
Version: 2019.1.1
OS: Win10

Re: The Compositor

Postby icecode » Mon May 18, 2020 12:06 pm

With Rembrandt, you could keep the light volume within the bounds of a mesh to do this


I'm not sure what you mean exactly, but with the Compositor there is a range-m property that changes the radius of the sphere volume in the case of pointlights and the range in the case of spotlights. I think that should be enough to keep cockpit lights in check.

Also, are Compositor's lights able to - or planned to be able to - be dimmed dynamically with a property?


Yes, it's planned. Although I'm still trying to figure out how to do this in the most flexible/easiest way possible. Unfortunately it's not too high on the priority list at the moment - clustered shading wasn't even applied to every effect yet, so it'll only work on models with model-default. I'll be dealing with that first. :)
icecode
 
Posts: 710
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby Algernon » Mon May 18, 2020 1:29 pm

That's cool :) Just working very far ahead in my planning, but I too have other things considerably higher on the priority list.
Algernon
FGUK - A FlightGear community in the United Kingdom and Republic of Ireland
Developer: Eurofighter EF2000 - English Electric Lightning - Handley Page Victor
User avatar
Algernon
 
Posts: 507
Joined: Sun Jun 27, 2010 4:55 pm
Callsign: G-ALGY
Version: 2019.1.1
OS: Win10

Re: The Compositor

Postby jsb » Tue Jun 09, 2020 9:17 am

Hi,
regarding http://wiki.flightgear.org/Compositor#N ... developers
sorry, if this question was already answered, but where do I have to put the light definition in an aircraft?

I work on the CRJ700 which has rembrand lights. A closer look at the .ac and XML files (included in the model) show
1) a 3D sphere or cone with a light animation (very similar to the light definition described in the wiki article mentioned above)
2) a plane holding a texture ("lightbulb" you look at) and billboard animation.

I found I have to keep the plane with the texture otherwise I cannot see the "lightbulb" anymore. The sphere I had to remove because it became solid black when I converted the light <animation> to a <light>

So, is the model XML the right place for <light>? Maybe you can point me to a working example?
Thanks :)
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: The Compositor

Postby icecode » Wed Jun 10, 2020 8:34 am

Yeah, you should place <light> in the model XML. However, unlike in Rembrandt, you don't need a light volume in the model itself (a sphere or cone). The <light> itself is the only thing needed.
icecode
 
Posts: 710
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby jsb » Wed Jun 10, 2020 9:25 am

Ok, I will try this. But I should keep the "2D" textured plane (billboard) to have a "lightbulb" to look at?

Edit 1:
I can see the debug cones and spheres now but I do not see any light on the ground (nav light, taxi, strobe...)
Q: is it possible to use use properties in the light e.g. to set r,g,b on the fly or change direction of a spot light?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: The Compositor

Postby icecode » Wed Jun 10, 2020 7:29 pm

But I should keep the "2D" textured plane (billboard) to have a "lightbulb" to look at?


Yeah, you should keep the billboard. The <light> only provides lighting to surfaces.

I can see the debug cones and spheres now but I do not see any light on the ground (nav light, taxi, strobe...)


This hasn't been implemented yet, it's only working on models with model-default for testing purposes.
icecode
 
Posts: 710
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby jsb » Thu Jun 11, 2020 11:39 am

Naive question: what has to be done to implement it? How much work will it be and what knowledge would be required?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: The Compositor

Postby icecode » Thu Jun 11, 2020 12:39 pm

It's mostly copy-paste work and deciding on a good strategy so people have enough freedom to choose if they want clustered shading or not. Don't worry about it, I'll probably be pushing some changes regarding this in the following weeks, I've just been quite busy for the past month or so.
icecode
 
Posts: 710
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby jsb » Thu Jun 11, 2020 7:41 pm

Would it be possible to do a quick hack to have a "ground element" (e.g. runway, apron) reflect the light so I can adjust the landing light spots?
I also noted, that the stobe lights light the interior (cockpit) so obviously the skin of the aircraft does not block light - not sure what I did wrong or if this is supposed to work.
I worked around this with a select animation that uses view-internal flag to hide the light
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: The Compositor

Postby icecode » Fri Jun 12, 2020 2:54 pm

Would it be possible to do a quick hack to have a "ground element" (e.g. runway, apron) reflect the light so I can adjust the landing light spots?


Unfortunately it's not trivial to add support for clustered shading in other Effects. If you are familiar with Effects and Shaders you can try having a look at model-default and see how it's implemented there.

I also noted, that the stobe lights light the interior (cockpit) so obviously the skin of the aircraft does not block light - not sure what I did wrong or if this is supposed to work.


Yeah, that's normal. "Fixing" it would require shadow mapping support for any light (not only the Sun), which is prohibitely expensive for now.

I worked around this with a select animation that uses view-internal flag to hide the light


That's a good workaround. I'll also try adding a parameter to effects that let the developer choose if they want the surface to be affected by lights or not.
icecode
 
Posts: 710
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby jsb » Fri Jun 12, 2020 8:48 pm

Icecode GL wrote in Fri Jun 12, 2020 2:54 pm:That's a good workaround. I'll also try adding a parameter to effects that let the developer choose if they want the surface to be affected by lights or not.


Unfortunately I have minimal knowledge about effects and shaders. Thinking about the cockpit it would be nice to have lights there too e.g. at night. Maybe it is possible to have parameters that allow to group lights (e.g. exterior, cabin, cockpit, ...) and have the groupnumber assigned to surfaces/materials so a stobe light would light only fuselage and a cockpit light would only light panel elements?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: The Compositor

Postby abassign » Mon Jun 22, 2020 9:34 am

Hi, I have a problem with the compositor (the version of FGFS is 2020.3.0). In both the 2020.3.0 and the 2020.2 versions, I noticed that the transparent surfaces have an anomalous behavior as a function of the angle of incidence of the light. This problem is also evident for the canopy.
As you can see from the images, the beacon (the intermittent light placed on the upper back of the fuselage), is created by a dark red colored hemispherical surface, this surface becomes transparent in 80% of the possible view directions. This anomaly is also present for the transparent part of the canopy. Obviously the surfaces have been configured with the effect:
<Inherits-from> Effects / model-transparent </ inherits-from>
Anyone have an idea how to fix it?

Regards, Adriano


Image Image Image Image Image

Image Image Image
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 949
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: The Compositor

Postby icecode » Tue Jun 23, 2020 7:10 pm

I'm sorry but I don't understand what the problem seems to be. Is the issue reproducible on a publicly available aircraft so I can test for myself?
icecode
 
Posts: 710
Joined: Thu Aug 12, 2010 1:17 pm
Location: Spain
Version: next
OS: Fedora

Re: The Compositor

Postby wkitty42 » Tue Jun 23, 2020 10:02 pm

my understanding is the red light dome lens becomes transparent when it should not... the first picture shows the red lens properly... the second one shows the red lens is transparent and you can see the light's internals.. the red lens should be a red lens all the time...
"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: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 6 guests