.
Results 1 to 9 of 9

Thread: Shadow jittering and attachment shaking in TRS19

  1. #1
    Join Date
    Nov 2006
    Location
    Canberra, Australia
    Posts
    8,545
    Blog Entries
    30
     

    Default Shadow jittering and attachment shaking in TRS19

    There has been some discussion about shadow flickering/jitter and attached mesh shaking in the Trainz 3D Modelling channel that is worthy of attention. Some of that discussion is also replicated in the Suggestion Forum here.

    The shadow issue doesn't bother me personally as I usually turn down the shadows as I find them distracting but it is important to some.

    Paul


  2. #2
    Join Date
    Nov 2008
    Location
    Crewe, Cheshire, UK
    Posts
    16,099
     

    Default

    Quote Originally Posted by pcas1986 View Post
    There has been some discussion about shadow flickering/jitter and attached mesh shaking in the Trainz 3D Modelling channel that is worthy of attention. Some of that discussion is also replicated in the Suggestion Forum here.

    The shadow issue doesn't bother me personally as I usually turn down the shadows as I find them distracting but it is important to some.
    Seems like a case for does-cast-shadows 0?
    Malc


  3. #3
    Join Date
    Nov 2006
    Location
    United States of America, Massachusetts, Haverhill
    Posts
    27,489
     

    Default

    I saw this thread as well. It's related to in-cab shadows such as the window frames casting shadows across the gauges and other objects. I know what they're talking about because the buzzy shadows are annoying. I mentioned this issue in the early days of testing but the issue was brushed off.
    John
    Trainz User Since: 12-2003
    Trainz User ID: 124863
    T:ANE Build: 94829
    TRS2019/Trainz-PLUS: 106618

  4. #4
    Join Date
    Nov 2006
    Location
    United States of America, California, Del Mar
    Posts
    473
     

    Default

    Quote Originally Posted by clam1952 View Post
    Seems like a case for does-cast-shadows 0?
    Not particularly since if you want the cab to cast a shadow you'd need this tag set to one.

  5. #5
    Join Date
    Nov 2006
    Location
    Canberra, Australia
    Posts
    8,545
    Blog Entries
    30
     

    Default

    The issue is important to the author who does incredibly detailed cab interiors. After all that work the sawtooth shadows spoil the result.

    Paul


  6. #6
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    7,067
     

    Default

    This is unfortunately one of those performance-vs-quality tradeoffs.

    In simple terms, there are a few relevant variables that are optimised in the shadow algorithm:
    1. How small the individual shadow "pixels" are at extreme close range.
    2. How large the shadow pixels are at longer range.
    3. Shadow z-buffer precision.
    4. Performance.

    Users have some control of this via the various shadow performance settings, but even with that there are still practical limits. It's not really possible to get something that looks great over long ranges but simultaneously has excellent precision at extremely small ranges. We have some room to tweak this stuff depending on the viewpoint (ie. boosting one at the expense of another when we think it's justified by the scene) but at the end of the day if we want to maintain reasonable performance then there have to be limits.

    When shadow resolution isn't quite as good in a given scene as we'd like, a few things happen:
    * The shadows may become visibly blocky, with pixelated edges.
    * Rendering artefacts (noise patterns, etc) may creep into the individual shadow pixels.
    * Light may leak through thin objects.
    * Objects may detach from their shadows.

    On a moving object, aliasing effects may occur as individual fragments in the scene move rapidly in and out of shadow due to the aforementioned lack of precision.

    In the long term, techniques such as raytracing may provide solutions to this.

    In the short term, turn up your shadow quality, and avoid overly thing surfaces. In the case of cabs where the walls are naturally thin, there are two steps that you might take:
    1. Ensure that you don't actually make them infinitely thin, or you'll require infinite shadow precision to get the desired result.
    2. Consider exaggerating the thickness where it's not going to be visible to the user but where it might benefit the shadow rendering. Where you have the option of shadow-only materials, consider using those to exaggerate the thickness.
    3. Consider where you should and shouldn't receive shadows. If some of the worst offenders are typically not heavily shadowed, then you might turn off shadow rendering on those surfaces for a net visual win.

    hth,

    chris

  7. #7
    Join Date
    Nov 2006
    Location
    Canberra, Australia
    Posts
    8,545
    Blog Entries
    30
     

    Default

    Thanks for the detailed reply Chris. I've passed it on.

    Paul


  8. #8
    Join Date
    Nov 2006
    Location
    Sweetwater, TN, USA
    Posts
    5,493
    Blog Entries
    2
     

    Default

    Quote Originally Posted by WindWalkr View Post
    ...It's not really possible to get something that looks great over long ranges but simultaneously has excellent precision at extremely small ranges. We have some room to tweak this stuff depending on the viewpoint (ie. boosting one at the expense of another when we think it's justified by the scene) but at the end of the day if we want to maintain reasonable performance then there have to be limits...
    Why is it necessary to have both in the cab view? much like a new model is loaded when you go into cab view, a new set of shadow parameters should be used. In the context of this game only, your answer may be enough, but like much like a lot of the other problems the users face, methods of dealing with these issues have been theorized, calculated, written about, and implemented elsewhere for many years.

    Trainz isn't exactly cutting-edge graphically. It has it's own set of challenges sure, but it still falls way behind that mark.

    aside from that - what is exactly with the attachment jitter? is that a precision sacrifice for supposed performance? it is distracting when your cab controls and other items are vibrating in the cab like they are loose or something.
    Last edited by norfolksouthern37; May 2nd, 2020 at 10:16 AM.

  9. #9
    Join Date
    Nov 2006
    Location
    Canberra, Australia
    Posts
    8,545
    Blog Entries
    30
     

    Default

    Quote Originally Posted by norfolksouthern37 View Post
    Why is it necessary to have both in the cab view? much like a new model is loaded when you go into cab view, a new set of shadow parameters should be used. ...
    I've been wondering the same question. Sure, the scenery outside the cab still needs to have shadows but I think you could even back off the setting for that while in cab view. But anything within the interior needs quality shadows or even fuzzy edge shadows. The saw toothed version just mars the appearance and some of the detailed cabs now appearing are amazing.

    Paul


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •