Search Unity

How to render particles manually, a la "DrawMeshNow"?

Discussion in 'General Graphics' started by BearHugMark, Jul 30, 2018.

  1. BearHugMark

    BearHugMark

    Joined:
    Feb 21, 2016
    Posts:
    21
    Hi guys,

    We're in the process of massive optimisation of our mobile game. We use image effects but we need to render dynamic objects within the image effect itself. Meshes are fine (DrawMeshNow), but how can I render particles? Nothing seems to be exposed. Particles and particle systems don't have any renderer type components with materials etc exposed?

    I can't have a separate Camera for the particles as unfortunately that breaks certain ordering/functionality.

    Is there anything along these lines for Particles?

    Code (CSharp):
    1.  
    2. meshRenderer.sharedMaterial.SetPass(0);
    3. Graphics.DrawMeshNow(meshFilter.sharedMesh, gameObject.transform.localToWorldMatrix);
    4.  
    I've seen a few other people need this but they've not found any solutions.