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 8:08 pm

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

Re: Glass

Postby Thorsten » Tue Nov 21, 2017 7: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Glass

Postby StuartC » Tue Nov 21, 2017 12:09 pm

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: 3175
Joined: Fri Jun 18, 2010 9:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2019.1
OS: W10 64 bit

Re: Glass

Postby wlbragg » Tue Nov 21, 2017 3: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 and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Glass

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

Is there any sort of windscreen wiper glass effect ?
StuartC
 
Posts: 3175
Joined: Fri Jun 18, 2010 9:18 pm
Location: Arse end of the Universe
Callsign: WF01
Version: 2019.1
OS: W10 64 bit

Re: Glass

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

Yes there is. It's one effect I haven't used before.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Glass

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

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

Re: Glass

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

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

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 5 guests