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 StuartC » Mon Nov 20, 2017 7:08 pm

but it did work before I started using an inner and outer glass sections. Nothing else was changed.
StuartC
 
Posts: 2483
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Glass

Postby Thorsten » Tue Nov 21, 2017 6:29 am

There's no magic involved. The shader decides that you see splash impacts when the dot product of splash vector and surface normal comes out negative, i.e. the normal points towards the incoming drops.

(The shader doesn't know what you know, in particular it doesn't know where world 'up' is during the computation).

The normal is aircraft-maintainer controlled at design time, the 3d modeling application sets it and can visualize it.

The splash vector is aircraft-maintainer controlled at runtime, for convenience you can write it into /environment/aircraft-effects/splash-x (yz), but you can also make a <use> tag in a derived effect to point to different properties and use a separate splash vector for each surface if you need.

Unless you have a pathological distribution of normals, for each surface there's a splash vector for which the impacts are head-on, and you can find that vector runtime,

If it worked before, then you copied a surface and flipped the normals to face inward, then you also need to flip the splash vector - otherwise you reversed the sign of the dot product. If it worked consistently across all glass surfaces before and it didn't afterwards even after sign reversal, you missed flipping some of the normals.

These are the things that can happen, and since the shader as such is working, it's one of these two things which went wrong - but the good news is, it's guaranteed to be fixable.
Thorsten
 
Posts: 9154
Joined: Mon Nov 02, 2009 8:33 am

Re: Glass

Postby StuartC » Tue Nov 21, 2017 11:09 am

Some success now. Randrops form on the canopy, and the streak in forwark flight, well, the front of the canopy streaks in the correct direction, the back of the canopy streaks upward......... All id fine unless you turn round when flying and look behind you.
StuartC
 
Posts: 2483
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Glass

Postby wlbragg » Tue Nov 21, 2017 2:24 pm

All id fine unless you turn round when flying and look behind you.



The splash vector is aircraft-maintainer controlled at runtime, for convenience you can write it into /environment/aircraft-effects/splash-x (yz), but you can also make a <use> tag in a derived effect to point to different properties and use a separate splash vector for each surface if you need.


You may have to break the back glass out separately and assign it it's own effect using a different splash vector. Something I guess I didn't totally understand when I worked with this last.

Thanks for the explanation Thorsten, that clears up much of my misunderstanding.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 3872
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Glass

Postby StuartC » Wed Nov 22, 2017 9:55 am

Is there any sort of windscreen wiper glass effect ?
StuartC
 
Posts: 2483
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Glass

Postby wlbragg » Wed Nov 22, 2017 10:13 am

Yes there is. It's one effect I haven't used before.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 3872
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Glass

Postby StuartC » Wed Nov 22, 2017 10:21 am

anyidea where I can fid it, or how to use it?
StuartC
 
Posts: 2483
Joined: Fri Jun 18, 2010 8:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2.12
OS: W7 64 bit

Re: Glass

Postby Thorsten » Wed Nov 22, 2017 10:22 am

Thorsten
 
Posts: 9154
Joined: Mon Nov 02, 2009 8:33 am

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: Google [Bot] and 2 guests