Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

CommandBuffers and Particle Systems

Discussion in 'Universal Render Pipeline' started by Quasimodem, Sep 8, 2020.

  1. Quasimodem

    Quasimodem

    Joined:
    May 21, 2013
    Posts:
    47
    Hello,

    I've seen this issue raised a few times, but never with a satisfactory answer.

    I'm currently in the middle of writing a custom render pipeline, using CommandBuffers and calls to DrawRenderer(). My game is mostly comprised of SpriteRenderers and ParticleSystemRenderers, both of which I want to pass to DrawRenderer().

    The SpriteRenderers work exactly as I'd expect. The ParticleSystemRenderer... no so much. Nothing gets rendered, and no geometry gets pushed to the hardware that I can see in the Frame Debugger.

    The only slight progress I've managed to set the emitter's RenderMode to Mesh, call BakeMesh() on its renderer, and then use CommandBuffer.DrawMesh(). There are numerous problems to still overcome down this path and it seems like a very heavyweight operation to be doing in my rendering code.

    I really can't get much traction on understanding what's going on here, the SRP is still very much a black box. Any one else have any luck rendering a ParticleSystem via CommandBuffers?
     
  2. lvcoc

    lvcoc

    Joined:
    Jul 26, 2018
    Posts:
    9
    I have the same issue...did you fixed it
     
  3. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    476
    Same issue here. I use the same approach with baking the particles to mesh/ render mesh.
    A bug report has been sent by one of the users using my asset, the vegetation engine.
     
    customphase likes this.
  4. jiajia_xd

    jiajia_xd

    Joined:
    Oct 28, 2021
    Posts:
    9
    Have the same issue...did anyone fixed it?
     
  5. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    476
    Yes, looks like you need to use Camera.SetupCurrent before rendering the particles.

    upload_2022-2-10_12-5-26.png
     
  6. jiajia_xd

    jiajia_xd

    Joined:
    Oct 28, 2021
    Posts:
    9
    I tried this, but doesnt work:(
     
  7. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    476
    Works fine for me on all render pipelines? Are you using command buffers?
     
  8. jiajia_xd

    jiajia_xd

    Joined:
    Oct 28, 2021
    Posts:
    9
    Just one command buffer. I add the command buffer to a custom camera not scene camera, I don't know if that has any impact.