Search Unity

Ambient Occlusion and GPU instanced mesh particles

Discussion in 'Image Effects' started by Niiilsen, Jun 10, 2020.

  1. Niiilsen

    Niiilsen

    Joined:
    Aug 26, 2012
    Posts:
    3
    I'm having a problem with ambient occlusion not working as I want on gpu instanced mesh particles.

    I'm using the first shader example from https://docs.unity3d.com/Manual/PartSysInstancing.html to spawn a bunch of mesh smoke particles with GPU instancing enabled in the rendering module. It renders fine, but when post processing AO renders, it seems to calculate the smoke wrong(position and rotation offset). It also shows the AO of objects behind the smoke through the smoke.

    Here are a couple of pictures showing the problem:
    1. AO of elements in the background show through the smoke

    2. Ambient occlusion turned off:

    If I render the smoke on transparency queue it ignores ao completely, so that's not an option.

    Anyone have a solution to this issue?


    Other:
    - Using Unity 2018.4.16f1 with forward rendering