Search Unity

Question HDRP Render loop?

Discussion in 'High Definition Render Pipeline' started by headlessstudio, Apr 28, 2020.

  1. headlessstudio

    headlessstudio

    Joined:
    Feb 25, 2016
    Posts:
    83
    Hi, I'm struggling with figuring out the HDRP render loop execution order in relation to the "normal" Unity execution order.

    For instance, if I add a CustomRender to a camera when is that being called in relation to LateUpdate/OnRenderImage?

    Also, what does Camera.Render() exactly do under the hood? Also, what's the difference between .Render() and .RenderDontRestore()? Is there a performance gain? Uses less memory?

    I'm rendering multiple cameras and I'm trying to discard/release as many textures in memory as possible before moving to render the next camera (all in the same frame).

    Kind regards,
    Artur Leao
     
    Last edited: Apr 28, 2020
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
  3. headlessstudio

    headlessstudio

    Joined:
    Feb 25, 2016
    Posts:
    83
    Thanks, but I've seen that and the render loop execution order (update, late update, etc) and I do not get a clear relationship between both, also that graph is not taking into consideration the HDRP.Render which calls BeginFrameRendering, BeginCameraRendering, etc.

    After some testing I evaluated that those methods (hdrp beginframe, etc) run in batches, would also like to know the logic behind that and if it's always the same.

    In the end, what I'd like to know is if there's a way to discard the camera.render() buffers/textures/render textures immediatly after, while still on the same frame.

    Thanks again.
     
  4. headlessstudio

    headlessstudio

    Joined:
    Feb 25, 2016
    Posts:
    83
    Upon further investigation I've made some progress regarding BeginFrameRendering EndFrameRendering.

    They in fact run in separate batches for editor cams, preview cams and finally for game cams.

    Anyway, would be great to have someone from Unity pitching in since the documentation is a bit.... well yeah.

    Still very curious on how the Camera.Render() works too.

    Kind regards,
    Artur Leao