Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Creating a polygon-based "disintegrate" effect?

Discussion in 'General Graphics' started by wickedpopular, May 2, 2020.

  1. wickedpopular

    wickedpopular

    Joined:
    Oct 29, 2016
    Posts:
    33
    Hello!

    I am trying to create an effect in Unity and am a bit stumped about how to approach it? What I would like to do is have my mesh seemingly directionally "disintegrate" into its component faces. There are mesh "exploder" scripts out there that slice meshes into individual faces, but I'd like to have the mesh faces displayed as particles, for better performance and control.

    What I believe I need to do is figure out some way of getting individual polygon faces in the shader based on the shader parameters, but then I have no idea how to bridge those into my particle effects.

    Below is an example from video game of something similar:


    Example of Effect

    This was most likely a prerendered animation, and changes the texture so that there's no face mapping, but this is basically the effect I'm looking for.



    What could I do to create this effect? Thank you!
     
  2. Gordon_G

    Gordon_G

    Joined:
    Jun 4, 2013
    Posts:
    372
    HI wickedpopular, I think can get the effect using a Particle Effect with a Mesh Emitter and a velocity curve for the particles. Use your objects Mesh for the Mesh Emitter shape, and you'll need coordinate timing the Particle Effect start with the disappearance of your object. (make one invisible when the other begins).

    Set the Emitter Shape to Mesh (or Mesh Renderer and Select your Mesh and Type to Set the start velocity of the particles to Zero so they hang on the triangle faces of your mesh, and set the Velocity over life time to start moving some time after they are generated. I think you'd Burst generate a bunch of them at the start. You'd need to choose the particle shapes appropriately.
     
  3. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    Sorry I'm like a year late on this, but I ended up needing something like this for a game I was working on, so I thought I'd share. Rather than using a Particle Effect or VFXGraph with a Mesh Emitter, I basically created a custom particle effect system that read the mesh and converted it to particles triangle by triangle.

    Here's a video of the demonstration project:


    In case anyone else is interested in this, I've posted a write-up on my website discussing how I implemented this effect.
     
  4. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,074
    @DK_A5B
    That whole thing looked cool. Wow!:eek:
     
    DK_A5B likes this.