Board index FlightGear Development Weather

Reflection of Landing Lights on Clouds

Everything related to weather simulation, visuals should be discussed in the shader subforum.

Reflection of Landing Lights on Clouds

Postby scarymovie » Wed Apr 06, 2022 2:46 am

Hi everyone. I am wondering if it is possible to have the effect when flying through clouds/fog, they are illuminated in front of the aircraft when landing lights are on. That would be really cool.

Please click on image
Image

Thank you.
scarymovie
 
Posts: 214
Joined: Wed Nov 21, 2007 3:34 pm
Location: Singapore

Re: Reflection of Landing Lights on Clouds

Postby Thorsten » Wed Apr 06, 2022 7:21 am

It worked with the old-style landing lights, but I don't think it's easy to re-implement with the compositor-type new landing lights.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Reflection of Landing Lights on Clouds

Postby scarymovie » Wed Apr 06, 2022 12:28 pm

Thorsten wrote in Wed Apr 06, 2022 7:21 am:It worked with the old-style landing lights, but I don't think it's easy to re-implement with the compositor-type new landing lights.


Now that you mention that, Thorsten. I remember landing a Aero Commander 500 in the winter at Quebec city some years back, I could see that effect. Guess I will have to wait then.
scarymovie
 
Posts: 214
Joined: Wed Nov 21, 2007 3:34 pm
Location: Singapore

Re: Reflection of Landing Lights on Clouds

Postby TheEagle » Wed Apr 06, 2022 12:54 pm

Wait … those Compositor lights illuminate everything - runway, grass, scenery models, OSM2City buildings, don't even throw shadows - why don't they illuminate the clouds ? I though they are also just AC3D models ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Reflection of Landing Lights on Clouds

Postby scarymovie » Wed Apr 06, 2022 2:59 pm

TheEagle wrote in Wed Apr 06, 2022 12:54 pm:Wait … those Compositor lights illuminate everything - runway, grass, scenery models, OSM2City buildings, don't even throw shadows - why don't they illuminate the clouds ? I though they are also just AC3D models ?

Unfortunately no, not clouds.

Image
scarymovie
 
Posts: 214
Joined: Wed Nov 21, 2007 3:34 pm
Location: Singapore

Re: Reflection of Landing Lights on Clouds

Postby Thorsten » Wed Apr 06, 2022 6:00 pm

Wait … those Compositor lights illuminate everything - runway, grass, scenery models, OSM2City buildings, don't even throw shadows - why don't they illuminate the clouds ?


Standard mistake - what is illuminated in 3d rendering is not determined by the light but by the shader of the object to be illuminated.

Clouds are not standard *.ac models (at least most of them are not), and haze is yet more complicated.

So lights illuminate nothing for which illumination isn't implemented (for whatever reason).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Reflection of Landing Lights on Clouds

Postby TheEagle » Wed Apr 06, 2022 7:06 pm

Thorsten wrote in Wed Apr 06, 2022 6:00 pm:Standard mistake - what is illuminated in 3d rendering is not determined by the light but by the shader of the object to be illuminated.
[…]
So lights illuminate nothing for which illumination isn't implemented (for whatever reason).


Oh, yeah, I wonder if I'll ever learn this ! I just can't get my head around this (because in real life lights illuminate everything you shine them on) … :mrgreen:
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Reflection of Landing Lights on Clouds

Postby Lester-Boffo » Mon May 16, 2022 2:45 am

Actually fog and clouds should scatter light strongly, the effect t you see when approaching another car with headlights on in heavy fog is often the general direction of the other car slowly brightens and then you can make out the light sources from the amorphous glob of light.
Lester-Boffo
 
Posts: 162
Joined: Mon Apr 18, 2022 9:44 pm
Pronouns: Me/Hey You!
Version: 2020.3[4]
OS: Win10

Re: Reflection of Landing Lights on Clouds

Postby TheEagle » Mon May 16, 2022 11:33 am

Yes, but clouds don't have it implemented in their shader … sadly.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Reflection of Landing Lights on Clouds

Postby Doorknob747 » Sat Mar 25, 2023 6:12 am

Does that imply to actually implement this, it would need to bypass the shading requirement? That seems to point towards hard coding. How are clouds created in FG, are they created as separate objects (not necessarily as .ac but .png or .jpg objects), or are they just 3d effect of sky pictures to make it look like clouds? If it is the former, then it could be possible to hard.code it.

Basically create another jpg or png file of a cloud that is lit by light. If all the following conditions occur, then instead of using a regular cloud image use the lit cloud image:
*Any forward facing lights are on in the aircraft.
*The time in the aircraft's vicinity is night OR the weather is raining.
*The random cloud image placement generator decides to place a cloud image at some distance directly (not too far left or too far right) in front of the aircraft.

Although this would only show that the cloud is not lit, but will not show the cloud getting brighter as the light source comes closer.
Doorknob747
 
Posts: 60
Joined: Thu Sep 02, 2021 5:27 am

Re: Reflection of Landing Lights on Clouds

Postby Thorsten » Sat Mar 25, 2023 7:55 am

Does that imply to actually implement this, it would need to bypass the shading requirement?


I'm sorry, but what does this sentence even mean? What is 'the shading requirement' for clouds?

Basically create another jpg or png file of a cloud that is lit by light. If all the following conditions occur, then instead of using a regular cloud image use the lit cloud image:


Um, yeah. A cloud is 1000-3000 m across, your landing light cone has a diameter of 10-20 m while it's still visible. So... if you illuminate the whole km-sized clouds, your light appears slightly overpowered in the sky, if you illuminate only a tiny spot of the cloud chances are that the spot you prepared in the texture will not be where your plane is.

So there's a couple of issues with that idea even before writing a single line of code. :D
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Reflection of Landing Lights on Clouds

Postby TheEagle » Sat Mar 25, 2023 11:57 am

Clouds are regular AC files in FG - and that they don't have lighting implemented in their shader code doesn't mean they can't have it implemented, it would only need around 20 lines of GLSL code i think, plus a few added uniforms in the clouds.eff ! :)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Reflection of Landing Lights on Clouds

Postby TheEagle » Sat Mar 25, 2023 12:02 pm

@Doorknob: If you remind me in, say, a month I might try my hand at it ! ;)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Reflection of Landing Lights on Clouds

Postby Thorsten » Sat Mar 25, 2023 12:49 pm

Clouds are regular AC files in FG


Most of them actually are not. They're stacks of ad-hoc placed textured quads with rather peculiar transformation and visibility properties.

To make matters more interesting, a few are regular *.ac files, and a few others are just painted onto the skydome.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Reflection of Landing Lights on Clouds

Postby TheEagle » Sat Mar 25, 2023 1:03 pm

Oh ok, but they all get one of the cloud effects applied, right ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Next

Return to Weather

Who is online

Users browsing this forum: No registered users and 3 guests