Board index FlightGear Development Effects and shaders

ALS Lights follow view?

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

ALS Lights follow view?

Postby Octal450 » Sat Nov 04, 2017 7:44 pm

I use ALS secondary lights in my Airbus', and when the pilot moves the view, the spot on the ground is moving around with the view -- only is proper when view centered. How can this be stopped?

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: ALS Lights follow view?

Postby Necolatis » Sat Nov 04, 2017 8:22 pm

I think it is attached to the view. So rotating will not move it, but translating will.

Maybe make nasal check that is view moves the light is switched off?
"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: ALS Lights follow view?

Postby Octal450 » Sat Nov 04, 2017 9:15 pm

I don't understand what you mean.

If I change the heading or pitch of the view in the sim, it moves around.. but changing views doesn't move it... it's very bad and annoying. Shall I upload a video of what I mean?

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: ALS Lights follow view?

Postby Necolatis » Sat Nov 04, 2017 11:01 pm

Oh, thats not normal behavior I think. Never seen that I think. Don't know then.
"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: ALS Lights follow view?

Postby Octal450 » Sun Nov 05, 2017 12:25 am

I will make a video shortly.

@Thorsten, and any input on this?

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: ALS Lights follow view?

Postby wlbragg » Sun Nov 05, 2017 4:21 am

Does the c173p or the j3cub (pa18) exhibit the same behavior with the same lights? I think I put the secondary light on the pa18 version of the j3cub.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: ALS Lights follow view?

Postby Thorsten » Sun Nov 05, 2017 7:03 pm

I use ALS secondary lights in my Airbus', and when the pilot moves the view, the spot on the ground is moving around with the view -- only is proper when view centered.


Please do read the fine-print of the implementation :D The lights really project in screen space, i.e. a certain part of your screen gets illuminated. If you move the view without changing the offsets for the lights, then you'll still illuminate the same part of the screen - just there'll be some other scenery object there, so it'll look like the lights have moved.

If you want to avoid that, you'll have to create offsets dependent on your current viewpos (just like e.g. the Shuttle HUD canvas implementation makes sure the HUD is projected to infinity, i.e. always is on the same scenery object).

Edit: Or, re-reading the question, I might not understand what you're describing, in this case I'll need the video or a series of screenshots.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS Lights follow view?

Postby Octal450 » Sun Nov 05, 2017 10:51 pm

Rgr. I will send a video tonight.

I'l re-read the wiki etc, to make sure I'm not missing anything.

Thanks and Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: ALS Lights follow view?

Postby V12 » Mon Nov 06, 2017 7:15 am

On the Concorde I'm playing with ALS spotlights too. In standard, that spotlights are linked to the view position. Unwanted effect is clear - when I changed view from captain to copilot, position of ALS spotlight changed too. I made listener hooked to current view position change and when change occured, listener recalculate new spotlight offsets. That offsets are stored in the property tree. Now, I'm in the offfice, afternoon I will post listener code.
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: ALS Lights follow view?

Postby Isaak » Mon Nov 06, 2017 8:44 am

I 'll look into this to apply to other aircraft if you post your code, V12!
Want to support medical research with your pc? Start Folding at Home and join team FlightGear!
Isaak
 
Posts: 768
Joined: Sat Jun 04, 2011 3:52 pm
Location: Hamme, Belgium
Pronouns: he, him
Callsign: OO-ISA
Version: next
OS: Windows 10

Re: ALS Lights follow view?

Postby Thorsten » Mon Nov 06, 2017 10:35 am

In standard, that spotlights are linked to the view position. Unwanted effect is clear - when I changed view from captain to copilot, position of ALS spotlight changed too.


This is a rather clever use case... I haven't thought of this. But are there no issues with lights leaking out of the cockpit? Conceptually there is no shade cast, so the lights should illuminate everything behind the panel just as well.

And I believe the model-interior effect would not work, because there the lights are disabled to avoid exterior lights leaking back into the cockpit. But then again, if you want this effect to do anything meaningful you'll probably have to merge the panels in anyway.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS Lights follow view?

Postby V12 » Mon Nov 06, 2017 4:54 pm

Here is the code :

Code: Select all
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m",-0.7);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m",0.1);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m",-0.4);

setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]",-0.7);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]",0.8);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]",-0.4);

setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]",1.9);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]",0.45);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]",0.27);

setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r",0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g",0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b",0);
setprop("sim/rendering/als-secondary-lights/lightspot/size",0.4);

setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]",0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]",0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]",0);
setprop("sim/rendering/als-secondary-lights/lightspot/size[1]",0.4);

setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]",0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]",0);
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]",0);
setprop("sim/rendering/als-secondary-lights/lightspot/size[2]",3.5);



var chgv=setlistener("sim/current-view/name", func() {
x_o=7.38-getprop("sim/current-view/z-offset-m");
y_o=-0.35-getprop("sim/current-view/x-offset-m");
z_o=1.13-getprop("sim/current-view/y-offset-m");
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m",x_o);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m",y_o);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m",z_o);

x_o1=7.38-getprop("sim/current-view/z-offset-m");
y_o1=0.35-getprop("sim/current-view/x-offset-m");
z_o1=1.13-getprop("sim/current-view/y-offset-m");
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]",x_o1);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]",y_o1);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]",z_o1);

x_o2=9.98-getprop("sim/current-view/z-offset-m");
y_o2=-getprop("sim/current-view/x-offset-m");
z_o2=1.8-getprop("sim/current-view/y-offset-m");
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]",x_o2);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]",y_o2);
setprop("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]",z_o2);
});

var alslt=setlistener("systems/electrical/outputs/specific", func() {
  pow=getprop("systems/electrical/outputs/specific");
  if (pow>20){
    setprop("sim/rendering/als-secondary-lights/num-lightspots",3);
    } else {
    setprop("sim/rendering/als-secondary-lights/num-lightspots",0);
  };
});


Section with setprop used for initial light offset from initial view position. Listener is used for recalc offset after view change. This is not absolutly perfect solution, but usable. Light size is small and only inner cockpit has assigned effect file. I need make more MP tests.
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: ALS Lights follow view?

Postby Richard » Mon Nov 06, 2017 5:02 pm

Just a reminder (partly to me) that I'm working on a solution that will hopefully allow this to be defined in the XML file and it will automatically follow the eyepoint
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: ALS Lights follow view?

Postby Octal450 » Tue Nov 07, 2017 7:27 pm



Notice how inside it seems to stay okay.

Then once i go outside, not only does it disappear, but when moving the view, it does stupid things, then when I go back inside I have to move the view before it appears.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: ALS Lights follow view?

Postby Thorsten » Tue Nov 07, 2017 7:38 pm

Notice how inside it seems to stay okay.


But that's all you can expect - screen space projection doesn't work from outside.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Next

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 1 guest