PDA

View Full Version : A question about mesh libraries



itareus
September 14th, 2015, 09:25 AM
Can mesh libraries be used with rolling stock - i.e. with the LM format ?

I can't find any documentation on this but the question has been asked in another forum.

Chris M

andi06
September 14th, 2015, 09:49 AM
Yes,

As well as the im meshes any *.kin and *.lm.txt files should be in the library asset.

A typical main mesh reference would therefore look like this:

default {
mesh-asset <kuid...>
mesh default.lm
kin default.kin
}

itareus
September 14th, 2015, 12:22 PM
Thanks Andi, I'll pass that on.

itareus
September 14th, 2015, 05:56 PM
Andi,

If you have time could you have a look at this thread in TCWW - BR Freight Stock photos from Brechin and Bridge of Dun - recent posts about LM files by Jack. Your help would be appreciated with this, the end product will be new TANE compliant UK freight stock using up to date techniques but there are some hurdles to jump at the moment.

Thanks

Chris M

andi06
September 15th, 2015, 03:59 AM
A huge thread, I'll try to read it through tonight.

whitepass
September 15th, 2015, 07:03 PM
I can see this for cars that you would use a lot (coal cars) but would it help if only 2 or 3 cars are on the route? I have only seen one car using it and it has way to much in it to see what is going on.

itareus
September 16th, 2015, 10:52 AM
I can see this for cars that you would use a lot (coal cars) but would it help if only 2 or 3 cars are on the route? I have only seen one car using it and it has way to much in it to see what is going on.

A valid point, but in this case we are talking about wagons (cars) that would appear in very large numbers (trains could be up to 80 wagons even in the UK steam era) and very often these would be the same type of wagon with minor variations in build and lots of texture differences, many also shared a common underframe. Examples are minerals, tipplers, hoppers, standard vans, conflats, lowfits, 'five plank' open wagons (for general goods), bogie steel carriers etc.etc.

Specialist vehicles which existed in small builds were rare in the UK, however they do tend to be over represented in model railways because they add variety.

Chris M

JCitron
September 16th, 2015, 11:34 AM
A valid point, but in this case we are talking about wagons (cars) that would appear in very large numbers (trains could be up to 80 wagons even in the UK steam era) and very often these would be the same type of wagon with minor variations in build and lots of texture differences, many also shared a common underframe. Examples are minerals, tipplers, hoppers, standard vans, conflats, lowfits, 'five plank' open wagons (for general goods), bogie steel carriers etc.etc.

Specialist vehicles which existed in small builds were rare in the UK, however they do tend to be over represented in model railways because they add variety.

Chris M

Yeah, that cool factor tends to get in the way. :)

The single library of common items is great as this means less of a system overhead for loading the same objects over and over even for different assets of the same type. What this does is save time because the modern OSs such as Windows 7 and up use lots of caching algorithms. From what I've read this was inherited from the server OSs that are released concurrently with each of these Windows releases.

You'll notice this if you read a directory (folder). The first time it's slow to load, but subsequent loading of the same file structure is much, much faster. By implementing the mesh-tables into the simulator, this gives us better throughput overall due to far fewer I/O operations. The way it is now, each train-car, even if it is the same, has to be read and loaded from disk. The first one is read, dumped from cache because that data is now old so the next one can be loaded up. This wastes time due to the extra reads and processing by the CPU, GPU before we see it in game. With a single table, and common directory, the data is read and cached making it ready for multiple reads of the same content before it needs to be flushed.


John

whitepass
September 16th, 2015, 02:48 PM
So here are to US 40ft box cars the one on the left has a mesh library the one on the right dose not, witch one would "run" better if only 2 or 3 where used?

785

RRSignal
September 16th, 2015, 06:47 PM
Do you mean a "mesh table" or "mesh library"? A mesh-table entry in config.txt is always desirable: It tells Trainz where to find the mesh. Older versions of Trainz e.g. TRS2006 had to use an expensive (in terms of performance) search in the asset folder for the relevant mesh(es).

A mesh library doesn't automatically make things faster. The primary benefit is to allow two or more assets to use the same texture. This conserves memory and spares the reloading of the same texture(s) for multiple items. For instance, I have about 60+ signals in a mesh-library sharing a couple of several-megabyte textures. In another, I have about 20 signals (and counting!) sharing over 8MB worth of textures. I have as little as two assets sharing the same texture, but it's still worth it to use a mesh library rather than provide them as individual assets because if the two different assets are each used in a scene (or a route, for that matter), the texture will be shared among them - let alone 20 or 60 or whatever. The wiki goes into more detail, below.

http://online.ts2009.com/mediaWiki/index.php/HowTo/Build_a_Car_for_Traffic_%28mesh_library_version%29