The proper way to illuminate cabin?

VVMM

Trainz Scripter/Developer
Hi all,

In good old days, (TS12, TS2010) we used to have the SetCabLightIntensity function which could illuminate the cabin with a switch of a button. Now this function does not work or at least does not work anymore for me (I cannot see any change).
Someone suggested to use SetTextureSelfIllumination instead, but this is cumbersome, you have to call it on every texture and on the online wiki it is stated that:
  • Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.

So, what should I use to illuminate the cabin?

Thanks,
Mihai
 
Hi Mihai
If you want to simply have it work automatically in TRS19, you can use the self-illumination channel of the PBR 'parameters' texture to provide illumination for the cab view.

If you need it to be manually controlled, then my current thoughts (from a content creation point of view; not an official N3V point of view :) ) would be to use texture replacement to replace the parameters texture with a version with self-illumination on/off. It still needs to be configured per mesh, but you could potentially have different textures for different situations. You could also swap the diffuse texture for some situations to change the colour of the illumination of some components (ie an object that can light up different colours depending on a situation could have the colour changed this way).

Otherwise, the SetTextureSelfIllimination would be the preferred method, and in particular you should be keeping the number of textures/materials to a minimum, so there should be minimal entries for this...

Regards
 
Hey VVMM, to illuminate cabins use the emissive channel in the new PBR Textures. No need for selfillumination anymore.

Kind regards Matthias
 
Thanks for replies. It seems that the only way to achieve Illumination is to use the SetTextureSelfIllumination function, as it needs to be activated by a cabin switch.
 
VVMM: would You point me to some freeware loco with cab featuring SetCabLightIntensity for me to test it?
 
Back
Top