Board index FlightGear Development New features

Glare effect for internal light ...

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

Glare effect for internal light ...

Postby abassign » Wed Oct 04, 2017 7:11 am

Hi, I'm considering the possibility to give a glare effect to the warning lights, nothing extraordinary, but something similar to what is being done with the lighting lights. The problem is that the amount of code to be made to give this effect is really high because in our plane there are at least 20 warning lights! At this point I believe it is interesting to introduce an XML tag that integrates the function as has been done for outgoing fumes from the Space Shuttle-trim engines.

This as actually display the warning lights:

Image

This is the effect that I want:

Image

I think this function can be very useful also for other bright effects and not that you want to get inside the cockpit.

Thanks for your attention :)
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: 947
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: Glare effect for internal light ...

Postby Thorsten » Wed Oct 04, 2017 7:24 am

Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Glare effect for internal light ...

Postby abassign » Wed Oct 04, 2017 7:50 am

Thorsten wrote in Wed Oct 04, 2017 7:24 am:Looking for this?

...


Yes I use it, for the external light, but these lights are few and distributed among various objects, so code maintenance is pretty simple, for example:

Image

My idea was to introduce this effect as XML tags to be inserted directly into the declaration of part of the object:

For example this is the advisor light:

Image

The red part is call in XML declaration part as: "<object-name>transparent_button</object-name>"

Code: Select all
    <animation>
        <type>material</type>
        <object-name>transparent_button</object-name>
        <texture>Pictures/G91-Red_01.png</texture>
        <transparency>
            <alpha>1.0</alpha>
            <factor-prop>sim/G91/switchs/cockpit/lg_battery_transparent</factor-prop>
        </transparency>
        <ambient>
            <red>0.1</red>
            <green>0.0</green>
            <blue>0.0</blue>
        </ambient>
        <emission>
            <red>0.1</red>
            <green>0.0</green>
            <blue>0.0</blue>
            <factor-prop>sim/G91/re_emit/gauge_red_light</factor-prop>
        </emission>
        <specular>
            <red>0.5</red>
            <green>0.0</green>
            <blue>0.0</blue>
        </specular>
    </animation>


Let's say there is a statement made this way:

Code: Select all
...
        <glare>
             <transparency>
                 <alpha>1.0</alpha>
                 <factor-prop>sim/G91/switchs/cockpit/lg_battery_transparent</factor-prop>
             </transparency>
             <emission>
                 <red>0.1</red>
                 <green>0.0</green>
                <blue>0.0</blue>
                 <factor-prop>sim/G91/re_emit/gauge_red_light</factor-prop>
            </emission>
            ...etc ...
        </glare>
...


This way I think the code would be much easier to maintain.
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: 947
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: Glare effect for internal light ...

Postby Thorsten » Wed Oct 04, 2017 8:00 am

You're the one coding this airplane, so feel free to code your standard building blocks and include them in other files. I'm not sure what the question is then. A procedural light is a model like others - you can translate it, hide it, make it solid, and you can include its xml wrapper in multiple other models.

The only difference is that it has a different effect assigned.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Glare effect for internal light ...

Postby abassign » Wed Oct 04, 2017 2:06 pm

Thorsten wrote in Wed Oct 04, 2017 8:00 am: ... include its xml wrapper...


I thank you for the link, now I want to ask you a question: how we do make an XML wrapper? I've verified the Internet on the subject but I just found this article:

http://www.flightgear.org/Docs/fgfs-model-howto.html

Certainly the ability to have the XML skeleton code is very interesting, for example, every signal bulb has a hundred lines of XML that serve to match it to the switch and / or the functions, only a few lines have parameters that may vary (color and value indicating whether it is on or off). To avoid having to overwrite the code, the ability to invoke an XML structure (such as a function) is really interesting. Do you have any other links to point me to the subject?

Thank you
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: 947
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: Glare effect for internal light ...

Postby Thorsten » Wed Oct 04, 2017 2:24 pm

Certainly the ability to have the XML skeleton code is very interesting, for example, every signal bulb has a hundred lines of XML that serve to match it to the switch and / or the functions, only a few lines have parameters that may vary (color and value indicating whether it is on or off).


There's almost certainly something wrong with the design then. You should factor out common elements and use inheritance on the effects (and the light status ought to be a simple property with all the electricity, switch,... code residing in the aircraft systems). The animation is a very bad place for this.

I don't have 20 declarations for Shuttle thruster flames either, I have one which I use in many different places.

I suggest to study a few existing models to see how this can be done.

how we do make an XML wrapper?


It's the xml that loads the ac model and contains its transformations - and it in turn can load other xml functions as child models.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Glare effect for internal light ...

Postby FighterAce » Sun Oct 08, 2017 9:45 pm

Use Rembrandt for this effect.
FighterAce
 
Posts: 189
Joined: Wed Mar 22, 2017 9:48 pm
Location: In the sky
Callsign: FighterAce
Version: 2017.1.3
OS: Mac Mojave

Re: Glare effect for internal light ...

Postby Thorsten » Mon Oct 09, 2017 6:11 am

I'm not sure Rembrandt is capable of giving you realistic-sized Airy discs - at least I've never seen any. Running a sufficiently large convolution kernel over the texture buffer to get this kind of effect using a standard bloom is pretty expensive.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Glare effect for internal light ...

Postby abassign » Mon Oct 09, 2017 8:06 am

FighterAce wrote in Sun Oct 08, 2017 9:45 pm:Use Rembrandt for this effect.


This is a case in which I fully agree with Thorsten. Rembrandt is a very expensive way to have these effects, the ALS solution seems a far more practical way.
In fact, the request linked to this post is the possibility to integrate the glare effect as XML animation, obviously with the possibility of varying at least the intensity and the coefficient of transparency. In this way, it would be much easier to "enrich" the various parts of the cockpit and outside with very pleasant and effective effects.
I hope that whoever reads this post and has the ability to work with the program kernel can introduce this very useful feature.

I have to add that I am doing various G91 cockpit lighting tests, myself and my partner, we have decided to renounce the Rembrandt effects entirely as they introduce a lot of mistakes in transparency management, which are fundamental to having a series of effects we want to get.
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: 947
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: Glare effect for internal light ...

Postby FighterAce » Mon Oct 09, 2017 9:42 pm

Oh, I see.
FighterAce
 
Posts: 189
Joined: Wed Mar 22, 2017 9:48 pm
Location: In the sky
Callsign: FighterAce
Version: 2017.1.3
OS: Mac Mojave

Re: Glare effect for internal light ...

Postby Thorsten » Sat Oct 14, 2017 5:41 pm

In fact, the request linked to this post is the possibility to integrate the glare effect as XML animation, obviously with the possibility of varying at least the intensity and the coefficient of transparency.


This would defeat the point of the current design of FG.

Things like the material animations pre-date the use of shaders and effects and are geared towards using a fixed pipeline function. However, shaders may not necessarily use a Blinn-Phong concept of ambient, diffuse and specular light (the recent PBR effort certainly does not, several other shaders also do not) - in which case a material animation is pretty much ignored, while the *.eff file defining the effect contains all the information needed.

Putting things into the xml wrapper in essence means hard-coding an effect on the C++ level - which Tim Moore has spent lots of time and effort making xml-configurable.

So, at least unless we radically change the design again, the idea is that effects are configured using *.eff files rather than animations - and there's no technical reason why this couldn't be done. It may be somewhat more awkward because you actually have to have an *.eff file rather than have it hard-coded in C++, but, well, it is configurable. Surely that's progress...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am


Return to New features

Who is online

Users browsing this forum: No registered users and 5 guests