Search Unity

Resolved Long term future plan of SRP, URP and HDRP

Discussion in 'SRP Dev Blitz Day 2022 - Q&A' started by optimise, Sep 28, 2022.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Currently dots graphics has been built on top of C++ engine side OOP land graphics backend that it's not really a fully pure dots graphics solution. Any plan to implement a truly full pure dots graphics backend solution in future that will be built on top of engine side full pure dots graphics backend? Long time ago at 2020, official mentions something at below but still I really hope it will happen as a long term future plan.

     
    Last edited: Sep 29, 2022
  2. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Does official still have long term future plan to further improve performance to next level that implement full pure dots graphics solution from lowest level graphics backend until very high level i.e. URP, HDRP? If I understand correctly currently it's kind of weird that seems like graphics rendering going through a lot of pipeline when u are using entities graphics. So graphics rendering pipeline is like going through from lowest level C++ engine side OOP land graphics backend -> entities graphics -> SRP -> URP/HDRP. Or at least is there any near term plan to merge entities graphics ->SRP -> URP/HDRP rendering pipeline process into just entities SRP -> entities URP/HDRP in future?
     
  3. AljoshaD

    AljoshaD

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    234
    Yes! We want to move towards all rendering following the same path for GameObjects and ECS. The BatchRenderGroup likely offers the opportunity to build this shared path. A huge project is ongoing to validate this assumption.
     
    JesOb, graskovi, shikhrr and 2 others like this.
  4. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Awesome. I'm asking this is because it seems like it's too much work to maintain so many different graphics rendering tech while need to make it always working properly at the same time. Btw from what I understand BatchRenderGroup is C++ engine side OOP land graphics backend. Does BRG currently already provides enough maximum performance from low end platform to high end platform that official expected? So if I understand correctly I guess official will stick to BRG for like at least 10 years before starting to reconsider implement C# pure dots graphics engine side backend that is not longer is C++ engine side OOP land graphics backend for high end platform but low end platform like mobile platform and web browser platform will have simple lightweight pure dots graphics backend i.e. project tiny?
     
  5. AljoshaD

    AljoshaD

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    234
    It's C++ side but it's OOP/GameObject agnostic at this level. We aim to have a thin, highly efficient lower level graphics api that abstracts platform graphics apis. The rest of the graphics stack will be built on top of this in burstified C# code that is readable and modifiable.
     
    graskovi and optimise like this.
  6. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I see. Just curious why this graphics need to be stay at C++ rather just C# with burst since I believe it will still have performance issue of interop between C++ and C# ?
     
  7. AljoshaD

    AljoshaD

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    234
    Finding the most efficient point to cross the C++/C# barrier is an important design criteria of the graphics stack. At the same time, also we need to find the ideal abstraction that allows us to easily add future platforms while guaranteeing optimal performance per platform. This design promises to offer that.
     
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I see. I think currently there's a still have this long standing issue that C# side have difficulty to sync with C++ side that if when implement / fix something at C# missing something that requires C++ then needs to wait for C++ to land it. It seems like the only way to really solve this issue is to make it fully to 100% dots C#. I think there's unity staff mentions that there's a lot of discussion about migrate more and more C++ engine side code to dots C#.
     
  9. AljoshaD

    AljoshaD

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    234
    I think the problem you are referring to was cause by the core engine and the Graphics packages being in separate repositories, making it difficult to make cross boundary changes. We solved that recently by bringing the whole graphics stack in the monorepo.
     
  10. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I see but what really want to say is if C++ side can move to burst c# as a package then u can just update the package without needing to wait for new unity version. It also means it it will not tied to specific unity version. I believe currently it's also the main reason why it's so hard to backport something back to old urp/hdrp version that any new major version of urp/hdrp is only support specific new unity version and no backward compatible with old unity version.
     
    Last edited: Oct 2, 2022
  11. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Any code that interacts directly with native graphics APIs (D3D, OGL, Vulkan, etc) must be on the C++ side. Burst code is basically fast self contained native code that interacts with very little outside of it, so it can't be used for that.
     
    AljoshaD likes this.
  12. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I see. What I mean is using burst C# to create C# binding for these native graphics API like how unity engine exposes C# Transform binding from C++ side . Then now u can implement all of graphics related code at C# and able to achieve wat u say at previous post. But not sure about the performance.
     
  13. AljoshaD

    AljoshaD

    Unity Technologies

    Joined:
    May 27, 2019
    Posts:
    234
    That is basically the plan. But there is a thin layer on the C++ above the native graphics APIs side to have the most efficient abstraction to expose to C#. Without this, performance can't be optimal. Most of the engine/graphics code will be on the C# (burst) side.
     
    optimise likes this.
  14. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Awesome. Thin layer on the C++ above the native graphics APIs side do u mean BRG or there's even better solution work in progress?