Search Unity

Custom pass that draws renderers from a layer

Discussion in 'High Definition Render Pipeline' started by Erethan, Jun 17, 2021.

  1. Erethan

    Erethan

    Joined:
    Apr 27, 2015
    Posts:
    28
    Hey all!

    I'm creating a simple custom pass that renders all objects in a layer, for learning purposes, but I might be missing an important concept here.

    Shouldn't the snippet below suffice to achieve that effect?

    Code (CSharp):
    1.  
    2. protected override void Execute(CustomPassContext ctx)
    3.     {
    4.         CoreUtils.SetRenderTarget(ctx.cmd, ctx.cameraColorBuffer, ClearFlag.None);
    5.         CustomPassUtils.DrawRenderers(ctx, _layerMask);
    6.     }[
    7. /code]