Trainz 2019 and lod meshes

Frank_Dean

Well-known member
Sorry for my English, is not my native language.;)


With Tane, making "lods" was imposed when the material created exceeded 500 polygons.
This was good for the game's frame agility.
It is very true that a lot of time is wasted in making several lod meshes, but it is necessary so that the game does not slow down when there is a lot of content in scene.
If the material created exceeded 500 polygons and we set it as Tane's build (4.2 to 4.5) and we did not make a "lod", when installing it in Tane it came out wrong with the following message in red:
-VE109: The low-detail meshes total more than 500 polygons. This may have a negative impact on performance

Some authors to avoid the work of making different meshes-lods, they place the object a build lower than Tane: 3.6 or lower and it can be used without many problems both in Tane and in 2019.

All this introduction comes from checking and inspecting objects made and recently uploaded to the DLS for Trainz 2019, build 4.6 of the industrial type, installed and tested that only have a single mesh: "mesh name.trainzmesh" and have from 20000 to 120000 triangles-polygons.

In the config.tex, it has especially for 2019:

mesh-table-lod-transition-distances 1500

mesh-table
{
default
{
auto-create 1
mesh "mesh name.trainzmesh"
lod-level 0
}
}

It has no errors and only a yellow notice:
VE107: The high-detail mesh has a total of more than 10,000 polygons. This could have a negative impact on performance

Seeing this, I am going to do an experiment, an object of mine made with the old Gmax 1.2 and with an " im mesh " of 6872 polygons without "lods" for now.
I put it in Tane and in 2019 and in both it comes out wrong and not usable:
VE109: The low-detail mesh has a total of more than 500 polygons. This can have a negative impact on performance: 0: 6872

In Tane without adding "lods" it cannot be used with a build 4.2-4.5, only if we put a build 3.5 or lower can we use it.

But in 2019 if the following is changed or added in the config.tex:

trainz-build 4.6
mesh-table-lod-transition-distances 1500
mesh-table
{
default
{
auto-create 1
mesh "name of the mesh.IM"
lod-level 0
}
}

We installed it in 2019 and it appears without errors or warnings, with a single mesh.

Another experiment with a build 2.0 tank car with a single im mesh of 5000 polygons and no initial shadow.
I fix the config.tex, removing obsolete tags, putting thumbnail and shadow on it.
I add:
Build 4.6
mesh-table-lod-transition-distances 3000
Text file "lm": name mesh.lm.txt and another similar one for the shadow
inside only one mesh is mentioned:

version 1.0

offset = 0.01;
calcPoint = center;
multiplier = 1.0;
animationCutOff = 0.00;
renderCutOff = 0.00;
attachmentCutOff = 0.1;

mesh ("1.0")
{
name = "name mesh.IM";
}

Installed in 2019 and appears without errors or warnings, with a single main mesh and a shadow mesh with a 4.6 build

All this done in Trainz2019 Platinum SP1 build: 105096


Is this a back door to avoid working on lod meshes?

Why is Trainz 2019 allowed to handle high poly single meshes with a 4.6 build, to the detriment of performance?

Is this a 2019 bug?

If they correct it, in a future service pack all the content for 2019 with a single very high polygon mesh and without lods, will those assets become erroneous?.
 
mesh-table-lod-transition-distances 3000 as the only entry means that the item is culled at 3000m so not loaded, it's not supposed to be a back door, however it's useful for a large object that even with lod is difficult or impossible to get under 500 triangles.

It's supposed to be used with lod meshes but the last value you use will cull the asset completely, so if you can't see it in game at a certain distance you can stop it being rendered.

A proper config use of it would be say using arbitrary values:

mesh-table-lod-transition-distances 500,1000,2000,3000

lod 1 cuts in at 500m, 2 at 1000m, 3 at 2000m, is culled and not rendered at 3000m

It is however extremely useful for testing an asset before the lods have been created.

Note you can replace a building at say 2000 metres with say a simple box and use that as the lod mesh at whatever distance you can't see its just a box at lod1, say 2000m then add 3000m to completely cull it.

Shouldn't use lm.txt and mesh-table-lod-transition-distances on the same mesh use one or the other.

Effectively mesh-table-lod-transition-distances 3000 is not allowing a high poly / triangle asset to sit there affecting performance as it's not being rendered at that point.

Shadow meshes are not required in TANE or TRS19, shadows are now calculated by the game engine and only required for legacy assets 3.7 and under.

Going back to mesh-table-lod-transition-distances I'm actually using it on all the buildings I'm making for my current WIP some with lod but I'm using it even for those under 500 triangles as may as well cull it if it can't be seen at a certain distance.


As a point it appears that some older assets are getting automatically culled at around 3000m, exceptions being traincars and anything animated or using smoke effects and I'm pretty sure if you use mesh-table-lod-transition-distances without a value the game engine culls it at some distance anyway.
 
My first message was perhaps a bit confusing, but I will insist that there is a back door to upload and publish very high polygon objects (build 4.6) avoiding the work of doing multiple meshes (lods), which is ideal for better performance ,when there are many objects on the scene.
Most Trainz 2019 users just want some great looking objects and trains in the game, they don't care how they are done, this is logical for a simple user.
Complaints and laments will come later when a laden path of those high poly objects drops performance to a few fraps, and may even crash the game.

Simply in an object with a single mesh (I have seen 10,000 to 120000 polygons) and placing the following in the config.tex:

"mesh-table-lod-transition-distances 1500"
1500 is the distance in meters at which the object completely disappears from the scene.
1500 is the distance that a famous author uses in all his objects with a single very high polygon mesh.
As long as we are less than that distance, the object will be present, and the problem is not in a single object, but in dozens or hundreds of bad facts, without lods.
By placing this tag in the config.tex, the author avoids the work of making several lighter polygon meshes, this could not be done in Tane unless we lower the build to 3.5 or lower.
I personally have tried to introduce a high polygon object with a single mesh, in 2019 and with a 4.6 build and without problems and doing it in Tane with a 4.5 build is not possible.
But me, when I publish an object in the DLS, as long as it exceeds 500 polygons, it will have several meshes (lods), up to 4 lods. I must be silly for wasting my time doing multiple meshes, which is not very pleasant and no one is thanking you.

Perhaps I am wrong and therefore I ask for forgiveness in advance.
 
In cases where the item is high poly and you do not want to have multiple LODs, with all the work that that entails, all you need to do is have the following in the config.txt:

Code:
[B]mesh-table-lod-transition-distances     1500[/B]

mesh-table
{
  default
  {
    auto-create                         1
    mesh                                "tank.trainzmesh"
    [B]lod-level                           0[/B]
  }
}

This is the "back door" you are talking about.

The transition distance can be whatever you set it to, but in most cases I use somewhere between 1500-2500 meters.

This has worked well for me in all my build 4.6 content items.

BTW in my opinion the 500 polygon cutoff is absurdly low given the capabilities of graphics cards these days That limit may have been fine when Trainz began way back but technology and capability improvements have rendered it rather ridiculous now. N3V needs to update that level to something much higher if they want better looking content to match there much more realistic graphics in TRS19 or later. 500 Polygons sure doesn't leave much room for realism in most models. Most simulations and games out there have limits far higher then that.

Bob
 
Last edited:
It does make things easier in that even when using lod you can control when it gets applied and you can get away with not having to have an under 500 poly mesh by just culling it at 1500 or whatever distance you decide it isn't going to be seen, nothing more annoying than seeing an asset visibily change 100m or less away! It can get very noticeable now people are using larger screens and higher resolutions
And yes I know whom you are referring to re 1500.
I seem to remember it was mentioned, I think by Chris B, probably when it was in beta that N3V were easing off on lod in TRS19, this method would seem to fit the bill.
In my case I tend to avoid exessively high poly stuff without lod but then I do make a lot of my own assets so it's not really a problem.

I honestly wouldn't worry about it, other than sketchup stuff you don't hear many complaints about lack of lod.
 
But at the same time bear in mind that not everyone has a high powered graphics card. The Intel integrated graphics are getting better which widens the range of machines that can run Trainz. The UHD Graphics G1 for example on an i3 will allow people to run some optimised layouts so LOD is quite nice to have and isn't that difficult to do once you have the original mesh sorted out especially in Blender.

Cheerio John
 
Back
Top