Search Unity

Help with RenderObjectsPass to rendertexture.

Discussion in 'Universal Render Pipeline' started by kjetilhj, Jan 19, 2020.

  1. kjetilhj

    kjetilhj

    Joined:
    Oct 23, 2019
    Posts:
    3
    Hello!

    I wonder if there is any guides somewhere on how to convert the existing Render Objects Feature script into something that can render into a texture instead of directly rendering into the camera.

    I have a class now which inherits from RenderObjectsPass so I can override the Configure method and call ConfigureTarget there which should enable me to set the rendertargets.

    Here's the documentation for that.
    https://docs.unity3d.com/Packages/c...rPass_ConfigureTarget_RenderTargetIdentifier_

    But I'm unsure on exactly what's required for me to end up with a valid rendertexture which I can set to be global and reused in another pass.

    Does any documentation or samples on how to setup renderobjects passes with rendertargets exist somewhere?

    Thanks

    Kjetil
     
  2. Solovykh

    Solovykh

    Joined:
    Aug 28, 2017
    Posts:
    59
    Kinda depends what you're trying to do. If this render texture is something you create before run-time you can just create a custom Render Feature that stores a reference to the pre-allocated RT. Then, in the feature's
    Create override you can assign that render texture to your ScriptableRenderPass. Then, you would override the ScriptableRenderPass's Configure method and call ConfigureTarget with your RT in that override.