PDA

View Full Version : Procedural track ballast LOD issue.



Mike10
July 25th, 2015, 04:44 AM
I am creating some procedural tracks and have come across a problem with the LODs for the ballast meshes.
I have used a texture with the ballast image on the main part and a vertical strip on the right hand side for the lowest LOD to use.

711

The problem is that a LOD (LOD3 in this case) does not show in T:ANE if it is mapped to this strip of the texture.
I also created a testing track to balance LODs which had all four LOD levels mapped to a different section of a texture, none of these show in T:ANE.

I have tried using a second texture image for the lowest LOD, that doesn't show up either.

I have swapped the various LOD levels in the config file so they appear in a different order and it is the same one which doesn't show up, so it doesn't appear to be a problem with the asset's setup.

It appears that the ballast meshes only show if they are mapped to the same area of the same texture image.
Does anyone else find this? Am I misunderstanding something?

This is in build 76401

martinvk
July 25th, 2015, 10:47 AM
Is there by any chance an Alpha channel that is setting the edges of the whole texture transparent? I've had other issues with my procedural track but not invisible LODs.

andi06
July 25th, 2015, 10:50 AM
It appears that the ballast meshes only show if they are mapped to the same area of the same texture image.
Does anyone else find this? Am I misunderstanding something?
My ballast layout is similar and I've not seen anything like this - are you sure that your mesh lengths and subdivisions tags are correct?

Mike10
July 25th, 2015, 04:58 PM
Thanks Andi and Martin,

I think it was a case of not seeing the wood for the trees. I had spent so long looking at meshes and multiple complex config files that I just didn't notice the incorrect alpha channel.

It shows up now, but the texture looks horrible. Just a grey blur.



This is the track LOD section of the config file;


track
{
mesh-length 18
adjust-cross-section-to-ground 0

track-lod-tree
{
lod-distance 200

high-detail
{
subdivisions 3
lod-distance 45

high-detail
{
lod-distance 10
subdivisions 2

high-detail
{
mesh "track-lod0"
}

low-detail
{
mesh "track-lod1"
}
}

low-detail
{
mesh "track-lod2"
}
}

low-detail
{
mesh "track-lod3"
}
}
}

It is pretty much a copy of the one shown as an example on the 'How To' page here: http://online.ts2009.com/mediaWiki/index.php/TrainzOnline:HowToGuides

BTW, that is not what I would call a 'How To' page as it assumes you know a hell of a lot about what you are doing to start with. Obviously written by somebody who knew all the ins and outs of the process and therefore didn't add all the useful bits that they thought everyone would know already (and I'm hardly new to all this ;)).
I've also never been able to download those source files at the bottom of the page so I based my meshes on the ones shown in the other 'how to build procedural track' page on the wiki that has now been taken down.

My ballast mesh lengths are;
LOD0 - 3m
LOD1 - 3m
LOD2 - 6m
LOD3 - 18m

I guess I can probably drop the LOD1 and move the other two up now I look at it again, I was just copying the examples.
I'm not sure that won't cause me more problems though, to be honest I don't fully understand the whole 'subdivisions' thing.


subdivisions
The subdivisions tag causes the current track part to be subdivided into multiple parts, which continue to be passed through the track-lod-tree. Each part may take a separate path through the tree, however they all start at the current tree node and move downward (ie. they do not re-parse from the root of the tree.)

Is that English? It doesn't really explain what values I need to use.
My assumption from looking at the config file and the mesh lengths used on that second wiki page is that a 6m mesh has to have 3 subdivisions so it gets to the total of 18m specified in the mesh-length tag, whilst the next one up needs a further subdivision of 2 as it is 3m in length.
If that's true then surely it is a multiplier, not a divider... but that may be just my logic.

martinvk
July 25th, 2015, 09:25 PM
If you look carefully, you'll see that LOD0 and LOD1 are at the same level in the config, one is the high rez and the other is the low rez version. So it can't just be removed without consequences.

Getting your head around the LOD tree is quite a job. I found it helps to rewrite it fully indented to visually show what goes with what. Then create a test object with each LOD a different color so it is visually clear when and where they are used. Take notes as you move around and the various LODs pop in and out. Change one parameter in the config and see what changes in the map.

Long and tedious but the best I could think of barring a detailed explanation with pictures from N3V.

That subdivisions text you quoted looks to be an example of instructions written by coders for coders. Too much is assumed to be known by the reader.

pcas1986
July 25th, 2015, 10:50 PM
I'd like to know what the subdivisions tag means as well. At times I thought I understood it but now I'm not so sure.

The WIKi tutorial that was taken down was mine and I removed it since N3V wrote their own. I was thinking of amending it to include track building hints but I just don't have the time.

Like MartinVK, I also built a coloured track to help understand how it works. It's really useful seeing when the LOD transitions occur.