Search Unity

Question Uniform attractiveness of Signed Distance Field

Discussion in 'Visual Effect Graph' started by alexandre-fiset, Sep 4, 2020.

  1. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    I am spawning particles from the depth of the camera and want these particles to randomly stick on a surface of a signed distance field.

    I have made a bear head SDF that looks like this:

    upload_2020-9-4_11-5-36.png

    It can properly work if I spawn particles from a sphere around the SDF, but as soon as the spawning isn't consistant on all side, particles seem to only stick to a specific area of the SDF.

    This is spawned from the depth texture of the main camera, see that particles gather on the left side.

    upload_2020-9-4_11-7-4.png

    As opposed to spawned from a sphere where they stick rather uniformly on the SDF surface.

    upload_2020-9-4_11-9-25.png

    My question is: Is there a way for the particles to always spread uniformly on the SDF surface?

    The end goal is to create a spawning effect where particles emit from the depth of the camera to form the shape of the enemy.
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Hi, we're adding a sample SDF operator, so you'll have more flexibility about where you sample and what you do with SDF sampled data. It may help achieve what you're looking for.
     
    alexandre-fiset and florianhanke like this.
  3. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Also, if you want the particles to completely randomly choose destination point of surface, you don't really need spatial information (thus SDF) and might consider baking you destination point set in a point cache instead?