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 » Sun Apr 23, 2017 5:14 pm

@ Necolatis

Thank you for clarifying. I was too lazy to change it the way the JA37 has it, thus why I asked. :lol:

This is really is getting frustrating, or is it?

I just installed the JA37 from OPRF and it doesn't show any interior reflections either. I'm installing the fgaddon version now to see if this is consistent.

The one thing I could use is conformation that I am not the only one seeing this.

Edit:

OK, on closer inspection the JA37 isn't using interior reflections. I can't help but to wonder if this issue is why it is not?

Time to look at Richard's aircraft.
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 Necolatis » Sun Apr 23, 2017 5:35 pm

Yep, it doesn't its a long time since I decided not to use interior reflections, cannot remember why I choose that.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Glass

Postby wlbragg » Sun Apr 23, 2017 5:55 pm

I also noticed several fog parameters to control fog on inside and outside surfaces, is that all really physically modeled?

If so I can see why you abandoned reflections. I'm beginning to think they don't play nice with the overlay or mask.

What is so frustrating, there is one screen shot where it appears I had it all working

https://forum.flightgear.org/viewtopic.php?f=47&t=25456&start=180#p309178

If I could just get back to that, I know where to go from there.......
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 Necolatis » Sun Apr 23, 2017 6:06 pm

wlbragg wrote in Sun Apr 23, 2017 5:55 pm:I also noticed several fog parameters to control fog on inside and outside surfaces, is that all really physically modeled?


To the best of my abilities. I had to estimate how the inside dewpoint would work though, is probably not accurate, but better than nothing.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Glass

Postby Thorsten » Sun Apr 23, 2017 6:12 pm

Well, the Viggen's air temperature model is annoyingly realistic :mrgreen:
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Glass

Postby wlbragg » Sun Apr 23, 2017 6:24 pm

Wow, I think I just figured something out.

The problem is I can't see any interior reflections using a uv-mapped transparent texture.

As soon as I apply the fog I get reflection also. So the fog strength parameter is also controlling the reflection

Workaround, If I apply .1 all the time I get my reflection and for all intense and purposes, no fog. Going up from there adds the fogging.

Does this make sense to anyone?

Is there another, or better way to do this?

Side note:
@Necolatis, if you remember, how did you get around the weather, or specifically the dewpoint and temp settling down when designing your fogging system? I need to study your temperature modeling. I'm not happy with the Cub's, based off the c172p.
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 Necolatis » Sun Apr 23, 2017 6:54 pm

This is sorta how the temperature modeling is done:

I looked into how air conditioners work. Turns out they make the air very dry.

So when the inside temperature is equal to what the AC wants it to be I set the dewpoint relative dry.
When its closer to outside temperature, I set the dewpoint closer to what the outside dewpoint is.
Inbetween I interpolate.

Thats just from my memory, on how I do dewpoint, dont remember precise.

As for when the fog forms, thats simpler, need the temperature of the glass, there is a standard temperature formula that can be used for that, and then also the dewpoint.

Outside temperature is environment temperature + ram rise temperature (also a standard formula for that).
Inside temperature is increased/decreased each loop, depending on:

- canopy open
- pilot body heat
- airconditioner
- glass temperature
- hot air on windshield

Canopy acting as a greenhouse in sunshine is not simulated.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Glass

Postby wlbragg » Sun Apr 23, 2017 8:18 pm

OK, I finally have a solution, although I would really like to know if this solution is the only way to do this without having to change the effect or shader framework.

Bottom line is, if I uv-map the object with a transparent texture, then the interior reflections don't show unless the fog-level is GE .1
So I take the fog-level and if it is LE 0 I make it EQ .1. That gives me the reflection and as the fog level grows then the fogging starts to show up.
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 FighterAce » Fri May 26, 2017 3:11 pm

Is this idea being looked into? What I am curious about is whether it would need a very good operating system to run on or if it could run on a Macbook Air.
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: Glass

Postby wkitty42 » Fri May 26, 2017 8:59 pm

it isn't really the OS that comes into play... it is more the amount of RAM and how strong your video card is... of course the faster the CPU and GPU the better, too...
"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: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Glass

Postby StuartC » Sun Nov 19, 2017 10:44 pm

Why do I loose, and can nor get back my exterior glass reflection after I add this definition to the glass in my model.xml ??


<effect>
<inherits-from>Effects/glass</inherits-from>
<object-name>rightdoor-glass</object-name>
<object-name>leftdoor-glass</object-name>
<object-name>canopy</object-name>
</effect>


Should it be added somewhere else other than the model.xml ??

My glass reflection effect file is this:-

<PropertyList>
<name>reflectglas-uber</name>
<inherits-from>/Effects/model-combined</inherits-from>

<parameters>
<!-- Reflection -->
<reflection-enabled type="int">1</reflection-enabled>
<reflect-map-enabled type="int">0</reflect-map-enabled>
<reflection-dynamic type="int">1</reflection-dynamic>

<reflection-fresnel type="float">0.01</reflection-fresnel>
<reflection-rainbow type="float">0.05</reflection-rainbow>
<reflection-noise type="float">0.01</reflection-noise>
<reflection-correction type="float">-0.175</reflection-correction>
<ambient-correction type="float">0.01</ambient-correction>

<transparent>true</transparent>
<render-bin>
<bin-number>10</bin-number>
<bin-name>DepthSortedBin</bin-name>
</render-bin>

<texture n="5">
<type>cubemap</type>
<!-- use this form for a cube cross
<image>Aircraft/Generic/Effects/CubeCrosses/blue_sky.png</image>-->

<!-- use this form for a 6 image cube map -->
<images>
<positive-x>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_px.png</positive-x>
<negative-x>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_nx.png</negative-x>
<positive-y>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_py.png</positive-y>
<negative-y>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_ny.png</negative-y>
<positive-z>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_pz.png</positive-z>
<negative-z>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_nz.png</negative-z>
</images>

</texture>

</parameters>
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 » Mon Nov 20, 2017 1:29 am

I may be misunderstanding you but if

Code: Select all
<inherits-from>Effects/glass</inherits-from>


is the call that is supposed to be inheriting

My glass reflection effect file is this:-

Code: Select all
<PropertyList>
<name>reflectglas-uber</name>


That is wrong. It should be

Code: Select all
<inherits-from>Effects/reflectglas-uber</inherits-from>


Or are these to files unrelated?
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 wlbragg » Mon Nov 20, 2017 1:33 am

Or maybe,

Code: Select all
<object-name>rightdoor-glass</object-name>
<object-name>leftdoor-glass</object-name>
<object-name>canopy</object-name>


You can only have one effect file for these objects.

I'm not sure I am understanding the layout of the effects.
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 Thorsten » Mon Nov 20, 2017 7:39 am

Why do I loose, and can nor get back my exterior glass reflection after I add this definition to the glass in my model.xml ??


You can only assign one effect to a surface, so if you assign glass.eff after you have assigned reflectglass-uber.eff, you overwrite the first definition and hence lose the reflection.

The way you need to organize this (also to avoid other sort of rendering pain with surface ordering) is to use two copies of your glass, each of them a single-sided layer, with the normals of one pointing outward, the other flipped to point inward.

The outward layer gets reflectglass-uber.eff, the inward layer gets glass.eff, thus you get the desired behavior both from inside and outside and never see the surface you're not supposed to see.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Glass

Postby StuartC » Mon Nov 20, 2017 8:48 am

ok, but if I do that, when its raining, I see from I the inside the rain on the glass, but because I will be using a second layer of glass on the outside for reflection, when its raining on external views that glass remains dry ?
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

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 6 guests