Search Unity

Render to 2 targets

Discussion in 'General Graphics' started by Barkley, Apr 18, 2019.

  1. Barkley

    Barkley

    Joined:
    Dec 1, 2012
    Posts:
    76
    Hi,

    I was wondering if there's a way of setting up a camera so that (with some shaders) it can render to 2 different render targets (with forward rendering). I'd like to be able to render to a secondary target some info (such as whether a character has to be outlined or even the velocity that character is moving at) to use it later for post-processing effects.

    Shaders have the SV_Target requirement but in the documentation (https://docs.unity3d.com/Manual/SL-ShaderSemantics.html) it's hinted that you can render to multiple render targets but I don't really know how to configure that part from the CPU part (not the shader part which seems reasonably easy).

    I'd really appreciate it if you could point me to more documentation or some samples or tutorials that explain that part (or explain in an answer what I need to do).

    Best regards,
    Eduardo