Board index FlightGear Development Effects and shaders

Surface light shaders

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

Re: Surface light shaders

Postby curt » Fri Feb 28, 2014 2:13 pm

I didn't think any of my original light code still existed, but originally I drew a triangle in GL_POINT mode so only the vertices were shown, and 2 of the vertices were underground so not visible. Then I used the triangle 'face' normal to feed into an environment map that controlled the color/intensity of the light based on it's ideal alignment and the relative view angle. This way approach lighting could be brightest when you were flying down the pipe, and much dimmer when you were at a right angle to the runway, and not visible when you looked from behind. Similarly, taxiway lights were most visible from the surface and less visible from above (as if the light had a cap on it shielding some of the light from shining up.) I was under the assumption most of this code went away during the grand plib->OSG migration (all the special runway lighting effects were lost at that time.)
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: Surface light shaders

Postby ot-666 » Fri Feb 28, 2014 11:02 pm

Thorsten wrote in Wed Feb 26, 2014 7:25 pm:Image


I wonder where all the extra lights are coming from?
But it looks like you have at least the rwy-stop lights facing in the opposite direction!
What is the name of the airport are you testing this on? I would love to have a look at it with the help of my script to figure out what points really are in the btg file.
But on the airports i've tested since scenery 2.xx i#ve only seen a couple of doubled up light points in the btg. Usually there are 2 on ony position for each direction.

Oliver
Callsign: ot-666
Working on LOWI and other stuff - Custom Scenery Overlay Repo: http://gitorious.org/fgfs-custom-scenery/custom-scenery-overlay/
VMX22 - Osprey... sometimes in 2014
ot-666
 
Posts: 746
Joined: Sun Nov 08, 2009 6:14 pm
Location: Germany, Konstanz
Callsign: ot-666
IRC name: ot666
Version: GIT
OS: win7 64bit

Re: Surface light shaders

Postby Thorsten » Sat Mar 01, 2014 7:08 am

That's KINS, but I've seen the same thing on TNCM - they seem to be everywhere. So they are _generated_ somewhere in the light setup process - there's no geometry shader running, thus in order to see a point coming out, there needs to be a point coming in.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Surface light shaders

Postby Johan G » Sat Mar 01, 2014 8:54 am

curt wrote in Fri Feb 28, 2014 2:13 pm:I didn't think any of my original light code still existed, but originally I drew a triangle in GL_POINT mode so only the vertices were shown, and 2 of the vertices were underground so not visible. Then I used the triangle 'face' normal to feed into an environment map that controlled the color/intensity of the light based on it's ideal alignment and the relative view angle.

ot-666 wrote in Fri Feb 28, 2014 11:02 pm:I wonder where all the extra lights are coming from?
But it looks like you have at least the rwy-stop lights facing in the opposite direction!
...
I would love to have a look at it with the help of my script to figure out what points really are in the btg file.
But on the airports i've tested since scenery 2.xx i#ve only seen a couple of doubled up light points in the btg. Usually there are 2 on ony position for each direction.

Thorsten wrote in Sat Mar 01, 2014 7:08 am:...they seem to be everywhere. So they are _generated_ somewhere in the light setup process - there's no geometry shader running...


I guess it is deep, deep down in the abyss of the source... :roll:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6634
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Surface light shaders

Postby papillon81 » Sat Mar 01, 2014 11:23 am

Hi,

Emilian and me identified the root of the issue and I'll push a fix to SG soon, along with some cleanups.

Chris
Scenery guy. Currently working on: Terragear improvements for the 850 apt.dat format
Scenery Repo: http://gitorious.org/papillon81/flightgear-custom-scenery/"
papillon81
 
Posts: 175
Joined: Tue Apr 01, 2008 9:09 pm
Location: Frankfurt (EDDF), Germany
Callsign: D-PAP
Version: GIT
OS: Gentoo

Re: Surface light shaders

Postby f-ojac » Sat Mar 01, 2014 3:36 pm

Excellent! Thanks Chris and Emilian and Thorsten, this will be a really nice update.
f-ojac
 
Posts: 1304
Joined: Fri Mar 07, 2008 10:50 am
Version: GIT
OS: GNU/Linux

Re: Surface light shaders

Postby Thorsten » Sat Mar 01, 2014 3:38 pm

Emilian and me identified the root of the issue and I'll push a fix to SG soon, along with some cleanups.


Ah, very good :-) Do we want to know the reason? Probably not...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Surface light shaders

Postby Zan » Mon Mar 03, 2014 5:18 pm

Hi!

I have to chime in now that there is shader support for lights. Because one of the things that annoyed me was the feature curt mentioned that was lost during transition to osg: light direction. All lights in the c++ code have the direction (normal) but it is not binded, I assume due to some issue in the fixed rendering pipeline? Anyways, with shaders the normal should be binded, and it's length could represent the intensity if needed. Thus runway lights would dim when looked from the side and be very bright when straight in front of them etc...

I assume the right place would be the pt_lights.cxx function getLightDrawable, where there is a BIND_OFF currnetly for normal? Any opposition to enabling normals?

BTW does rabbit lights or other blinking lights work? I don't remember ever seeing them in operation...

Best regards, Zan
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Surface light shaders

Postby curt » Mon Mar 03, 2014 5:48 pm

Rabbit lights and REIL lights worked in the original light implementation and I believe survived the OSG migration. However, I think there might be an issue with intensity/size of the flash which can make these very hard to actually see.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 5 guests