Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question HDRP Raytracing - Static Batching and GPU Instancing

Discussion in 'High Definition Render Pipeline' started by newguy123, Oct 19, 2021.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hi Guys

    So when using HDRP Raytracing, static batching gets switched off, and then SRP Batching gets enabled instead.

    This sounds confuding and seems to work the opposite of how things work with built in pipeline.

    So then for HDRP and Raytracing, if I have thousands of the same objects in the scene, with the same material, and those objects dont move, how do I get best performance out of it?

    Do I mark all those objects as fully static (which sounds like with HDRP raytracing you shouldnt)
    and/or do I mark the HDRP/Lit material of those objects as "Enable GPU Instancing"?
     
  2. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Marking objects as fully static doesn't really change anything in raytracing since the Ray Tracing Acceleration Structure (RTAS) gets rebuilt each frame automatically.

    Performance wise, this last PR improved a lot the building time of it so you can already try that. For high objects count, the cost difference starts to get noticeable.

    Also, for your specific case, there's some work coming that will allow users to build themselves the RTAS, so in your case, since your geometry doesn't move, you don't need to rebuild it each frame and can decide your own update rate thus saving some precious time.
     
    Lex4art and newguy123 like this.
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Will this be backported to 2021.2 on HDRP 12?


    Hopefully something that doesnt require us to code anything, but just flip a couple of switches!
     
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Sadly, no. The improvements are enabled by another set of changes on the engine side only available in the last versions.

    We'll see what's possible, but In the end, if code is required, some snippets will be provided to help setting it up.
     
  5. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    That's sad to hear. In general Unity seems to have an attitude that everybody's making Games and everybody's coders.

    There are things beyond games and there are a multiple of artistic uses for the tool, however when artists have to jump through hoops to get the simplest thing done, or code things, soon they will switch to a different engine.

    As artists we're trying to move away from traditional DCC rendering, and dream about the "realtime" experience. I do realise its a slightly different workflow etc, but if it ends up being more complex and takes more time to setup, then we'll just look to another engine or stick to our traditional methods.

    Unity is a great tool. Just wish sometimes they would give artists more love and not treat us like coders.
     
    Last edited: Oct 20, 2021
    chap-unity likes this.
  6. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    I understand your frustration and I'm all on your side trying to make things easier to understand / setup / use for everyone whatever their backgrounds and rest assured, we're working toward that.

    However, there are features that are way too advanced (like the manual building of the ray tracing acceleration structure) that will be used only by very few people who already know what they are doing so it doesn't make sense to spent a lot of time on our side to create an in depth tool for non coders that will be used by even fewer people.
    In a perfect world, I perfectly agree, but this feature is just too advanced for it.
     
    rz_0lento and newguy123 like this.
  7. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Thanks for the feedback. Appreciate it