PC Tsw4 Enhancement | Lighting & Graphic Enhancement V4.7 (inc Lossless Scaling Guide)

Discussion in 'TSW General Discussion' started by JetWash, Oct 3, 2023.

  1. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Last edited: Sep 4, 2024
    • Like Like x 25
    • Helpful Helpful x 1
  2. phil.elliott

    phil.elliott Well-Known Member

    Joined:
    Aug 26, 2020
    Messages:
    475
    Likes Received:
    1,022
    Looking good!
     
    • Like Like x 1
  3. Sharon E

    Sharon E Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    1,986
    Likes Received:
    1,960
    JetWash, amazing and looking forward to this being finished and released. Thank you for all your hard work to enhance the sim.
     
    • Like Like x 1
  4. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    957
    Likes Received:
    1,725
    This looks really good. Do you know how to fix the shadows position updates according to sun position? In default TSW4 sun position is updated every 15-20s approx, resulting in shadows casted by objects not being moved continuously but in steps as well (after each sun position update). You can quickly notice the effect standing at platforms or next to trees or trackside objects and observing their shadows on ground.

    Cheers
     
    Last edited: Oct 10, 2023
    • Like Like x 2
  5. pugilist3

    pugilist3 Active Member

    Joined:
    Nov 2, 2020
    Messages:
    162
    Likes Received:
    149
    Excellent job on the lighting!
     
    • Like Like x 1
  6. OldVern

    OldVern Well-Known Member

    Joined:
    Nov 2, 2020
    Messages:
    17,922
    Likes Received:
    36,488
    Looking forward to this being available. Will it be a standalone mod or require God mode also installed?
     
    • Like Like x 2
  7. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    God Mode installed to allow the individual to tweak the skylight intensity with the slider.

    I’m having issues at the moment with the game taking a massive performance hit in DX12 around dawn as the sun comes up. The GPU usage drives up to 100% and the fps drops significantly as a result. Any other time of day, even with the most detailed shadows is fine, but sun rise is a problem for some reason. Switching back to DX11 helps but then the game becomes CPU limited again and the hitches come back with a vengeance.

    I’m still trying to work out getting a balance between improved visuals and performance
     
    • Helpful Helpful x 4
  8. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    I think I’m getting somewhere and have possibly had a bit of a breakthrough. Some more testing to do but hopefully I can get it out this week.

    In other news I’ve also got my various EP’s now loading in the sim so all being well they’ll be out sometime this week too.
     
    • Like Like x 7
  9. Fawx

    Fawx Well-Known Member

    Joined:
    Jul 2, 2023
    Messages:
    1,930
    Likes Received:
    4,422
    I can't wait, really happy to hear!
     
    • Like Like x 1
  10. seatsea

    seatsea Active Member

    Joined:
    Feb 13, 2019
    Messages:
    63
    Likes Received:
    142
    Following up from here: https://forums.dovetailgames.com/threads/enhancement-tod4-lighting-overhaul.71901/page-5#post-735147

    Yeah it's HBL, and understandable that you can't really balance both
    But I do feel that that even the new routes, ECML and Vorarlberg especially, still have difficulties with lightings at specific times of day. I can try bring up some examples for screenshots, but the main situations I've encountered is similar to those screenshots, with partial clouds.
    Some ambient lights also seem to not be as impactful as they should be, the Talent, even with full beams on seem to have very little power. Arguably an older train, but it barely lights up signs a few meters ahead.

    In short, it feels like the darkest it can get is too dark
    If that's an intentional choice, that's fair, it's seems to be a pretty subjective choice with complains of routes being to bright or dark over the years
    But if nothing else, you could maybe indicate which settings to tweak that impact the brightness in these situations?
     
    Last edited: Oct 10, 2023
  11. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Nothing I’ve done should change the intensity of train lights, or streets lights etc. The only global emissive changes I’ve made effect the TMS screens in the trains which are universally too bright and washed out.

    This is the reality of things though. Here is a shot of the default lighting in TSW4 on ECML;
    Default.jpg

    ...and here is what it looks like with my changes;
    Mine.jpg

    Now, to me one of those shots looks like 0620 on an October morning where the sun has just come up over the horizon. The other looks over-exposed and washed out. Here is another shot taken a few minutes later which I think looks pretty amazing. The cab and the environment are in harmony and look like they would for that time of day at this time of year;

    Sunrise.jpg

    I take on board what you're saying however, and since taking the above shot have increased the sun intensity a bit and reduced the auto-exposure compensation a bit too. I need to test how that works on other routes and times of day though, because it is fundamental to what I'm trying to achieve that the over bright, over-exposed nature of the lighting is changed
     
    Last edited: Oct 10, 2023
    • Like Like x 9
  12. seatsea

    seatsea Active Member

    Joined:
    Feb 13, 2019
    Messages:
    63
    Likes Received:
    142
    I entirely agree, in your example the brightness overall feels more appropriate on most of the scene, with the exception of the of the ground which looks a tad dark. And in in general, it's places that would be lit with indirect lighting that seem a bit dark.
    Maybe some tweaking with the ambient occlusion? I'm not familiar with how much TSW would let you tweak this aspect.

    Here's a night time example at Bregenz Hafen on october 10.
    upload_2023-10-10_17-49-34.png upload_2023-10-10_17-49-59.png
    This one case where the headlights feel about appropriate in what they illuminate, maybe a tad dim, but I'm not familar with the talent.
    However, the static station lights is what stands out to me, the track is almost impossible to see, even with the headlights on.

    Admittedly, there are a few spots where the lighting is just to dark to begin with, like next to the station building, the dark spot in the middle. I can understand you can't do much to fix DTGs lighting there.

    Reference without the ini
    upload_2023-10-10_18-9-9.png
    upload_2023-10-10_18-9-25.png
    Without headlights on
    upload_2023-10-10_18-11-43.png

    I guess one other factor of note for people's experience, is their monitor settings, especially relating to contrast. I'm using monitors "Display P3" Clamping setting so while it's no professional colour accurate screen it's likely the best effort I can get out of it.

    I'd recommend other people using ini tweaks like this to check to check if you have an sRGB or Display P3 preset on your screens to try get the most colour accuracy out of your monitor.
     
    • Like Like x 1
  13. seatsea

    seatsea Active Member

    Joined:
    Feb 13, 2019
    Messages:
    63
    Likes Received:
    142
    With the Medium ini back on,
    A quick poke with the photo mode roughly gets a result I like
    upload_2023-10-10_18-34-12.png
    The exposure makes things washed out too quickly, especially noticeable with the sky, but nudging the brightness up seems to help the general ambient lighting a little.
    This seems to also have a positive impact in a few daytime settings too.
     
  14. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Do you use HDR?
     
  15. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    957
    Likes Received:
    1,725
    This is expected to happen when sun light is quite parallel to ground. Basically shadows casting at that time mean longer shadows, therefore more potential interaction of shadows with larger terrain areas and distant objects too. At other times of the day shadows are much shorter and shadows of one object are normally casted on nearby objects only, before they are culled. In addition to this smaller objects (controlled by r.Shadow.RadiusThreshold --> the lower, the smaller the objects can be to cast shadows) have higher possibilities to interact with terrain and other distant objects as well to cast their shadows, which won´t happen at 12am for instance as their shadows are going to be smaller or simply won´t be casted due to culling.

    On the other hand you are using a 6144 resolution for shadows and cascaded shadows textures, for high-end systems config at least. You should consider to start by reducing shadows resolutions to 4096. That will release a lot of workload on the foreground, where more details are expected to appear on objects, and therefore more detailed shadows will be reproduced too (detailed objects also cast detailed shadows). The other option you have is to reduce viewdistance and keep high resolution shadows but the two of them combined and including shadows rendering at long distances (due to sun position) can be a real problem even for high end systems, in particular on dense scenery areas with lots of trees, houses and misc objects.

    Unreal was never optimized for too big open world scenarios. That´s it in short. It´s fine to render something detailed inside a building or to display terrain 1km ahead but not for a very detailed area of several km in all directions. That´s why it comes with such a huge amount of performance workarounds variables instead of a native built-in solution. Even people using Unreal 5 have the same problem with sunrise shadows performance, as you can find on the official forums.

    Cheers
     
    Last edited: Oct 10, 2023
    • Like Like x 1
    • Helpful Helpful x 1
  16. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Thanks, I got it sorted this afternoon. The culprit was the CSM shadows in their entirety, but particularly the resolution at that very specific time of day. At all other times of day it was absolutely fine and ironically the performance hit was coming before the shadows actually appeared. That was why it was so confusing & tricky to figure out but a bit of tweaking seems to have solved the problem. It was compounded by the fact that the intensity of the performance hit varied from route to route with the same time of day and same weather.

    I now know what will be the new ‘Ultra’ preset works nicely on a 3080ti and a 3090. I’m going to have to guess at a suitable step up for a the 4080 + 4090.

    I’m intentionally pushing the limits on the higher settings because I believe the stock Ultra is nothing like. It looks more like Medium level settings to me but sadly DTG are showing zero inclination to even look at this side of the game.

    ps Another factor I forgot to mention is I’ve gone back to DX12 as it’s a far smoother experience. Without DLSS the extra load it puts on the GPU really makes a difference versus DX11. Switching back to DX11 sees GPU overhead return but the hitching return with a vengeance. I’ve said it before and will keep saying it, this game desperately needs DX12 to be the default API with DLSS/FSR implementation alongside it.
     
    Last edited: Oct 10, 2023
  17. seatsea

    seatsea Active Member

    Joined:
    Feb 13, 2019
    Messages:
    63
    Likes Received:
    142
    Not using HDR.
    Though, my screen is technically HDR capable, but it's peak brightness is only about 380nits so it's really all that worth it anyway
    I know that I won't actually get Display P3 colour space without HDR, but it at least makes sure the monitors colour settings are hopefully sane.
     
    Last edited: Oct 10, 2023
    • Helpful Helpful x 1
  18. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Assuming this is the correct service (I think it is) this is what I see with the latest, unreleased, version of the ini (headlights on). I've got to be honest, particularly in-game it looks as I’d expect it to (remember some detail & nuance is lost in shrinking the image below 5mb). Are you sure you don't have anything else that could be interfering with your game (such as reshade etc)? If the lights are too dim (which they may well be) then the emissive value probably needs increasing but since mods of that nature don’t work there’s nothing can be done about it for now.

    Clear Sky
    Clear Sky.jpg

    Overcast Sky
    Overcast.jpg

    Clear Skies with light Mist
    Mist.jpg
     
    Last edited: Oct 10, 2023
  19. seatsea

    seatsea Active Member

    Joined:
    Feb 13, 2019
    Messages:
    63
    Likes Received:
    142
    Yeah it's service S1 5681 20:09
    No reshade installed, and nothing I can think of that should have an impact on colours
    The first two screenshots still look dark in spots for me, so I've done some digging into my monitor settings and I'm starting to thing there's something odd with my setup

    Turning HDR on does seem to push the visibility of the darkest areas up a bit (even though it's SDR content)
    So I checked the other presets, and some do help, mainly by turning on "night vision" which boosts the brightness of the darkest colours a bit and which is technically a hack.
    The monitor is a MAG274QRF, from reviews, a decent IPS monitor. I don't think it has any particular problems with dark spots.

    Sounds like by this point we're starting to have different experiences due to monitor differences and colour calibration. I'll do some more investigating on my side in case I've got some issue with colour profiles or something.
     
    • Like Like x 1
  20. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Great, thanks for your input. I’m happy to send you the ‘new’ version to try out if you wish to see if that makes any difference?
     
  21. Train Sim Society

    Train Sim Society Well-Known Member

    Joined:
    Aug 22, 2021
    Messages:
    436
    Likes Received:
    788
    I've noticed myself having this sunrise/sunset frame drop with your high & ultra in presets that are currently up on TSWC. I get a solid 45-50 fps any other time of day, but during sunrise/sunset, I'm down to 10-15 at times. I've found removing anything related to the volumetric clouds helps this tremendously.

    I do wanna say, these look absolutely amazing. phenomenal work!

    i9 9900k @4.5ghz OC
    64gb ddr4 @ 3600mhz
    rtx 2070 8gb
    1tb m.2 ssd
     
  22. seatsea

    seatsea Active Member

    Joined:
    Feb 13, 2019
    Messages:
    63
    Likes Received:
    142
    Sure thing! I'm happy to test it out
    I've also forwarded the screenshots to a friend just to get an external opinion, and they seem to agree with me that your tweaks make it a bit too dark.
    I know it all comes down to subjective preferences, but maybe your monitor pushes up dark values up a bit more than mine does?
     
  23. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    957
    Likes Received:
    1,725
    I think the performance problem with sunrise may be related to the way shadows are computed. In Unreal there are several shadows areas, with their own parameters and computed separately, so to speak.

    1. High detail shadows (closest to player, with fixed resolution). Relevant variables:
    • r.Shadow.MaxResolution
    • r.Shadow.DistanceScale
    • r.Shadow.TransitionScale
    • r.Shadow.RadiusThreshold
    2. Cascaded shadows (mid range, starting with cascaded shadows resolution and cascaded N times to lower that resolution over distance). Relevant variables:
    • r.Shadow.MaxCSMResolution
    • r.Shadow.CSM.TransitionScale
    • r.Shadow.CSM.MaxCascades
    • r.Shadow.CSMShadowDistanceFadeoutMultiplier
    • r.Shadow.CSMDepthBias
    3. Distant field shadows (long range, with fixed resolution --> only static meshes and some terrain elevations cast shadows). Relevant variables:
    • r.DFFullResolution
    • r.DFDistanceScale
    • r.DFFarTransitionScale
    On the other hand there´s the possibility to let all terrain elevations cast shadows as well. However this feature is broken and it´s disabled in game default settings. Activating it sometimes results in big areas suddenly turning dark upon new tile loading. I suggest not to use it for the time being. Relevant variables:
    • r.HeightFieldShadowing
    • r.AOHeightfieldOcclusion
    • r.HFShadowQuality
    In the following picture, taken at Chemical plant sidings in Riesa route, we can see the problem: the cascaded shadows outter limit (the famous r.Shadow.DistanceScale=2 limit, marked in green) is clearly seen. Beyond that there´s a sharp transition to lighten terrain. However distant field shadows cover the whole area from there up to r.viewdistancescale limit. You can see another dark area close to the houses on the left side, caused by houses and the trees, due to the low angle of the sun. However the portion where the train is located is completely dark.

    upload_2023-10-11_3-55-19.png

    The picture above was taken using the following config:

    r.ViewDistanceScale=4
    r.SkeletalMeshLODBias=-3
    r.StaticMeshLODDistanceScale=0.1
    r.HLOD.DistanceOverrideScale=8
    foliage.LODDistanceScale=8
    grass.densityScale=2
    r.DFFullResolution=0
    r.DFDistanceScale=8
    r.DFFarTransitionScale=0.1
    r.Shadow.MaxResolution=8192
    r.Shadow.DistanceScale=2
    r.Shadow.TransitionScale=2
    r.Shadow.RadiusThreshold=0.005
    r.Shadow.MaxCSMResolution=8192
    r.Shadow.CSM.TransitionScale=2
    r.Shadow.CSMShadowDistanceFadeoutMultiplier=0.1
    r.LightMaxDrawDistanceScale=10
    r.MinScreenRadiusForLights=0.001

    The problem is the way shadows from directional lights (the sun in this case) are calculated. The foreground (where camera is placed) seems to need more sun elevation to render the light on terrain, while the background (where sun is rising) gets that rendering effect earlier. As time passes by the whole terrain between sun and camera (player) will get light almost seemlessly, but camera area will always get a darker light. This darkness can be partially tuned with r.Shadow.CSMDepthBias (higher values will make cascaded shadows area less dark), allowing to have a less noticeable border (area marked in green) but also less darker casted shadows as well, which you don´t want to happen.

    Additionally, in order to have a proper transition between distant field shadows and cascaded shadows you need to set shadows and cascaded shadows resolutions to 8192. That´s because the distant field shadows low resolution (r.DFFullResolution=0) is still too high for the closer objects, and it can result in distant field objects shadows closer to player having more definition than the last visible cascaded shadow in the cascaded shadows outter limit.

    With the config above I see the same fps figure than in the morning (with same weather conditions): 80 fps outside and in cabview. Reducing shadows resolution to 4096 and reducing distant field shadows distance results in worse tile loading hitching and basically the same fps figure. The next picture is taken some time later in the morning and the formerly green marked area is less noticeable, with foreground now receiving the correct sun light as well as background.

    upload_2023-10-11_4-38-11.png

    However there´s still an issue at the transition between distant field and cascaded shadows, (marked in blue in the picture). The tree casts a long shadow that extends to the two areas (distant field and cascaded) and both areas shadows for the same object are not overlapping correctly because there´s an area without shadows in between (the cascaded fade out area). That can be partially solved by using a very short fading area on cascades or even disabling fading but then regular cascades on other objects will present a too sharp contour. This situation still represents the limit between the two shadows areas, as we shaw in the first picture. The limit can be also seen on the bushes group to the left of the train, as you will notice that distant field shadows are not generated there, so only the foreground has shadows (cascaded) on those bushes.

    Once more, forcing high detail shadows and high viewdistance+details, allows us to balance the shadows resolution in the transitions between shadows areas, resulting in less performance impact than having lower shadows resolution with multiple quality reductions and using the native performance improvements.

    Basically most of the performance workarounds existing in Unreal are somehow broken or result in worse performance than directly maxing out quality. They overload the threads with hundreds of texture resolution changes and LODs transitions in very short distance intervals caused by the high population of objects. Unreal is clearly not meant for big open world scenes, unless it´s properly configured, and even in that case it still has the tile loading constraint, that dumps a ton of extra workload and yet more textures and LOD transitions in a very short time interval.

    Cheers
     
    Last edited: Oct 11, 2023
    • Helpful Helpful x 7
    • Like Like x 2
  24. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Ultra (definitely), and High (very likely) would be too much for a 2070. When I’ve finished putting together the ‘new’ version I’ll include guidance on which preset I think will be appropriate for which generation of cards.

    Essentially ‘Beyond Ultra’ is designed for higher end 40series cards, ‘Ultra’ for the 3080ti and above, ‘High’ for 2080ti and above and ‘Medium’ for mid 20series cards. ‘Low’ would be bottom end 20series cards and maybe the 1080ti and ‘Very Low’ for cards below that. Again, if you’re happy to test it on your 2070 for me it will help better tune those parameters.

    At the minute I’m trying to nail down Ultra which is about 80% complete. Once that’s done I’ll put together the rest of the presets.
     
    • Helpful Helpful x 1
  25. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    And this is what we’re up against. Anyone that reads these forums will know I’ve been banging on about the lighting in this game for years. I was extremely annoyed when DTG claimed that they had ‘ripped up lighting and started again’ for TSW3 when all we got was more of the same old nonsense. It was immediately obvious from the screenshots that TOD4 was much better than what came before, but all the problems that plagued the game previously were still there, and more obvious than ever because of the new brightness levels. TOD4 brought problems of its own due to the way DTG have implemented it, and all too often the game is too bright, too exposed and things that shouldn’t be lit are. I’m trying to use less emotive language in my posts but in this case, frankly, it’s a mess.

    We can’t perform miracles. All of this is a giant balancing act to try and paper over the cracks of issues with the engine but more likely DTG’s incorrect implementation of the available features. I’ve said on another post that there is zero consistency from one loco to another on the same route, but then from route to route it differs again. Take a look at the headlights on the Talent and Vectron on Voralberg, they are all over the place. The Vectron is almost unplayable in fog with the lights on. Some TMS screens are ridiculously bright (395, 385, 800 and so on) and some are too dark. Some PIS is unreadable because it is too dark, some unreadable because it is too bright. On the Class 801 DTG have used the same emissive shader for the PIS and the TMS screens, and a single value controls them both. Inevitably, for the PIS to be bright enough to be visible on a sunny day with sun actually shining on it the screens in the cab are way way too bright. There is no compensation for night time, so at night the screens are so bright they are impossible to read. So you turn down the emissive brightness to a manageable level so you can read the screens and boom, the PIS all but disappears. The fun thing of course, is that not only are you changing the emissive brightness on the Class 801, you are changing it for every loco/unit in the game, and because every unit/loco in the game has been set up differently nailing down a good setting is like trying to nail spaghetti to a wall.

    People need to understand that what I’m trying to do here is make things better, but I can’t change things I can’t change. DTG need to get their **** together and sort this out themselves. Until they do all any of us can do is make the best we can with the tools available. That will involve a degree of compromise and the way I see it is this;

    - Which is more important? Cab screens or external PIS? Cab screens win for me
    - Overall scene lighting or in specific conditions elements of the track appear darker than is ideal? Overall scene lighting wins.

    It is a compromise. I’m trying to fine tune the compromise but the important thing to know is that there will always be a compromise until DTG address this. Given they’ve not touched it at all since releasing TSW3, and given that any changes will likely only affect routes going forward, I wouldn’t hold my breath that anything official will happen any time soon.
     
    Last edited: Oct 11, 2023
    • Like Like x 6
  26. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    geloxo

    I should add that I don’t claim to be an oracle on this. I really appreciate your input and all the work you’ve put in to this particular problem in the past. I see it as a bit of a collaborative effort to get this the best it can be, and many of your posts explaining the vagaries of the way UE4 works have been invaluable, so thanks.
     
    • Like Like x 4
  27. seatsea

    seatsea Active Member

    Joined:
    Feb 13, 2019
    Messages:
    63
    Likes Received:
    142
    I do genuinely appreciate the work and effort you and others have put in to try make the best of what we have.
    All my remarks are with the knowledge that TSW is a fundamentally too variable game to get a consistently good preset for visuals across the board. Even if DTG wanted to put more work into it, I imagine it's tricky just down to the nature of the beast, hundreds of km of routes, and virtually unlimited combos of daylight and weather settings.

    But that's why I'm mainly just brining up the darkness aspect and not any of the PIS/cab indicator lights. Because across various situations, on old or new routes the darkness can get to the point at times where it's hard for me to make out much at all in the near environment. And at least personally, I'm willing to compromise a little bit on the visuals for that.
     
  28. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    957
    Likes Received:
    1,725
    This is my opinion as well. That's why I shared it in your post because you are working in those particular modifications. Whoever brings the solution to the problems, either devs or users, is not relevant for me. We all will benefit from having a better game.

    Cheers
     
    • Like Like x 5
  29. countcussy

    countcussy Well-Known Member

    Joined:
    Mar 4, 2022
    Messages:
    366
    Likes Received:
    642
    In relation to the all of the above, it's a huge balancing act, especially when you take into account monitor settings, make, model etc.
    From personal experience, the Game looks completely different on my Dell ultrasharp, compared to my newer Benq display.
    You could argue that they could be made similar by messing with monitor settings etc, but most people leave as is.

    With this in mind, any one messing with ini`s is more than likely to be using GOD mode as well.
    Given that GOD mode provides some form of Dynamic ini on a route by route basis, could this be a workaround?
    I can't find any documentation on how to use it properly, but being able to load a route and GOD mode activating the preferred settings for that route, would seem to be an ideal solution?

    Just a thought.
     
    • Like Like x 1
  30. Spikee1975

    Spikee1975 Guest

    VirtualRailroads (Maik Goltz) offered a good solution for the headlight intensity issue on TSC, which, as ToD3, uses a standard low dynamic range lighting system. A simple key combo enabled you to seamlessly dim the headlight intensity.
     
  31. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    I’m going to suggest this as an option as part of version 3. It’s exceptionally easy to do and means that you could effectively have separate setups for TOD4 and pre-TOD4 DLC.

    Again though, none of this is a magic bullet and there is still going to be a huge compromise to be had.
     
  32. countcussy

    countcussy Well-Known Member

    Joined:
    Mar 4, 2022
    Messages:
    366
    Likes Received:
    642
    This would be great. I have tried using the dynamic ini settings, but quickly ran out of talent.
    I still play a lot of the older UK stuff, and generally, it holds up really well.
    We all know that Ideally this would not be needed, but clearly there is no "Standard" for loco lighting etc. for anyone to adhere to, and what looks right to one person looks off to someone else.
    I tend to be less fussed about the cab, as I generally drive with the external Camera, but I appreciate its vital to some.
    Some compromise will always be necessary to help a larger group of users.

    The fact is, thanks to your hard work, we are getting to the point where we have options.

    Personal time permitting, if you need anything testing, give me a shout.
    System is I5-12400, 16gb, 3060ti, 2K monitor.
     
  33. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    I’ll take you up on that offer. I’ll be in touch :)
     
    • Like Like x 1
  34. jensens

    jensens Member

    Joined:
    Mar 30, 2023
    Messages:
    19
    Likes Received:
    30
    JetWash
    with my 3070 @3k i tend to try your "High" setting this evening.
    I'm using -DX12 and the Nvidia Image Scaling (3K monitor, TSW res 1 below). Do you still recommend the Nvidia resolution scaling?
     
  35. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    In so far as it takes the load off your GPU a bit for virtually zero quality loss and allows you to have better graphics as a result. It’s no DLSS, but it’s better than the in-game scaling and given DX12 uses more GPU computational resource it’s daft not to use it really. There is no getting round the fact that the game is magnitudes smoother in DX12 than it is in DX11.

    If you can run your chosen settings at your chosen resolution without it then great, but if you need a bit more GPU headroom then you have the option with NIS.

    I still use it at 85% on my 4K monitor and there is genuinely no difference that I can see in the image quality.
     
    • Like Like x 1
  36. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    957
    Likes Received:
    1,725
    Hi, I have an important update. I did some tests today and the performance drop at sunrise/sunset is clearly caused by the cascaded shadows, not by distant field shadows (as I initially thought) nor by the shadows in close proximity to player. In particular it´s caused the amount of cascades in the cascaded area (r.Shadow.CSM.MaxCascades).

    Performance drop is massive! In my system (12900ks + Nvidia 4090) I can go from a max 80fps down to 30fps at the same world position just by this performance degradation. Results may be anyway different on other systems but there´s a clear and severe performance hit here. My test results are below. Tests were done on 12th Jun at 4:00 am at Dresden station, to combine a dense area with sunrise event. I did each variable change individually and reverted it back to its initial value before jumping to next change to test their impact separatelly:
    • I started using high resolution shadows and cascaded shadows (both with 8192 resolution) with r.viedistancescale=4
    • Reducing viewdistance to 1 still gives the same low performance figure
    • Reducing overall shadows quality to 1 still gives the low performance figure
    • Disabling shadows completely removes the performance drop and gives max fps again --> shadows are clearly the reason
    • Disabling distant field shadows still gives the low performance figure
    • Disabling cascaded shadows removes the performance drop and gives max fps again --> cascaded shadows are clearly the reason
    • Reducing amount of cascades from default Shadow.CSM.MaxCascades=10 to a value of 3 doubles performance (30 fps to 60fps) --> amount of cascades is clearly the reason
    • Reducing amount of cascades to 0 (disabling cascades completely) gives max fps again --> amount of cascades confirmed to be the real reason
    • Reducing cascaded shadows resolution to 4096 but still using 4 or more cascades still gives the original low performance figure
    • Reducing cascaded shadows resolution to 4096 but using 3 cascades doubles performance too (30 fps to 60 fps again)
    • Reducing cascaded shadows resolution to 2048 and using the default 10 cascades amount gives max fps as well
    Conclusion: no matter the other settings you have. Whenever you use cascaded shadows with r.Shadow.CSM.MaxCascades=4 (or higher) and r.Shadow.MaxCSMResolution=4096 (or higher) you can lose 50fps! Only if you reduce amount of cascades to 3 (.Shadow.CSM.MaxCascades=3) or you reduce cascaded shadows resolution to 2048 (r.Shadow.MaxCSMResolution=2048) you will see no performance impact on sunrise/sunset.

    For the time being I think we have to consider using r.Shadow.CSM.MaxCascades=3 (or lower). However this brings some shadows quality reduction in the cascaded shadows area, even when using 8192 resolution shadows. If someone finds any other setting that can remove the insane performance bottleneck please share it.

    Cheers
     
    Last edited: Oct 13, 2023
    • Like Like x 6
    • Helpful Helpful x 1
  37. Thorgred

    Thorgred Well-Known Member

    Joined:
    Jun 8, 2018
    Messages:
    658
    Likes Received:
    320
    nice read Geloxy
    i had r.Shadow.CSM.MaxCascades at 5
    will see how much it differs setting it on 3
     
  38. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    That corroborates exactly what I had found. The performance impact of cascaded shadows at certain times of day is off the scale and completely disproportionate. To me at least it makes no real sense, because I find the hit comes before you actually start to see shadows. I wonder if this is a UE4 issue or a TSW issue? To get acceptable performance the shadows you see in the cab are so blurred they’re borderline indistinguishable, and when you put them alongside the shadows in TSC (which is an ancient DX9 game don’t forget) they look terrible. It’s become apparent that I can’t set the shadows to look like they do in the video for example, because at sunrise the game slows to an absolute crawl. I saw less than 15fps at one point on ECML which is obviously not acceptable, and the whole point of ‘presets’ is it gives people who just want to fire and forget something reliable.

    I had assumed, incorrectly, that the 4090 would be able to cope with an increased resolution in this respect, so it’s very interesting you’re seeing the same problem. That will inform what I put in the ‘Beyond Ultra’ preset, which is intended only for 4080’s and above. I had settled on a resolution 2048 for the Ultra setting and with NIS enabled at 85% am able to run the most demanding combination of time of day, weather etc and maintain 60fps. I had set the Beyond Ultra setting to 4096, but are you (geloxo) saying that’s too much to be consistent? If so would you mind trying 3072 for me and see how that works?

    I’m happy with it as it is now but off the back of your test I will at least look at what cascades of 3 and a higher resolution looks like. I believe the Nvidia PCS filter helps the blurred and shimmering Cascade shadows at lower resolution but every time I use it I find it to be horribly pixilated. I’m wondering if setting a higher resolution, Cascades of 3 and Nvidia PCS filtering On will give a satisfactory result?
     
    Last edited: Oct 13, 2023
  39. Winzarten

    Winzarten Well-Known Member

    Joined:
    Jun 27, 2020
    Messages:
    461
    Likes Received:
    909
    I can easily see this to be a combination of both. UE4 is a very complex engine and it takes quite time to learn its quirks and features so you can get the maximum performance. Thanks to the free editor more people are actually, finally, starting to realize this.
    It is also true that the quality can be all over the place when it comes to thing like in-cab instrument lights and other lights intensity.

    But things like, having to rebase the world center in larger maps in UE4, make it obvious that large open worlds are not the typical usecase for UE4.

    Also people tend to underestimate how hard of a scenario TSW presents to a game engine. It's more of an outlier scenario, and no off the shelf game engine is perfectly fit for it. You have very large maps, where DTG has very little options to artifically cull the scene by some artificial hill, or large building, and you want the scene to look good in any light and weather condition on any day of year.
    When I had a closer look on other UE4 games that offer some of the freedoms, ACC i.e., I quickly found some of the issues TSW has to be also present there.

    What's more, DTG needs a streamlined, fast process for new map creation. They cannot spent a year finetuning every aspect of the openworld map for maximum balance between performance and lighting quality.
     
  40. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Further testing has shown the following;
    • Dropping the number of Shadow Cascades from 4 to 3 and upping the resolution makes no perceptible difference to the quality of the cascaded shadows
    • Leaving the resolutions as I’d set them but dropping the number of cascades from 4 to 3 buys a huge amount of GPU headroom for no perceptible loss in quality, so much so that in that in most demanding scenario (autumn sunrise) I can now run the game in native 4K and see only 80-90% GPU usage. With NIS enabled at 85% that drops to ~60%
    • If the default shadow cascades are set to 10 as geloxo says, I see zero difference between that and a setting of 4 in terms of visual quality. Setting that to 3 does remove an element of the cascaded shadows but unless you knew there was a difference you wouldn’t actually notice it. The performance gain seems, on the face of it, to be quite sizeable and that difference becomes more pronounced in demanding situations
    As a result I’m tempted to leave the shadow resolutions as they are but drop the number of cascades to 3. For the performance benefit vs the imperceptible loss in visual quality that it brings it gives more GPU breathing room that can be used on clouds and draw distance, particularly tree pop-in.
     
    Last edited: Oct 13, 2023
    • Like Like x 2
  41. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    957
    Likes Received:
    1,725
    Don´t worry too much about the shadows resolution. You can´t go above 8192 (max resolution value anyway) but indeed using such high value results in too dark foreground on the cascades area as soon as you have lots of trees or buildings next to tracks. I have used 4096 for years, even on my former 3080Ti and that value is fine for performance. The only reason why I moved to 8192 some days ago was as workaround to solve the the difference in sharpness at the cascaded outter limit to distant field inner limit border. This is apparently caused by distant field shadows using a default too high shadow resolution (you can´t go lower than 0 as the variable has only 0 and 1 as values) as I posted before. On the other hand many objects are still simply broken in several routes. For instance many trees and bushes, even next to tracks, don´t have distant field shadows. And they appear completely bright until they enter the dynamic shadows area (close proximity to player) as you can see in the next picture, where trees on the sides and in the far distance cast shadows but the ones in the center of screen not.

    upload_2023-10-13_14-18-17.png

    On the other hand I think number of cascades are more relevant for less resolution shadows as the quality loss in the first meters of the cascaded area is notorious in this case. They are also relevant for the objects close to the outter limit of cascades area, as the ones closer to player will still have high shadows resolution. Anyway the radius of the cascaded area is still limited by r.Shadow.DistanceScale=2 max value and that gives an effective area of around 200 meters only away from player for dynamic shadows to be casted and for cascaded shadows to reduce shadows resolution over distance. This is simply too short to notice real relevant differences for most players. Even the rear of the train can be out of the cascaded area in most cases. During sunrise for instance the distance field shadows of a single tree can be longer that those 200m and trees would therefore most likely cover the areas next to tracks with their own distant field shadows much earlier than they enter into the dynamic shadows area (those 200m away from player). On the other hand one of the benefits of a low amount of cascades is that it helps to reduce the moving shadows effect on the tracks ahead of player, making them a bit more diffuse and less noticeable, so it still brings a small benefit.

    So shadows themselves are not so demanding for a high end system unless you combine them with other excessive graphical setting because the effective view distance in game is limited to a few km in most cases (trees, trains, tracks and buildings). So for instance r.viewdistancescale=4 are the true maximum value to see something new and big enough to notice it on the tracks area. Higher values are still possible and they help to control the terrain quality inside that few km area for instance. The setting which is relevant even on high end systems is foliage.LODDistanceScale. Values above 5 will start to kill performance due to draw distance as well as due to their shadows. Indeed foliage.LODDistanceScale=6 or above can result in a huge performance drop similar to the one caused by cascaded shadows. Forcing LOD0 on trees (foliage.ForceLOD=0) is an alternative setting some players use but it´s therefore a no-go if you are pretending to use long view distances as it can ruin performance.

    Nvidia PCS will make shadows more diffuse in the mid range. I didn´t use it in the past because it created a Moire effect inside tunnels. I don´t know if that´s still the case. But it helps to have a more natural high resolution shadows (with not so sharp edges). Using it or not basically depends on player´s preferences.

    In my opinion 4096 shadows are the best solution in most cases. Quality is good, performance is also good and shadows still look natural. If you propose 8192 or something in between those values for high-end systems remember to pair it with 3 cascades only and make a note about foliage.LODDistanceScale impact. That will be still fine for Nvidia 40xx series (they can provide very high fps even on dense areas with max settings in game). I imagine that will be also the case for new AMD and Intel cards too. I mean, I can get 80fps at Dresden and other dense stations with foliage.LODDistanceScale=5 and r.viewdistancescale=3 which is a really good figure but I will still go as low as 45fps on sunrise even with 3 cascades. I need to reduce cascades to 2 to fully recover high fps figures on sunset.

    Cheers
     
    Last edited: Oct 13, 2023
    • Like Like x 1
  42. Spikee1975

    Spikee1975 Guest

    I've noticed that using DX12 can cause texture flashing in some places. (That's most likely the reason DTG have not made DX12 the standard)

    Found a good service to reproduce:

    Nahverkehr Dresden
    BR 442
    RE50 Dresden Hbf - Leipzig Hbf 08:14
    Weather: Custom, Clear.
    Date: October 12th

    See what's happening when you leave the station, this does not happen on DX11. (Ground flashing black polygons). Just start the service and fly around using 8 cam.

    I cannot capture that in a screenshot, but this area is specifically affected:
    1.png
     
    Last edited by a moderator: Oct 13, 2023
  43. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    957
    Likes Received:
    1,725
    I would say DirectX shaders compiler (r.D3D.ForceDXC=1), not default compiler, is what you would like to use in game with DX12 to prevent such issues. I will propose it in my settings as soon as I finish my tests because indeed it also helps to improve performance as it generates shaders that are only compatible with DX12. On the other hand heighfield shadows (terrian elevation shadows) can also generate flickering artifacts in game, in particular in the outter limits of tiles. Indeed that feature is disabled in default settings. Check that you don´t use r.HeightFieldShadowing=1 in you ini or any heighfield ambient oclussion r.AOHeightfieldOcclusion=1. Both variables should be 0 (disabled).

    Cheers
     
    Last edited: Oct 13, 2023
  44. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Have you tried it in DX11 too? Can’t say it’s something I’ve seen other than it being to do with lower in-game settings.
     
  45. Spikee1975

    Spikee1975 Guest

    Yes, as I wrote it doesn't happen under DX11. Same settings, vanilla Ultra.
     
  46. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    My bad, didn’t see that. Default ini?
     
  47. Spikee1975

    Spikee1975 Guest

    Yes. For direct comparison.
     
    • Like Like x 1
  48. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    I’ll take a look :)
     
    • Like Like x 1
  49. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    Just been having a look across other routes and I’m now of the mindset that the best solution for a trade off between performance and visual quality for a 3090 level card is a CSM resolution of 2048 but to set the number of cascades to a higher number, 8-10. With cascades at 3 the shimmering on the shadows in the cab is horrible, even with a resolution of 8192.

    The resolution definitely seems to be the thing that makes the most difference sadly. I’m making presets that need to fit everything, so have to tune it to the toughest, most demanding case. Right now, by some margin that’s the 801/2 service 1Y03 Newcastle to Kings X departing at approx 06:20. In GodMode set the Cloudiness slider so it’s under the white - between DD and HH and then set the fog intensity to 0.009. Unless tuned correctly this will quickly bring most systems to their knees, particularly from the approach to Newark to well past Grantham, it’s absolutely brutal. Get it right though and it looks stunning.
     
    Last edited: Oct 13, 2023
    • Like Like x 1
  50. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    3,120
    Likes Received:
    11,661
    This is that service. CSM shadow resolution only set to 2048 and cascades to 10

     
    • Like Like x 6

Share This Page