Search Unity

Question Hybrid render performance impact when using `Occluder`

Discussion in 'Graphics for ECS' started by Endlesser, May 17, 2021.

  1. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    Is `HLOD` supposed to run under Subscene only?

    I tried to put it with `ConvertToEntity` and works for me except this fellow error log(Since circumstance of https://forum.unity.com/threads/subscenes-ui-entity-header-failed-to-load.1007609/#post-7136402, Subscene is out of options for me right now)

    upload_2021-5-17_19-31-19.png

    Untill `Occluder` component was added, FPS drops insanely from 190~210 to 6~30:)eek:), `Occludee` is fine though, is there any property I lost to add or further issues I should be aware of or is just a twisted way to use LOD in hybrid render?

    upload_2021-5-17_19-31-49.png

    --------------------------------------------Edit------------------------------------------------
    So did some experiments on HybridURPSample project from Unity git, using 2020.3.6f, Hybrid Render 0.11.0 and URP 10.4.0.
    Turns out what kind of `mesh` u r using in `Occluder` matters significantly:
    1. I test through OcclusionCulling scene, give 3 different mesh each time to test outputs and fps (one is default cube, one is capsule, one is a complex mesh(8000+ vertices,10000+ triangles))
    2. The cube testing is fine, reach to 400+ fps, and is default OcclusionCulling scene setting.
    3. The capsule testing is with impacts, drop to 190~200 fps.
    4. The heavy mesh testing is down to 23.6 fps at last, even most mesh are culled(129 culled out of 130 total).
    5. Another find is what kind of shadow mode u r using in `Light` matters either, combine with `Occluder` they drop performance like a rampage.
    6. Finally using none mesh for each `Occluder`, 450+ fps will get.

    Btw, these experiments are all testing under Subscene and `ConvertToEntity`, same fps results, so I guess it is not their issues(and not HLOD's probably).

    There's little info and guide I found in OcclusionCulling from Hybrid render sample, like is anyone knows how to begin with occluder type volumn?

    upload_2021-5-18_10-28-12.png

    upload_2021-5-18_10-28-28.png
     
    Last edited: May 18, 2021
    BigRookGames likes this.
  2. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    111
    very interesting... that explain why I have so low FPS results with an empty scene and a few hundred "complex" meshes and 400+ fps and +/- same number of cubes
     
  3. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    Funny thing is, we usually expect performent from using Hybrid Render & OC through simple scratch, but on the contrary it gets worse, maybe it's just my rackless configs I hope, still digging..
     
  4. vandreev

    vandreev

    Unity Technologies

    Joined:
    Mar 2, 2016
    Posts:
    6
    Hi,

    Occluders should typically be very simple geometry, 8000 vertices is 2-3 orders of magnitude more than what tends to be useful. Basically, there is a point beyond which computing the occlusion from a complex occluder is more expensive than rendering whatever is behind it. Think 8-16 vertices per occluder.

    Also, make sure that Burst compilation is on: without it, occlusion culling will still work, but run entirely in C# and that will result in a severe slowdown.

    Please also note that this feature is still under heavy development and is not yet officially supported. Documentation and examples will be coming, stay tuned!

    Cheers,
    Lou
     
  5. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    That makes sense now, I will stay tuned~
     
  6. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    @vandreev

    Question about using Occluder type volume, since last year:

    After I created a 6 prism sides volume and edited with vertex mode in a prefab, clicked save.

    But, no edited volumes are actually saved when you enter this prefab again, all volumes in Occluder components went back to original 4 sides and no yet created.

    upload_2022-7-7_11-16-53.png
    State of after editing

    upload_2022-7-7_11-20-44.png
    State of enter again

    Using Hybrid Renderer v0.11, Entities v0.17, Unity v2020.3.36f1.
     
  7. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
  8. nigeljw_unity

    nigeljw_unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    50
    Hey Endlesser!

    Sorry that we have been so quiet in this thread as I was not actually aware of this old post. We updated about our roadmap in a different thread, but we will post a sticky thread soon to give everyone an update so that these details are not trapped in individual threads.

    Our new occlusion system is well in progress for an experimental release with Dots 1.0. Game object support is also planned for 2023, as most of our system is actually low level Burst. The occlusion system in Entities 0.17 was a release from years ago, and as Lou mentioned previously, our new occlusion culling is not officially supported in that release.

    The occlusion culling system in Dots 0.5X is almost identical to the 0.17 release, and we are not officially supporting that release either. The occlusion culling sample was removed from 0.5X to keep new developers from becoming engrained in this outdated workflow and to remove the maintenance burden on my team so that we can completely focus on our new version with Dots 1.0.

    The new upcoming experimental release has had well over a year of a full team working on this improved solution with multiple devs, tech art, UX, QA engineer, plus analysis and feedback from our demo team, etc. It will be a significantly improved system over the previous release in 0.17. We have made significant improvements in correctness to achieve full conservatism (no false positives), as well as fully parallelizing and amortizing the software rasterization pipeline with Burst to minimize the overhead as much as possible. There will be significant UX workflow improvements and also improved debug tooling.

    The release in Dots 1.0 will still require manual occluder creation, but occluder generation is planned for 2023, though we are already validating it against Gigaya. The software rasterization and occluder generation pipelines are incredibly complex, so we are very eager to get feedback from developers like yourself in Dots 1.0 as soon as possible. I wil be sure to post in this thread when Dots 1.0 is available in pre-release with our new Burst optimized occlusion culling.

    I am actually quite interested in more feedback from you about manual occluder creation versus automatic generation. For example, do you have the resources required to do manual occluder generation for complex scenes, or will you be dependent on automatic generation? With regards to using heavy occluders, you will obviously generally want to minimize the complexity of your occluder meshes as much as possible, though the application and configuration of occlusion culling is very scene dependent, as I am sure you are well aware. With the automatic generation, we are maximizing the inscribed space while making the mesh as low poly as possible, but this becomes quite complex for meshes with highly nonlinear and non-convex features, though with our automatic generation, it will not be a requirement for meshes to be fully watertight (which is actually a requirement for Umbra), but some objects will naturally have holes in them (such as caves in terrain, etc), and we need to work with you to help us understand the best workflow for complex situations like this.

    Thanks for this awesome early feedback with the previous versions!
     

    Attached Files:

  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The Gigaya occluders are definitely something I would code to solve the problem (would identify candidates of suitable size, and generate convex shapes if need be), and any manual usage is more than likely going to (frankly) be just for portal based stuff, such as the entry point to a dynamic and complex ship interior, to minimise it's work.

    I don't think I'd ever be into identifying much by hand as my workflows are non-destructive but quite busy in change. Scenes might not necessarily visually change much but the models or topology might (custom open world tools).
     
    nigeljw_unity likes this.
  10. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    This is the way:)

    Glad to hear, couldn't agree more about focusing on the major subject of this year from you guys.

    Absolutely, there's no way I'm going to miss this release. But I might not be able to feedback on Hybrid Renderer in time since recoding around Entities 1.0 and ECS is primary in that circumstance.

    I think both solutions are inevitable and will be using by kinds of approaches, but I'd prefer manual OC more than auto OC because all the performances I can get are important.

    In my case, we have a battle-royale like scene with 500x500 terrain and 1000+ static objs under first-person camera for 30+ players, we already placed a custom simple cube or prism which composed by ProBuilder to every large potential occluder prefab. As for occluder of terrain(not yet terrain holes), either we spend time and effort plant some occluder underground manually or try out auto generation for a short cut as long as performance is not boomed. Anyway, we will keep forwarding when DOTS escalating and bring more features repo as soon as I can.

    BTW, I wonder how is this thing about Hybrid Renderer optimization doc nowadays? is it going to be present with 1.0 too?
    https://forum.unity.com/threads/is-...ng-with-hybrid-renderer.1001293/#post-7158139