Search Unity

Bug CustomPassUtils - some pixels drawn twice, fixed size render targets not working

Discussion in 'High Definition Render Pipeline' started by DmytroKu, Apr 19, 2021.

  1. DmytroKu

    DmytroKu

    Joined:
    Dec 18, 2013
    Posts:
    3
    Hello!
    Discovered some problems trying to do blurs with CusomPassUtils:

    a) Code calls something like
    Code (CSharp):
    1. ctx.cmd.DrawProcedural(xxx, xxx, xxx, MeshTopology.Quads, 4, 1, propertyBlock);
    However, shader uses GetFullScreenTriangleVertexPosition function. This function produces single full screen triangle. As a result, 2 triangles are drawn, one covering whole screen, and another covering half of the screen. Here are vertex positions from RenderDoc:
    cusomutils-geometry.png

    b) Blurs only seem to work with render targets created with scaleFactor. When using fixed size targets, nothing is drawn because viewport set to zero size. It is not possible to set scaleFactor on a fixed size target.

    Thanks!
     
  2. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    263