.
  • Controlling Level of Detail Distance

    In our next version of Trainz, you'll not only find enhanced rendering techniques (see our previous Blogs for more details) but you'll also find new systems designed to improve performance or allow more control over existing features. One of these systems that has been overhauled is our "LOD" system.

    Level of Detail (LOD)

    We've mentioned LOD before, but what does it really mean and why do we need it?

    In the image below, you can see 5 LODs for an asset (yes, programmers like to count starting at 0 :-)

    In the 2D view at the top you can see the mesh shapes getting simpler and simpler. The "3D" view below shows the size that item appears in game at the distance indicated.



    So the small "dot" that appears at 1km and beyond is, in fact, not a high res 40,000 polygon "sphere" but instead a very simple 8 sided object.

    As you can see in the image above, it's hard to tell that you're not looking at the original object as the camera moves away, but instead viewing an increasingly simplified LOD version of that object.

    Of course the major benefit of adding these LOD versions is that your hardware is then not being forced to draw millions of polygons that are, for all intents and purposes, not visible on screen.

    Controlling LOD Distances


    As content quality and fidelity improve over time and in-game objects look more and more realistic, it becomes increasingly important to ensure the Level of Detail (LOD) is carefully managed.

    Imagine the performance impact of a very high resolution asset that doesn't reduce in complexity when it apears as a few pixels on screen.

    In the current Trainz, the game decides when to reduce LOD. In the next version of Trainz, we're providing the Content Creators the power to customise and control when each LOD cuts in. This gives more flexibility to allow more aggressive scene reduction



    We'll be introducing a new config.txt tag ("mesh-table-lod-transition-distances") to control the distance at which the LOD transitions occur.

    The use of this feature replaces the "mesh-detail-level-count" and "maximum-lod-distance" tags, which will be obsolete as of v4.6 (the expected trainz-build number for our next Trainz product).

    The "mesh-table-lod-transition-distances" tag will be optional as of v4.6 and if used must contain a float array specifying the end distances for each LOD level. If this tag is omitted, then no mesh-table LOD is used.

    This is suitable for low-detail scenery assets and for LM-only assets such as train vehicles or Carz.

    Read the full Blog Post here...
    Comments 19 Comments
    1. pcas1986's Avatar
      pcas1986 -
      Your last sentence is a bit vague. Are you saying it will replace the lm.txt method?
    1. SailorDan's Avatar
      SailorDan -
      You have got a 4-item list describing 4 transition points for 5 LOD levels. That's confusing. Wouldn't it make more sense for the list to define the cutoff distance for the LOD with the same index:

      mesh-table-lod-transition-distances 10.0, 30.0, 150.0, 1000.0 2000.0
      This example specifies the cutoff distances for an asset with 5 mesh-table LOD levels.
      The first (LOD 0) is used for distances up to 10.0m.
      The next (LOD 1) is used for distances up to 30.0m.
      The next (LOD 2) is used for distances up to 150.0m.
      The next (LOD 3) is used for distances up to 1000.0m.
      The last (LOD 4) is used for distances up to 2000.0m.

      The asset is not displayed at all beyond 2000.0m.
    1. ish6's Avatar
      ish6 -
      Hi Tony --
      Can't wait to see all this in action (route)!
      Kind Regards
      Ish
    1. WindWalkr's Avatar
      WindWalkr -
      Quote Originally Posted by pcas1986 View Post
      Your last sentence is a bit vague. Are you saying it will replace the lm.txt method?
      Mesh-table LOD is not currently a replacement for lm.txt, but this change takes it one step closer to those capabilities. LM.txt is still the correct answer for most animated and moving objects.

      The change here is specifically to allow LOD transitions to occur at user-defined distances, overriding the system defaults. This means that your LOD transitions can be customised for edge cases where the system defaults are inappropriate.

      chris
    1. WindWalkr's Avatar
      WindWalkr -
      Quote Originally Posted by SailorDan View Post
      You have got a 4-item list describing 4 transition points for 5 LOD levels. That's confusing. Wouldn't it make more sense for the list to define the cutoff distance for the LOD with the same index
      Each distance that you specify is a LOD transition. With a single distance specified, that means you have two LOD levels. With two distances, three LOD levels, and so on. The final LOD level extends out to the system-wide draw distance for the asset type in question.

      Given how mesh-table LOD works, you may have zero or more meshes for each LOD level. If you want the lowest LOD level to have no meshes at all, acting as an early cut-off, that remains entirely valid.

      chris
    1. Dinorius_Redundicus's Avatar
      Dinorius_Redundicus -
      Quote Originally Posted by WindWalkr View Post

      The change here is specifically to allow LOD transitions to occur at user-defined distances, overriding the system defaults. This means that your LOD transitions can be customised for edge cases where the system defaults are inappropriate.

      chris
      From a creator's perspective, that is such excellent and long-awaited news. Trainz 2018 is shaping up to be a major advance. Will there still be some minimum poly-reduction criteria or are they gone for good under this new system?
    1. WindWalkr's Avatar
      WindWalkr -
      From a creator's perspective, that is such excellent and long-awaited news. Trainz 2018 is shaping up to be a major advance. Will there still be some minimum poly-reduction criteria or are they gone for good under this new system?
      The same criteria will still be present. The customisable draw distance will make it easier to meet the requirements, but at the end of the day you MUST provide reasonable LOD transitions or performance will suffer needlessly.

      chris
    1. pcas1986's Avatar
      pcas1986 -
      Quote Originally Posted by WindWalkr View Post
      Mesh-table LOD is not currently a replacement for lm.txt, but this change takes it one step closer to those capabilities. LM.txt is still the correct answer for most animated and moving objects.

      The change here is specifically to allow LOD transitions to occur at user-defined distances, overriding the system defaults. This means that your LOD transitions can be customised for edge cases where the system defaults are inappropriate.

      chris
      I thought that was the intention, but thanks for the clarification. In any case this move will encourage creators to make TB4.6 assets. Looking forward to playing with this when comes along.
    1. clam1952's Avatar
      clam1952 -
      Quote Originally Posted by pcas1986 View Post
      I thought that was the intention, but thanks for the clarification. In any case this move will encourage creators to make TB4.6 assets. Looking forward to playing with this when comes along.
      Me too, will make life a whole lot easier with lod.
    1. SailorDan's Avatar
      SailorDan -
      Quote Originally Posted by WindWalkr View Post
      Given how mesh-table LOD works, you may have zero or more meshes for each LOD level. If you want the lowest LOD level to have no meshes at all, acting as an early cut-off, that remains entirely valid.
      Yes - but that's a backwards way to do it. A LOD level without a mesh is an inconsistency, and is not needed at all with a simple change to mesh-table-lod-transition-distances tag. Much better to assume that any LOD level that has been specified has a mesh, and needs to be drawn, but the items in the mesh-table-lod-transition-distances tag match one-to-one with the LOD levels. Much easier than remembering that there is always one less mesh-table-lod-transition-distances list item than there are LOD levels, and that the no-mesh trick is needed to specify a cutoff. In fact, specifying a cutoff should be mandatory - requiring the mesh-table-lod-transition-distances list item count to match the LOD levels is a simple way to do that.
    1. ajrf's Avatar
      ajrf -
      WOW! This looks interesting so far
    1. ish6's Avatar
      ish6 -
      Hi All --

      I know that a high-end video card will be needed, no problem for me there; However, how would of these effects, etc affect the cpu? In terms of one's pc heating up! For example on one of my pc;s I have in it an old cpu which dates back to 2011, but a good video card on the motherboard, and computers do get hot sometimes flying some intensive high graphic games!

      I'm no tech-wiz, so anyone throw in here your 2 cents on the subject! LOL

      Thanks
      Ish
    1. WindWalkr's Avatar
      WindWalkr -
      Yes - but that's a backwards way to do it.


      Not really. In fact, it's mostly a matter of semantics. If you add the extra value, it will give the result you describe. The only difference is that the "cutoff" isn't mandatory- you can instead (and are encouraged to, for larger objects) allow the user to select the appropriate draw distance rather than forcing one.

      chris
    1. WindWalkr's Avatar
      WindWalkr -
      Quote Originally Posted by ish6 View Post
      However, how would of these effects, etc affect the cpu?
      We don't anticipate any significant additional CPU usage. Unless your CPU is a major bottleneck for you at the current time, I wouldn't worry too much about it.


      In terms of one's pc heating up! For example on one of my pc;s I have in it an old cpu which dates back to 2011, but a good video card on the motherboard, and computers do get hot sometimes flying some intensive high graphic games!
      That they do. I would posit that any desktop computer that is unable to cool its components is broken. If you're having problems with this, perhaps invest in an improved cooling system (or a newer, more efficient CPU). Laptops on the other hand have a tendency to throttle back under sustained load, which can result in them running worse than you'd expect for their given specifications.

      chris
    1. ish6's Avatar
      ish6 -
      Hello Chris --

      Thank you, sir for your explanations!

      I'm good here, but I know the trainz community, and hopefully people read these posts about the next Trainz, and don't get caught off-guard!

      Take Care
      Ish

      A side question:
      Whatever happened to VR and Trainz, since it seemed you've invested great interest about it, Chris?
    1. pcas1986's Avatar
      pcas1986 -
      Quote Originally Posted by ish6 View Post
      ...
      I'm good here, but I know the trainz community, and hopefully people read these posts about the next Trainz, and don't get caught off-guard!
      ....
      I think the CC community will like these changes BUT it will be for TB4.6 and beyond.

      There has been, and will be, some changes to configs and validation that should, in theory, improve routes. But they will take time to filter through. Some of us take interest in this.
    1. WindWalkr's Avatar
      WindWalkr -
      Quote Originally Posted by ish6 View Post
      A side question:
      Whatever happened to VR and Trainz, since it seemed you've invested great interest about it, Chris?
      Probably better to start a separate topic for that one. Short version: I've dabbled with it, it works surprisingly well, but current hardware is expensive and/or limited and we don't think that there's enough community interest in the immediate short term to prioritise the work. We'll continue to track community interest and the state of the hardware, and i'm sure I'll keep dabbling when I have time free (as you can probably guess, I have other things keeping me busy right now..)

      chris
    1. ish6's Avatar
      ish6 -
      Quote Originally Posted by WindWalkr View Post
      Probably better to start a separate topic for that one. Short version: I've dabbled with it, it works surprisingly well, but current hardware is expensive and/or limited and we don't think that there's enough community interest in the immediate short term to prioritise the work. We'll continue to track community interest and the state of the hardware, and i'm sure I'll keep dabbling when I have time free (as you can probably guess, I have other things keeping me busy right now..)

      chris
      Hi Chris --

      More less that's what I thought since you haven't updated the thread on this subject!
      Thanks for the info!

      Take Care
      Ish
    1. Mick_Berg's Avatar
      Mick_Berg -
      Definitely looking forward to this. I have an asset of a building that, because of its size, does not work with any of the current LOD systems.

      Thanks,
      Mick