Firepower Lanc Cockpit Lighting

swpierce

SOH-CM-2025
For more subtle instrument lighting for the Firepower Lancaster you can use in ETO instead of the bright cockpit lighting, insert these lines into Effects section of the lanc.xdp file:

<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="0.05" PosZ="4.69" PosY="1.13" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="-0.1" PosZ="4.80" PosY="0.88" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="-0.23" PosZ="4.80" PosY="0.88" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="-0.36" PosZ="4.80" PosY="0.88" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="0.04" PosZ="4.80" PosY="0.87" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="0.23" PosZ="4.80" PosY="0.87" MinVel="-.0001" MaxVel="400"></Effect>

Shot03-30-14-09-43-38.jpg
 
This is one of the things that AnKor and I have discussed. For now these panel lights rely on a bug in the CFS3 rendering to look like they do. AnKor's shaders fix this bug and as a side effect break the panel lights (they end up looking like a spotlight with a hard edge). He's looking into a way around this, but for now I've had to comment out any reference to the panel lights effect.
 
Those are looking nice swpierce, definitely an improvement!

Very interesting Major, what have you figured out about lighting with the new dx9 shaders? I'm hoping the stock cockpit light will eventually get fixed as I've figured out how to make good use of it for gunsight lighting and gauge lighting (and no longer overly bright and flooding the cockpit as swpierce mentioned), but I'm interested in alternative methods as well.
 
For more subtle instrument lighting for the Firepower Lancaster you can use in ETO instead of the bright cockpit lighting, insert these lines into Effects section of the lanc.xdp file:

<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="0.05" PosZ="4.69" PosY="1.13" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="-0.1" PosZ="4.80" PosY="0.88" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="-0.23" PosZ="4.80" PosY="0.88" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="-0.36" PosZ="4.80" PosY="0.88" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="0.04" PosZ="4.80" PosY="0.87" MinVel="-.0001" MaxVel="400"></Effect>
<Effect Type="Track" EffectName="ac_Light_panel_violet" PosX="0.23" PosZ="4.80" PosY="0.87" MinVel="-.0001" MaxVel="400"></Effect>

View attachment 6065

Hi swierce,

theres a bit of a patch being worked up for ETO, would you mind if I was to add these new effects to each of the Lancasters included in ETO obviously I'd have to move the positions to fit the ETO VC. but the idea is yours.

regards Rob.
 
Hi swierce,

theres a bit of a patch being worked up for ETO, would you mind if I was to add these new effects to each of the Lancasters included in ETO obviously I'd have to move the positions to fit the ETO VC. but the idea is yours.

regards Rob.

Please, be my guest. I have had a problem with them flickering in a mission. I'm not sure what causes this but it does not happen all the time. I think it may happen more often with more lights installed.
 
I have experienced flickering when light effects overlap and conflict, it seems to be just another cfs3 bug.
 
This is one of the things that AnKor and I have discussed. For now these panel lights rely on a bug in the CFS3 rendering to look like they do. AnKor's shaders fix this bug and as a side effect break the panel lights (they end up looking like a spotlight with a hard edge). He's looking into a way around this, but for now I've had to comment out any reference to the panel lights effect.
Yes, these effects rely on a quirk of original rendering engine and it is impossible to recreate their look with modern per pixel lighting. And reverting to the original way for this types of lights will be the last resort.
The latest version was supposed to alleviate this problem a bit, though, but I made a typo in the shader code and it doesn't work as intended.
MajorMagee, you can easily fix it on your own by editing psTest20Shadow.ps. Replace
Code:
Out *= 1 - (LD - arrPointLights[i].vAttenuation.w)/arrPointLights[i].vAttenuation.w*4;
with
Code:
atten *= 1 - (LD - arrPointLights[i].vAttenuation.w)/arrPointLights[i].vAttenuation.w*4;
They will still look more like a spot lights though:
PanelLights.jpg
However, it seems to be possible to get a better approximation of the original lighting by increasing attenuation factor in the effect.xml.
Here I increased the range a bit, and set 200 for quadratic attenuation:
<ac_Light_panel_violet ClassName="Lighting" LightType="Point" Lifetime="3600" InitialDelay="0" FadeInTime=".01" FadeOutTime="3600" StrobeInterval="3600" StrobeRitm="1" PosX="0.0" PosY="0.0" PosZ="0.0" RotY="0" RotX="0.0" Diffuse0="600 200 300" Diffuse1="600 200 300" Specular0="0 0 0" Specular1="0 0 0" Ambient0="0 0 0" Ambient1="0 0 0" Range=".100" FallOff="0" Attenuation0="1" Attenuation1=".01" Attenuation2="200" Theta="10" Phi="30"/>
Lights became darker, but at least they started to look very similar in the original and in the DirectX 9 rendering.
PanelLights2.jpg

So, while I can't add an universal workaround, you can change effects to make them more compatible with DirectX 9.
 
Bravo & Bravo, and then some... :applause:

...I've been meaning to ask though, were most circa WWII panel gauges back-lit, or a combination or what? :icon_eek:
 
Not to hijack this thread but.....I've been working on some FP Lanc repaints and did lighting effects...these may not align with your skins and may not be exactly "historically accurate" but here you go:

<Effect Type="Track" EffectName="fx_ac_Light_formation_red" PosX="0.000" PosZ="-8.680" PosY="-1.125" MinVel=".0001" MaxVel="80"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_formation_green" PosX="0.000" PosZ="-8.860" PosY="-1.125" MinVel=".0001" MaxVel="80"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_formation_yellow" PosX="0.000" PosZ="-9.040" PosY="-1.105" MinVel=".0001" MaxVel="80"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_formation_blue" PosX="0.000" PosZ="-1.195" PosY="1.235" MinVel=".0001" MaxVel="92"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_formation_blue" PosX="0.000" PosZ="-5.400" PosY="1.195" MinVel=".0001" MaxVel="92"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_formation_blue" PosX="0.000" PosZ="-10.400" PosY="1.035" MinVel=".0001" MaxVel="92"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_formation_blue" PosX="-13.285" PosZ="-1.235" PosY="1.245" MinVel=".0001" MaxVel="92"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_formation_blue" PosX="13.285" PosZ="-1.235" PosY="1.245" MinVel=".0001" MaxVel="92"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_green" PosX="15.285" PosZ="-1.075" PosY="1.385" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_green" PosX="15.285" PosZ="-1.075" PosY="1.315" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_green" PosX="15.285" PosZ="-2.005" PosY="1.305" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_green" PosX="15.285" PosZ="-2.005" PosY="1.265" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_red" PosX="-15.255" PosZ="-1.035" PosY="1.365" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_red" PosX="-15.255" PosZ="-1.035" PosY="1.325" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_red" PosX="-15.245" PosZ="-2.005" PosY="1.285" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_nav_red" PosX="-15.245" PosZ="-2.005" PosY="1.265" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_tail" PosX="0.000" PosZ="-14.075" PosY="-0.455" MinVel=".0001" MaxVel="78"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_landing" PosX="-10.285" PosZ="-0.485" PosY="0.465" MinVel=".0001" MaxVel="48"></Effect>
<Effect Type="Track" EffectName="fx_ac_Light_landing" PosX="-10.645" PosZ="-0.485" PosY="0.545" MinVel=".0001" MaxVel="48"></Effect>
 
Bravo & Bravo, and then some... :applause:

...I've been meaning to ask though, were most circa WWII panel gauges back-lit, or a combination or what? :icon_eek:


Rim-lit I think but many glowed in the dark (radium paint) and a number of pits are off-limits to this day because of health & safety concerns.

hg40.jpg


Spitfire Mk.V, RAF Museum Hendon, London
 
The edge of that sign hanging there looks a bit sharp to me, they ought to have a warning sign for that too.

Good grief..... :(
 
Yes, these effects rely on a quirk of original rendering engine and it is impossible to recreate their look with modern per pixel lighting. And reverting to the original way for this types of lights will be the last resort.
The latest version was supposed to alleviate this problem a bit, though, but I made a typo in the shader code and it doesn't work as intended.
MajorMagee, you can easily fix it on your own by editing psTest20Shadow.ps. Replace
Code:
Out *= 1 - (LD - arrPointLights[i].vAttenuation.w)/arrPointLights[i].vAttenuation.w*4;
with
Code:
atten *= 1 - (LD - arrPointLights[i].vAttenuation.w)/arrPointLights[i].vAttenuation.w*4;
They will still look more like a spot lights though:
View attachment 6131
However, it seems to be possible to get a better approximation of the original lighting by increasing attenuation factor in the effect.xml.
Here I increased the range a bit, and set 200 for quadratic attenuation:

Lights became darker, but at least they started to look very similar in the original and in the DirectX 9 rendering.
View attachment 6132

So, while I can't add an universal workaround, you can change effects to make them more compatible with DirectX 9.

I went back to try this fix, and had no lights at all. So I set everything back to as it was with the typo, original effects.xml and the xpd files that included the panel light references and still no lights. I'm not sure why these lights are not working even improperly anymore. Another mystery to track down...
 
Not sure why they are broken for you, but there is one thing I want to tell.

Do you know that DirectX has a hard limit of maximum 8 light sources active at once? There is a technique to overcome this limit, but it seems CFS3 doesn't use it.
In this game one light source is always the sun or the moon, one seems to be reserved for cockpit light regardless whether it is on or off, and so it leaves us with only 6 point lights available for any purposes.

This effect mod adds 6 lights to the cockpit of every Lancaster in the air, and these lights are visible even in external views. So if there is more than one such planes or if there are any additional lights in the vicinity they will break the limit and cause some lights to go out. It seems CFS3 doesn't bother (or does it badly) to choose which lights are important now and that's what causes random flickering when the limit is reached.

You can test it easily with Lancaster - jump to gunner station, switch to external view and make sure that you see panel lights in the cockpit. Now fire the gun and observe how some of these lights turn off while you are shooting. This is because muzzle flash is also a light source.

Unfortunately my dll cannot work around it. It seems that CFS3 is hard coded to use only 6 point lights at any moment.
 
Interesting, I guess moving toward self lit material in the cockpit will be helpful with this limitation. That and I guess determining on our own which lighting effects are most important and disabling less important ones that might cause issues. It now makes sense why I couldn't get my string of 50 runway lights to each have their own light effect.
 
Not sure why they are broken for you, but there is one thing I want to tell.

Do you know that DirectX has a hard limit of maximum 8 light sources active at once? There is a technique to overcome this limit, but it seems CFS3 doesn't use it.
In this game one light source is always the sun or the moon, one seems to be reserved for cockpit light regardless whether it is on or off, and so it leaves us with only 6 point lights available for any purposes.

This effect mod adds 6 lights to the cockpit of every Lancaster in the air, and these lights are visible even in external views. So if there is more than one such planes or if there are any additional lights in the vicinity they will break the limit and cause some lights to go out. It seems CFS3 doesn't bother (or does it badly) to choose which lights are important now and that's what causes random flickering when the limit is reached.

You can test it easily with Lancaster - jump to gunner station, switch to external view and make sure that you see panel lights in the cockpit. Now fire the gun and observe how some of these lights turn off while you are shooting. This is because muzzle flash is also a light source.

Unfortunately my dll cannot work around it. It seems that CFS3 is hard coded to use only 6 point lights at any moment.

Well, that makes sense. When I was working with the Lancaster panel my original plan was to light each instrument individually, but I got exactly the alternating flashing that you describe. (You'll notice that 6 is the number I ended up with experimentally.) That also explains the flickering I get during a mission, I know it is occurring when other FP Lancs are in the area.
 
I guess moving toward self lit material in the cockpit will be helpful with this limitation.
And if anyone wonders what "self lit material" is:
SelfLighting.jpgSelfLighting2.jpg
This feature is a bit complicated in terms of compatibility. So I'm not "advertising" it yet, but it still seems very promising.

Sorry for hijacking the thread :)
 
Back
Top