PDA

View Full Version : No headlights are on in tunnels.



JCitron
November 30th, 2015, 11:04 PM
In TS12 our locomotive headlights light up the track in the tunnels along with the walls during the daylight hours. In T:ANE, however, this isn't the case and there is no difference in lighting when a train goes into the tunnel.

Is there a chance that can be fixed so this works the same as it did in the past?

John

TRam__
December 1st, 2015, 04:26 PM
I think it's better to add the headlight light anywere at daytime, but with replace of "summation" of sun and headlight illuminations to selection of greater value among them.

WindWalkr
December 2nd, 2015, 12:58 AM
Headlights are performance-draining, so we're definitely not switching them on by default in the daytime scene. We'll continue to evaluate options for improving the graphics without substantially hurting performance.

chris

Mick_Berg
December 2nd, 2015, 01:15 AM
Headlights are performance-draining, so we're definitely not switching them on by default in the daytime scene. We'll continue to evaluate options for improving the graphics without substantially hurting performance.

chris
I agree, this would be a very poor compromise.
What needs to be done is;
1. Allow the brightness of the headlight, or the degree to which it illuminates other objects, to be controlled. It is way too powerful right now. You're supposed to be able to control it with tags in config.txt but they don't seem to work. (I'm assuming it hasn't been addressed in SP1)
2. Make the headlight come on according to the ambient light level, as opposed to the time of day (so it would come on in tunnels)
3. Fix all the various Driver commands, menu commands etc, that control the headlight, as many of them don't seem to work (including the tags in config.txt.)

Then of course we have the current awful situation with the ambient lighting in tunnels, but that's a separate issue.
Mick.

Tony_Hilliam
December 2nd, 2015, 02:24 AM
What needs to be done is a more performance-friendly way of lighting for headlights. There are a thousand things we "could" do to improve what we have (and even that is probably a major understatement), so it all comes down to what gets done this week/this build/next build/next version etc.

We have removed rain from tunnels, added smoke collision in tunnels and gone to per-pixel lighting for headlights (vs per-vertex in previous Trainz versions) so all is not lost.

Regarding headlight tags not working, please provide an example kuid so we can check it out, but the ones I just tried all work. (I know there are some locos do not have headlights set up in their config).

Mick_Berg
December 2nd, 2015, 03:50 PM
What needs to be done is a more performance-friendly way of lighting for headlights. There are a thousand things we "could" do to improve what we have (and even that is probably a major understatement), so it all comes down to what gets done this week/this build/next build/next version etc.

We have removed rain from tunnels, added smoke collision in tunnels and gone to per-pixel lighting for headlights (vs per-vertex in previous Trainz versions) so all is not lost.

Regarding headlight tags not working, please provide an example kuid so we can check it out, but the ones I just tried all work. (I know there are some locos do not have headlights set up in their config).

Hi Tony.
I don't have SP1 installed yet, I am still at HF2 so I will wait until I am up to date, which should be soon.
Thanks,
Mick

ZecMurphy
December 2nd, 2015, 06:57 PM
What needs to be done is a more performance-friendly way of lighting for headlights. There are a thousand things we "could" do to improve what we have (and even that is probably a major understatement), so it all comes down to what gets done this week/this build/next build/next version etc.

We have removed rain from tunnels, added smoke collision in tunnels and gone to per-pixel lighting for headlights (vs per-vertex in previous Trainz versions) so all is not lost.

Regarding headlight tags not working, please provide an example kuid so we can check it out, but the ones I just tried all work. (I know there are some locos do not have headlights set up in their config).

There's a few built-in locos that use both the 'highbeam' and 'lowbeam' tags to set the headlight intensity. The locos are:

<kuid2:103475:74:1> VR DD T2 Can Red W BG
<kuid2:103475:76:1> VR DD T2 WW1 Red C BG

The tags in question are:

high_beam_value
low_beam_value

The value is a 'divisor'. So setting it to '1' gives full brightness, '2' gives half brightness, and so on.

Mick_Berg
December 2nd, 2015, 08:21 PM
There's a few built-in locos that use both the 'highbeam' and 'lowbeam' tags to set the headlight intensity. The locos are:

<kuid2:103475:74:1> VR DD T2 Can Red W BG
<kuid2:103475:76:1> VR DD T2 WW1 Red C BG

The tags in question are:

high_beam_value
low_beam_value

The value is a 'divisor'. So setting it to '1' gives full brightness, '2' gives half brightness, and so on.
I put those tags into my battery loco, which was for TS10, and at the time they worked. They don't seem to now. But I'm going to wait till I'm up to date before I pursue this further, to avoid wasting anyone's time.
Mick

TRam__
December 3rd, 2015, 04:53 AM
1. Allow the brightness of the headlight, or the degree to which it illuminates other objects, to be controlled. It is way too powerful right now. You're supposed to be able to control it with tags in config.txt but they don't seem to work. (I'm assuming it hasn't been addressed in SP1)Also the attach point should be changed from a.limfront (as it was in previous versions) to a.light0 . And ability to change the angel (usually the headlights are directed slightly on the ground) and "FOV" of light beam.

whitepass
December 3rd, 2015, 11:04 AM
It never was a.limfront, it is a.lightN where N is a number like 0, 1, 2, 3 and odd numbers are front even back and you can direct it any place, I have one that is pointed up.

TRam__
December 3rd, 2015, 07:11 PM
Simply coronas were in a.light0,1 etc, but the "dinamic light source" was always on a.limfront/a.limback, same as decoupling markers(red)... To make the headlight source position to be correct, we had to make a.limfront upper.

http://i.piccy.info/i9/93ac5c6a1171598ec0e788216024711b/1449187859/29605/975962/Bezymiannyi_500.jpg (http://i.piccy.info/i9/ac84b04973e8cc121fbd44bd276a008f/1449187859/395019/975962/Bezymiannyi.jpg)http://i.piccy.info/a3/2015-12-04-00-11/i9-9101343/500x271-r/i.gif (http://i.piccy.info/a3c/2015-12-04-00-11/i9-9101343/500x271-r)

That hasn't been fixed in TANe SP1. For example, we have too locos with a.light0 on the just same height:
http://i.piccy.info/i9/fa2237c96898e47e0a83a88ed8291152/1449189981/8858/975962/Bezymiannyi2_500.jpg (http://i.piccy.info/i9/8e232cab91e544b9b3175e32eac5d3e7/1449189981/91911/975962/Bezymiannyi2.jpg)http://i.piccy.info/a3/2015-12-04-00-46/i9-9101359/500x271-r/i.gif (http://i.piccy.info/a3c/2015-12-04-00-46/i9-9101359/500x271-r)

But their light beams are different, because of different a.limfront positions:

http://i.piccy.info/i9/e47b92cf01c78972739924f6f8955681/1449190112/9797/975962/Bezymiannyi1_500.jpg (http://i.piccy.info/i9/6d7e6422de303282ed66cd5eed8f7b48/1449190112/120735/975962/Bezymiannyi1.jpg)http://i.piccy.info/a3/2015-12-04-00-48/i9-9101361/500x271-r/i.gif (http://i.piccy.info/a3c/2015-12-04-00-48/i9-9101361/500x271-r)


P.S. new (more optimised) way to make sharp beam angel for headlight:


#ifdef LIGHT_TYPE_SPOT // Normalize the light dir.
lightRayDir = normalize(lightRayDir);


float spotBase = dot(-lightRayDir, GetObjectViewLightDir(fin));


if(spotBase > 0.9)
spotBase = pow(9.7*(spotBase - 0.9), lightSpotParameters.y);
else
{
discard;
}


spotBase = max(spotBase, 0.0);


// float spotIntens = spotBase;//pow(spotBase, lightSpotParameters.y);


// Only light if in the spot cone.
// spotIntens *= float(step(lightSpotParameters.x, spotBase));
atten *= spotBase;
#endif // LIGHT_TYPE_SPOT

http://i.piccy.info/i9/f3214f21e3859963146983e1aece48c1/1449189070/8353/975962/Bezymiannyi_500.jpg (http://i.piccy.info/i9/e3432ffd9238055213ab635e8ffcf543/1449189070/87468/975962/Bezymiannyi.jpg)http://i.piccy.info/a3/2015-12-04-00-31/i9-9101356/500x269-r/i.gif (http://i.piccy.info/a3c/2015-12-04-00-31/i9-9101356/500x269-r)

Mick_Berg
December 4th, 2015, 01:43 AM
It never was a.limfront, it is a.lightN where N is a number like 0, 1, 2, 3 and odd numbers are front even back and you can direct it any place, I have one that is pointed up.
I have to agree with TRam, headlight source was at a.limfront/a.limback IIRC.
Mick

Mick_Berg
December 4th, 2015, 02:01 AM
What needs to be done is a more performance-friendly way of lighting for headlights. There are a thousand things we "could" do to improve what we have (and even that is probably a major understatement), so it all comes down to what gets done this week/this build/next build/next version etc.

We have removed rain from tunnels, added smoke collision in tunnels and gone to per-pixel lighting for headlights (vs per-vertex in previous Trainz versions) so all is not lost.

Regarding headlight tags not working, please provide an example kuid so we can check it out, but the ones I just tried all work. (I know there are some locos do not have headlights set up in their config).

Despite saying I wouldn't, I did some investigating and found that some locos that I expected to have headlights actually didn't, most noticeably Andi's Metrovic. (He's probably prototypically correct.) so I incorrectly stated that they had problems. Some that are working properly are my battery loco (phew!!!-relief) and the BR Class 47.

But there's a huge basic problem with the way things are right now, illumination seems to depend on the individual asset, probably depending on the specular setting. This means that for example, in a tunnel where the tunnel wall has a low specular value but the rails have a higher value, the walls are dark but the rails shine. It looks really bad. I can't think of any possible way this situation could be remedied, with all Trainz assets having different specular values, originally set by their creators (me included) who can't be blamed for not considering how they would look in a train's headlight.

What are we going to do?:confused:

Mick

Mick_Berg
December 4th, 2015, 03:28 AM
In TS12 our locomotive headlights light up the track in the tunnels along with the walls during the daylight hours. In T:ANE, however, this isn't the case and there is no difference in lighting when a train goes into the tunnel.

Is there a chance that can be fixed so this works the same as it did in the past?

John

Yes, please restore this. Why was it removed? Seems that in TS12 (and previous versions) the headlights would come on when the loco was on track with "istunnel " set. The fact that this behaviour is gone in TANE is a partial reason for my erroneous accusations of the headlight not working properly. It seems that it does work, albeit much too bright by default.
Mick

JCitron
December 4th, 2015, 11:42 AM
What causes the performance problems with headlights?

Is it related to the DirectX light source issue that used to plague us?

I remember an issue way back with TRS2006 or TS2009 where if there were too many locos with headlights on, the program would crash to the desktop as soon as the camera (user-view) faced the locomotives.

I'm sorry if I'm asking dumb questions.

John

whitepass
December 5th, 2015, 10:27 AM
The headlight at a.light0 is no problem it's the light on the ground and scenery that is more like the shadows.

Mick_Berg
December 5th, 2015, 03:06 PM
I agree, this would be a very poor compromise.
What needs to be done is;
1. Allow the brightness of the headlight, or the degree to which it illuminates other objects, to be controlled. It is way too powerful right now. You're supposed to be able to control it with tags in config.txt but they don't seem to work. (I'm assuming it hasn't been addressed in SP1)
2. Make the headlight come on according to the ambient light level, as opposed to the time of day (so it would come on in tunnels)
3. Fix all the various Driver commands, menu commands etc, that control the headlight, as many of them don't seem to work (including the tags in config.txt.)

Then of course we have the current awful situation with the ambient lighting in tunnels, but that's a separate issue.
Mick.
This post is all wrong.......ignore it ( mods delete it if you wish.) I based my findings on headlights in tunnels, unaware that TANE had lost the ability to have headlights in tunnels at any time of day.
Sorry about that!
Mick.