Board index FlightGear Development Effects and shaders

Glass

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

Re: Glass

Postby wlbragg » Thu Nov 12, 2015 10:29 pm

could you check where the normal is pointing?

The normals are all pointing out on both the front and back glass (it's all one piece actually).

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

Re: Glass

Postby wlbragg » Sun Nov 22, 2015 4:35 pm

using property rules rather than Nasal for the splash vector is actually superior - once you are satisfied with it, would you consider altering the Wiki accordingly to establish the property rules as 'best practice'?

This is where this method has evolved to.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<PropertyList>

    <filter>
        <name>splash-xa</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/velocities/airspeed-kt</property>
                    <entry><ind>   0 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>   4 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>   5 </ind><dep> -1.7  </dep></entry>
                    <entry><ind>  50 </ind><dep> -2.1  </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-xa</property>
        </output>
    </filter>

    <filter>
        <name>splash-za</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/velocities/airspeed-kt</property>
                    <entry><ind>   0 </ind><dep>  0.82 </dep></entry>
                    <entry><ind>   4 </ind><dep>  0.82 </dep></entry>
                    <entry><ind>   5 </ind><dep> -0.17 </dep></entry>
                    <entry><ind>  50 </ind><dep> -0.35 </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-za</property>
        </output>
    </filter>

    <filter>
        <name>splash-xr</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/engines/active-engine/rpm</property>
                    <entry><ind>    0 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  600 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  601 </ind><dep> -1.3  </dep></entry>
                    <entry><ind> 1500 </ind><dep> -1.9  </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-xr</property>
        </output>
    </filter>

    <filter>
        <name>splash-zr</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/engines/active-engine/rpm</property>
                    <entry><ind>    0 </ind><dep>  0.82  </dep></entry>
                    <entry><ind>  600 </ind><dep>  0.82  </dep></entry>
                    <entry><ind>  601 </ind><dep>  0.127 </dep></entry>
                    <entry><ind> 1500 </ind><dep> -0.29  </dep></entry>
                </table>0
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-zr</property>
        </output>
    </filter>

    <filter>
        <name>splash-x</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <condition>
                <greater-than-equals>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </greater-than-equals>
            </condition>
            <property>/environment/aircraft-effects/splash-xa</property>
        </input>
        <input>
            <condition>
                <less-than>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </less-than>
            </condition>
            <property>/environment/aircraft-effects/splash-xr</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-x</property>
        </output>
    </filter>

    <filter>
        <name>splash-y</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <value>0.0</value>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-y</property>
        </output>
    </filter>

    <filter>
        <name>splash-z</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <condition>
                <greater-than-equals>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </greater-than-equals>
            </condition>
            <property>/environment/aircraft-effects/splash-za</property>
        </input>
        <input>
            <condition>
                <less-than>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </less-than>
            </condition>
            <property>/environment/aircraft-effects/splash-zr</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-z</property>
        </output>
    </filter>

</PropertyList>

It used both RPM and then airspeed takes over at 5kt. The effect as written here starts out static motion on the windshield (you could probably have it moving down to start) and then when the engine starts you get movement (up and back). Brakes on, the RPM increases flow, brakes off, airspeed takes over at 5 knots.
By using the table you technically can cherry pick what parts of the effect and at what criteria you want to pass on to the visual.
Last edited by wlbragg on Wed Nov 25, 2015 4:16 pm, edited 1 time in total.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4805
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Glass

Postby Necolatis » Wed Nov 25, 2015 2:07 pm

I have discovered a problem, that I would like to debug.

When its raining, the raindrops form as they should on the canopy for about 1 second, then they stop forming, and is just displayed statically for the rest of the session.

Even if I declare the glass as this with no custom parameters, (and put no other effect on it) the problem is there:

Code: Select all
<effect>
    <inherits-from>Effects/glass</inherits-from>
    <object-name>glassOuter</object-name>
    <object-name>frontglas</object-name>
  </effect>


When I start flying and the splash vector changes, the raindrops move on the glass as they should, so something is working. New raindrops just are not forming (or blinking rather).

I use FG 3.7 win nightly from yesterday on win10.

Any suggestions?
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1941
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Glass

Postby wlbragg » Wed Nov 25, 2015 2:38 pm

What happens if you give the vectors the following static values?

splash-vector-x = 0
splash-vector-y = 0.1
splash-vector-z = 1
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4805
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Glass

Postby Necolatis » Wed Nov 25, 2015 2:44 pm

If I do that, the raindrop do not move, and new ones are not formed. They are just statically displayed on the glass, as before.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1941
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Glass

Postby Thorsten » Wed Nov 25, 2015 4:12 pm

You only see rain falling if the splash vector makes them impact on the surface. If you don't see that, try reversing the splash vector, maybe things don't point the way you expect.
Thorsten
 
Posts: 10820
Joined: Mon Nov 02, 2009 8:33 am

Re: Glass

Postby Necolatis » Wed Nov 25, 2015 7:07 pm

Yes, indeed. The z had to be opposite of your example for the f-16. Thanks.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1941
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Glass

Postby Thorsten » Wed Nov 25, 2015 7:21 pm

I *suspect* the F-16 has / had at this point an outward pointing normal, whereas some of the models I've seen since have both an outward facing and an inward facing glass layer - which require a normal flip.

Maybe a note added to the Wiki would be a good idea?
Thorsten
 
Posts: 10820
Joined: Mon Nov 02, 2009 8:33 am

Re: Glass

Postby Necolatis » Wed Nov 25, 2015 8:06 pm

Done, added a note to the wiki.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1941
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Glass

Postby dutchman » Fri Dec 11, 2015 7:12 pm

@ dtlan201

I'm still struggling with the rain on windows effect. Could you enlighten me on the steps that you have taken?
)-: it's still raining inside.
A propeller is just a big fan in front of the plane used to keep the pilot cool.
When it stops, you can watch him start sweating.
dutchman
 
Posts: 52
Joined: Wed Feb 06, 2013 11:10 pm
Version: 2018.2.2
OS: WIN7-64

Re: Glass

Postby Necolatis » Fri Dec 11, 2015 7:29 pm

To get it to not rain inside the cockpit use this inside 'environment' tags inside your -set file:

Code: Select all
<precipitation-control>
            <clip-distance type="double">1.75</clip-distance>
        </precipitation-control>


Where the value is how many meters away from the pilot view point that the rain should start, so bigger cockpit means you should put in a bigger value.

As for rain on the canopy: Did you UV map the glass? It must be. Did you read the entire wiki instructions on how to get it to work?
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1941
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Glass

Postby dtlan201 » Sat Dec 12, 2015 12:30 am

dutchman wrote in Fri Dec 11, 2015 7:12 pm:@ dtlan201

I'm still struggling with the rain on windows effect. Could you enlighten me on the steps that you have taken?
)-: it's still raining inside.

Make sure there is no hole in your cockpit. Try to fill it with blender or ac3d
dtlan201
 
Posts: 187
Joined: Sun Sep 29, 2013 3:49 am
Callsign: MIA0774
Version: 3.7
OS: Windows 7

Re: Glass

Postby dutchman » Sat Dec 12, 2015 12:02 pm

@ dtlan
I am talking about the Artix A330, the same as you are flying I guess. I couldn't find the answer in the Wiki, but that could be my mistake.
Any help is much appreciated.
A propeller is just a big fan in front of the plane used to keep the pilot cool.
When it stops, you can watch him start sweating.
dutchman
 
Posts: 52
Joined: Wed Feb 06, 2013 11:10 pm
Version: 2018.2.2
OS: WIN7-64

Re: Glass

Postby dtlan201 » Sat Dec 12, 2015 2:40 pm

Ok, me and a few other people are working on airbus dev team so this features will soon be available soon but now I can tell u how to do it. B/c I'm using FG3.7 so I don't know if it works for you. BTW here are what I did (e.g for A330-203)
1 add glass-effect1.xml and glass-effectt2.xml to A330-200/Systems
glass effect 1
Code: Select all
<?xml version="1.0"?>

<!--

  c172p glass effects.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

-->

<system name="glass-effect1">

    <channel name="rain">

        <fcs_function name="glass-effects/airspeed-clamped-sqrt">
            <function>
                <sqrt>
                    <quotient>
                        <min>
                            <property>/velocities/airspeed-kt</property>
                            <value>40</value>
                        </min>
                        <value>40</value>
                    </quotient>
                </sqrt>
            </function>
        </fcs_function>

        <fcs_function name="glass-effects/splashx">
            <function>
                <difference>
                    <value>-0.1</value>
                    <product>
                        <value>2.0</value>
                        <property>/fdm/jsbsim/glass-effects/airspeed-clamped-sqrt</property>
                    </product>
                </difference>
            </function>
            <output>/environment/aircraft-effects/splash-vector-x</output>
        </fcs_function>

        <fcs_function name="glass-effects/splashy">
            <function>
               <value>0.0</value>
            </function>
            <output>/environment/aircraft-effects/splash-vector-y</output>
        </fcs_function>

        <fcs_function name="glass-effects/splashz">
            <function>
                <difference>
                    <value>1.0</value>
                    <product>
                        <value>1.35</value>
                        <property>/fdm/jsbsim/glass-effects/airspeed-clamped-sqrt</property>
                    </product>
                </difference>
            </function>
            <output>/environment/aircraft-effects/splash-vector-z</output>
        </fcs_function>


    </channel>

</system>

glass effect 2
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<PropertyList>

    <filter>
        <name>splashX</name>
        <type>gain</type>
        <input>
            <property>/fdm/jsbsim/glass-effects/splashx</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-x</property>
        </output>
    </filter>

    <filter>
        <name>splashY</name>
        <type>gain</type>
        <input>
            <value>0.0</value>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-y</property>
        </output>
    </filter>

    <filter>
        <name>splashZ</name>
        <type>gain</type>
        <input>
            <property>/fdm/jsbsim/glass-effects/splashz</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-z</property>
        </output>
    </filter>

</PropertyList>

In A330-200/A330-203.xml , add
Code: Select all
<system file="glass-effect1"/>

In A330-200/A332-common.xml , add under
Code: Select all
      <systems>

         <!-- Autopilot Helpers ========================================= -->

this
Code: Select all
            <property-rule n="101">
                <path>Aircraft/A330-200/Systems/glass-effect2.xml</path>
            </property-rule>   

In A330-200/Models/A332-animation.xml add
Code: Select all
   <effect>
      <inherits-from>Effects/glass</inherits-from>
      <object-name>windshield</object-name>
   </effect>

Finally u will need to remodel to windshield(otherwise it won't work), just give me your email, I can send u it.
dtlan201
 
Posts: 187
Joined: Sun Sep 29, 2013 3:49 am
Callsign: MIA0774
Version: 3.7
OS: Windows 7

Re: Glass

Postby dutchman » Sun Dec 13, 2015 8:59 am

Applied your suggestions and it made a difference, but not yet what we are trying to achieve.
Sounds like I'm still having the same kind of trouble you've had when you started.
Aircraft turned off: Inside view - rain visible, not getting in to the cockpit, Turned on: rain both inside and out.
Outside view in both cases (turned on or off) rain only visible from a left point of view (looking towards the nose)
Use the BB function to PM me.
A propeller is just a big fan in front of the plane used to keep the pilot cool.
When it stops, you can watch him start sweating.
dutchman
 
Posts: 52
Joined: Wed Feb 06, 2013 11:10 pm
Version: 2018.2.2
OS: WIN7-64

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 1 guest