Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved DOTS and Rendering, Where To Render?

Discussion in 'DOTS Dev Blitz Day 2022 - Q&A' started by Kmsxkuse, Dec 8, 2022.

  1. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    296
    As I'm using sprites and other 2D rendering systems, it seems moving forward I will need to develop my own solutions to rendering entities in a purely DOTS format.

    The question is, where do I actually schedule the GPU execution? There seems to me 4 ways currently:

    1. Direct Graphics static class calls. Primarily the Graphics.Draw and Render methods.
    2. Graphics.ExecuteCommandBufferAsync
    3. URP / HDRP Render Pass API.
    4. RenderPipelineManager Begin / End Camera/Context Rendering events.

    Which one should I be using?
     
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    286
    Wherever possible, I would recommend using the URP and HDRP APIs (e.g. URP ScriptableRenderPass), as those are likely to be the best way for the drawing to get scheduled at the desired time (e.g. opaque rendering pass). They also give you access to the ScriptableRendererContext, which makes it possible to utilize BatchRendererGroup if necessary.
     
    JohngUK and Kmsxkuse like this.