Search Unity

create point cloud effect from mesh, then move those points around?

Discussion in 'General Graphics' started by prismspecsx, Jun 24, 2022.

  1. prismspecsx

    prismspecsx

    Joined:
    Nov 27, 2018
    Posts:
    13
    Hey all,

    Looking for some guidance. I've been tooling around with some point cloud generating packages and so on, but I feel like there might be a simpler way to do what I want, and I'm also curious about other ways I might go about what I want to do.

    Let's say I have a simple mesh, an FBX model of a traffic cone, and I want that to appear as though it is comprised only of points, as in a point cloud. These points should have the approximate color of the parts of the mesh they represent, and the density of these points should be higher than the triangle count of the mesh. As in, if I had an FBX of a cube, there should be many points and not just points at the vertices of the mesh. Then I want to be able to manipulate these points, like have them all collapse into the center of the mesh for example.

    Perhaps there is an easy way to accomplish this with a particle system, or maybe I need something more complex.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    Sounds like you want to write a shader. Pixel shader that skips every n-th pixel for instance or calculates how many pixels to draw of each polygon.

    Interaction will be more difficult though. You may want to simply design that effect in a 3d tool like Blender instead for full control.
     
    prismspecsx likes this.
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    other options:
    - tesselate that mesh (using script or tesselation shader or external 3d tool), to add more points in faces

    for animating it, in vertex shader you can move vertices around,
    or use particle system and manually move points around with script,
    or use VFX graph and build more complex effects.
     
  4. lucidtripper

    lucidtripper

    Joined:
    Aug 3, 2017
    Posts:
    24
    can you give more detail about the VFX graph option - like a working example ?
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448