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 Multiple fullscreen passes for a single render feature

Discussion in 'Universal Render Pipeline' started by Sycobob, Apr 8, 2021.

  1. Sycobob

    Sycobob

    Joined:
    Feb 1, 2013
    Posts:
    78
    I'm learning how to use the URP and converting an existing render effect that uses OnRenderImage. The effect is triggered by player action and performs multiple fullscreen passes, one for each instance of the effect.

    I've updated the effect to work in URP and I can play one instance of the effect by adding a RenderFeature that does a fullscreen blit using my material. I'm currently using the DrawFullscreenFeature RenderFeature from the URP examples.

    Now I want to be draw the effect multiple times and I'm not quite sure how to do so. I want to loop over a list in my game state and for each instance in the list set a material property and do a fullscreen blit. I think what I want is to get at the ScriptableRenderContext so I can push a CommandBuffer that I build up in code.

    How do I actually get at the ScriptableRenderContext from code? Is that even the right approach? Should I be making a custom RenderFeature for this specific effect that does multiple passes instead of trying to use a generic RenderFeature?