Search Unity

Question Recommandation for metaballs implementation

Discussion in 'Shaders' started by The3Loutrons, Aug 9, 2022.

  1. The3Loutrons

    The3Loutrons

    Joined:
    Apr 4, 2016
    Posts:
    7
    Hi all

    I need metaballs (in 2D) with smooth union for a future game.
    Right now I have a shader able to display 4 balls using SDF, correctly textured, with simulated light diffuse, fresnel and specular, giving the shader some config info for each metaball: size, position, texture, etc...

    However I m afraid that I ll enter performance issue, as I need to display up to 60 balls on mobile kind of HW.

    • What would be your recommendations ? I would like to avoid doing everything on CPU as I need to keep load for other game stuff.
    • Is it possible to ”stack the shaders" thus calculating the SDF in different ones? Is it even bringing any performance benefit?
    Tx!