1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.36 Bug Reporting thread
    Solutions and more information may already be available.

The "reason" (not sure) why shadows are (often) performance killers.

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by PlayKoyote24, Apr 3, 2019.

  1. PlayKoyote24

    PlayKoyote24
    Expand Collapse

    Joined:
    Jul 27, 2018
    Messages:
    84
    I noticed often (especially in the past when new maps came out and i had an rx560, )that enablng shadows on for example the west coast usa map (it has gotten better) basically locked me to 22-24fps on th 560, no matter what settings.
    And whilst the issue has become less of a problem as i have a better gpu now and BeamNG.drive gets updates, sometimes it still occurs on some map.
    So here is a really, really bad video i made with my phone to send a friend on whatsapp, but now just show it here:
    So, as you can se: i only have 22fps with shadows, but also the gpu usage is just 22%.
    If i turn them of, i get 40 (after few seconds more) and the gpu usage goes to 73%
    Witch obviously makes no sense.

    I used an AMD Radeon RX480 8GB
     

    Attached Files:

  2. krallopian

    krallopian
    Expand Collapse
    NC114-85EKLS
    BeamNG Team

    Joined:
    Dec 5, 2013
    Messages:
    984
    It is cpu hungry not very gpu hungry. When you turn them off the cpu can send more to the gpu so it works harder =)
     
    • Agree Agree x 1
  3. PlayKoyote24

    PlayKoyote24
    Expand Collapse

    Joined:
    Jul 27, 2018
    Messages:
    84
    Well, but the cpu usage (according to task manager) also doesn't increase and sits around 60% with or without shadows
     
  4. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    2,286
    Didn't we also find out that shadows increase polycount? I remember that, but not sure.
     
  5. krallopian

    krallopian
    Expand Collapse
    NC114-85EKLS
    BeamNG Team

    Joined:
    Dec 5, 2013
    Messages:
    984
    Yeah the way the shadows are calculated real time means you need to calculate polys that are not in view, in order to generate shadows.

    I attached a picture showing why polys increase with shadows. In order to properly show shadows when you are facing away from a light source, they need to be calculated from behind you so the shadows don't just disappear when you turn away from the objects casting them.

    The picture shows a light source behind the player, hitting polygons that are located behind the player, and casting a shadow into the view of the player. This adds extra polys, drawcalls, cpu/gpu time.
     

    Attached Files:

    • extraPolys.jpg
    • Informative Informative x 1
  6. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,774
    Task manager is just absolutely rubbish.

    Your CPU has multiple cores, what you are seeing is how all cores are working, while graphics, shadows etc. is processed by 1 core mostly, then passed to GPU, which has to wait especially with slower AMD CPUs a lot.

    My CPU can be maxed out at 23% CPU load according to task manager, that is when one core is working 100%.

    With fastest core speed it is about 8 threads that is plenty for the game, more threads is not helping in keeping constant 60fps from my experience, but how much one core of your CPU is working matters a lot, you will need fastest possible and then overclock it, even then there is not much difference between 12 and 8 threads, so right now only thing that matters is how fast is your one core speed.

    So, to make things even more difficult to understand, your one core can max out even task manager shows it being 65%, reason is that task manager is way too slow, you get several load spikes in 100ms and as you get those something else (GPU etc.) waits or runs from data that is buffered, enough of those spikes and fps falls down and GPU utilization drops under 100%.

    I have made my own tools which record those spikes and show them, that shows it quite well how GPU utilization starts to drop after certain amount of spikes and task manager still lies horribly about 80% or 65% or whatever.

    If your FPS drops and GPU utilization drops, it is your CPU not enough fast to keep up, adding more cores is not going to help, only thing that helps is more work per time unit.

    7700K overclocked is about fastest you can have if goal is to keep 60fps on full graphics, 8th gen and 9th gen intel are not much better, more cores is no use, at least right now, AMD is going to be slower, there is no around that fact.

    8 threads is for running more cars while keeping 60fps, with single car, game should run fine with quite weak CPUs, but some graphics are tough to run.

    Well, maybe next AMD coming soon will be able to go beyond that, if single core is enough fast, then it might use more vehicles, that is different vehicles, use single same vehicle and those don't become such limiting factor.

    Anyway enable advanced functions and use this ingame performance tool to see what is taking most time to compute, it has gotten lot better and probably in future more optimizations help even further, but clock speed race is far from over, it will take years until all thousands of programs currently running on single core are using full processor power, threading is not so simple thing to do:
    upload_2019-4-7_22-21-36.png
     
  7. PlayKoyote24

    PlayKoyote24
    Expand Collapse

    Joined:
    Jul 27, 2018
    Messages:
    84
    Okay i will take a look with the ingame tool.
    Btw currently it happens only at the Nordschleife (Mod) which is a bit sketchy in general.
     
  8. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,774
    Turn shadows off, that is how I play that map, it is kinda problematic map to run with shadows on.

    You can open world editor and turn instanced rendering and alike on for all objects, some checkbox and changes there did help a lot to performance from my memory, but it is a while since I tampered with those so can't remember exactly, maybe culling checkbox too was useful.

    Shadows on that map tend to be bit much for my CPU overclocked and gtx1080 is mostly resting on that map, so it is bit of map issue.

    Funny thing is that 0.14 version shadows were just fine with that map, but with 0.15 no longer even 0.15 improved performance a lot.

    Anyways, it does not look much more horrible without shadows, also I think that map has something off with grip, it is bit slippery.
     
  9. PlayKoyote24

    PlayKoyote24
    Expand Collapse

    Joined:
    Jul 27, 2018
    Messages:
    84
    Yes i also turn them off on this map.
    --- Post updated ---
    From my experience i would say it is a bit too grippy^^ but yes, kinda weird map. I always get mad when i hit the wall. Instead of scratching along, the thing starts eating your car.
     
  10. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,774
    I don't know, comparing to other sims it is slippery, for example when I set brake balance to be fine at Hirochi or ECA, then use that config on Nordy, I get lockups way too easy, need to lower brake pressure further and when it is ok at Nordy, on other maps I don't get lockups at all.

    At least that is from my memory which is not to be trusted :D




    Curse and blessing of running stuff at single core and physics on other cores is kinda such that so many things kinda compete from CPU time of single core, then you add or remove load by graphics settings or different vehicle (modern ones, more LUA stuff for example) and it takes some effort to figure out how different aspects affect performance. It is good to know though as helps to optimize performance vs visual quality for own system.
     
  11. PlayKoyote24

    PlayKoyote24
    Expand Collapse

    Joined:
    Jul 27, 2018
    Messages:
    84
    Yes compared to other games beamng.drive is slippery, but comparing the map to other maps...
    --- Post updated ---
    Accidently typed my WhatsApp message here
     
    #11 PlayKoyote24, Apr 7, 2019
    Last edited: Apr 7, 2019
  12. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,774
    All those tens of different Nordschleifes, I would be just happy to have one that has textures like Raceroom version, don't mind it being fully accurate, just bit different look for grass from motel shower floor at Saturday morning which it currently resembles.

    There is this of course, which I think is same layout https://www.beamng.com/resources/nordschleife-island-caribbean-hell.7227/ however it is surprisingly difficult to adapt to different road sides when you are used to certain items at side of the road to tell braking points.

    Performance is excellent though, choices and compromises, one never can has it all, there is no room where to put it.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice