Crappy night mode lighting in TRS22

MSGSapper

Trainz route developer
Night mode lighting in TRS22 is crappy at best. In builds above 3.5 the resulting light is nowhere near as good as night mode lighting was in Trainz build 3.5 and earlier.

Below is a screenshot showing the difference. On the left is a build 4.6 light pole using exactly the same textures shown for the build 3.5 item for the light. On the right is the same light pole but done as build 3.5 using a “onetex” night mode texture. As you can see the change is dramatic.

Night-Mode-Test.jpg


I brought this issue up in this forum on Dec 12, 2022 in the following forum post link, but nothing has changed since:

https://forums.auran.com/threads/support-for-blenders-point-light.170293/

This has gotten to be such an issue in content creation for me that I am seriously thinking about rolling back several of my existing night mode content items from build 4.6 or above to build 3.5 in order to resolve it.

Of course, the solution, as was discussed in my original reference thread above, would be to implement Blender’s point light in Trainz.

Bob
 
Last edited:
Is the problem shown due PBR’s lack of support for alpha-blended opacity, or something inadequate about how the emissive parameter works?
Oops, I had to make a correction here. The light pole with the shown as build 4.7 PBR is actually 4.6 and is not PBR.

The textures for both items shown were exactly the same. That actually shows you how badly builds above 3.5 are handled in TRS22 when it comes to light illumination compared to what it was before. FYI I have now corrected the text in my OP, and the screenshot, to show all this. Sorry for the confusion here.

FYI the only difference between the two items shown in the screenshot is that one is build 4.6 and the other is build 3.5 and the removal of the LOD related stuff from build 3.5, other then that they are exactly the same.

As for your question, assuming you are using something a like a light cone you would have 70-90% transparency and a fully white or yellow if you were doing this in PBR. The emission layer of the parameters texture would be fully white. The albedo file would be where your transparency and color would be. There are probably other ways to do this, but it is the way I have done in my items. The emission layer provides the "glow".

Bob
 
Last edited:
You see, this is why i really only tinker with the older trainz. Too much odd problems with the new ones (ALSO, that light looks totally off!)
 
You see, this is why i really only tinker with the older trainz. Too much odd problems with the new ones (ALSO, that light looks totally off!)
I really don't want to turn this thread into a debate of old Trainz versus new Trainz since this thread which I started is only about lighting in TRS22.

I will say this much however in fairness to N3V. Except for how Trainz handles lighting in TRS22, most everything else in content creation works fairly well. In general I like PBR as you can achieve a high level of texture realism compared to non-PBR textures. Just see some of my build 4.7 items and see for yourself.

Now back to the original topic of lighting in TRS22.....

Bob
 
I really don't want to turn this thread into a debate of old Trainz versus new Trainz since this thread which I started is only about lighting in TRS22.

I will say this much however in fairness to N3V. Except for how Trainz handles lighting in TRS22, most everything else in content creation works fairly well. In general I like PBR as you can achieve a high level of texture realism compared to non-PBR textures. Just see some of my build 4.7 items and see for yourself.

Now back to the original topic of lighting in TRS22.....

Bob
I've seen some pbr and some of your content. Very grand quality. Now, kind sir, back to the point...
 
Have you actually tried to do a smooth opacity gradient (or emissive gradient) in a PBR material other than m.glass?
I am not sure how that would work in PBR as I have not done that. Have you tried it with any success?

Bob

My entire experience of PBR opacity is pretty much contained in this thread, which you might recall.

My conclusions were that opacity of any sort is just impossible in m.pbrmetal and that m.pbrmetalmasked only supports opacity that is totally opaque or totally transparent. Therefore, neither of them seem to be good candidates for a light pool. What's needed for a build 4.6+ light pool or cone is a PBR material that can handle gradients in opacity and perhaps also in emission too. This equates to the ability to support blended strengths of opacity and emission.

The only PBR material that handles per-pixel blended opacity seems to be m.glass. I haven't specifically tried to get an opacity gradient with it, but I have done a window which had smudges of various degrees of opacity. So I think it has a good chance of handling a smooth opacity gradient.

I have less experience with emissive textures, but the effect is supposed to be on a per-pixel, blended basis too, so a gradient might work. I haven't yet tried it myself.

My overall thought was that m.glass has the best chance of incorporating the type of opacity (and possibly emissive) gradients needed for a nightmode light pool or cone in PBR. The Wiki mentions several limitations about m.glass, such as Z-ordering problems, so success is not guaranteed, but I think it would be worth trying.
 
Last edited:
My entire experience of PBR opacity is pretty much contained in this thread, which you might recall.

My conclusions were that opacity of any sort is just impossible in m.pbrmetal and that m.pbrmetalmasked only supports opacity that is totally opaque or totally transparent. Therefore, neither of them seem to be good candidates for a light pool. What's needed for a build 4.6+ light pool or cone is a PBR material that can handle gradients in opacity and perhaps also in emission too. This equates to the ability to support blended strengths of opacity and emission.

The only PBR material that handles per-pixel blended opacity seems to be m.glass. I haven't specifically tried to get an opacity gradient with it, but I have done a window which had smudges of various degrees of opacity. So I think it has a good chance of handling a smooth opacity gradient.

I have less experience with emissive textures, but the effect is supposed to be on a per-pixel, blended basis too, so a gradient might work. I haven't yet tried it myself.

My overall thought was that m.glass has the best chance of incorporating the type of opacity (and possibly emissive) gradients needed for a nightmode light pool or cone in PBR. The Wiki mentions several limitations about m.glass, such as Z-ordering problems, so success is not guaranteed, but I think it would be worth trying.
I used to think .glass was fairly limited with what you could do with it, but my purchase of the Class Truck Collection at CGTrader changed my mind. See at:

https://www.cgtrader.com/3d-models/vehicle/truck/classic-truck-collection

Look at any of the models I released that came from that package which I adapted for Trainz and you will see some pretty interesting things regarding the various window panes. Mud, dirt, dust and more all show on those windows which were a .glass material having albedo, normal and parameters texture maps. It was obvious that more could be done then I though regarding .glass.

The problem with lighting in PBR is two fold:

1. Getting transparency right. To little and you can't see through it as you would with light. Too much and little or nothing shows. I found the range running from 70-80% transparency works about right. This really is a poor way to deal with simulating light IMHO.

2. The emissions layer in the parameters texture map. This is a BIG problem that over shadows almost everything else. This is where the "glow" comes from for your light. The problem is that even with 100% white in the emssions layer the light glows very weakly as you can see in my screenshot above. The emissions layer only glows. It does not project true light. Now contrast this with the way lighting in handled in Trainz content item that are build 3.5 or earlier. The lighting is MUCH brighter and looks far better. Again you can see this in my screenshot above. Because of these problem I am no longer doing nightmode for most of my PBR based content items. It just doesn't look right.

The ultimate solution to these issues is providing Blender "point" light support in Trainz. This will result in true light projection in a way that look fairly natural and right since it is basically ray traced light.

Bob
 
Bob,

Of course the currently available 2D surface lighting will never be as good as volumetric lighting. That's a given.

However, since we are stuck with 2D lighting, I tested the use of m.glass as a nightmode material in a build 4.6 asset today. The results were quite good. The test asset is the green platform lamp in the screenshot. Textures on the pole, lamp and light bulb are all just m.pbrmetal.

HSorI9T.jpg



The nightmode light cone and light pool shown below use only the PBR material, m.glass. The cone is 2-sided geometry to ensure its inside “wall” is visible too.
Bm1kfI8.jpg


It turned out that a blended opacity gradient in the albedo map was sufficient to produce this effect. There was no need for a gradient in the emissive channel, so that was left as just a uniform 100% white. The banded rings in the light pool are only because my manually constructed opacity gradient wasn't a perfectly smooth transition from white to black.

In terms of brightness, I really didn't have a problem. Aesthetically, I think the brightness and opacity of this light cone should be a bit less than what I have here, but I didn't bother fiddling too much since this was just a concept test.

The nightmode curtains in the windows of the building were done with emissive m.pbrmetal (no opacity, just emission). They look bright enough to me too.

I think if a build 4.6 nightmode fails due to weak emissive strength, there must be some factor other than the whiteness of the parameter's red channel at work. I don't know what that factor is, but I think these tests at least demonstrate that there are no fundamental problems in getting a "legacy-like" nightmode with PBR and trainz-build 4.6. I hope there is enough promise here to make reverting your assets back to build 3.7 unnecessary.
 
Last edited:
Back
Top