- Home /
How to morph shapes in Visual Effects Graph
I'm trying to manipulate the visual effects graph to morph into shapes based on model meshes. Currently I have two approaches going that each does almost what I need, but has a minor problem.
Point Caches
The first approach is using a Point Cache and applying that to the particles initialize position. This works great in that the particles spawn in the shape I need. Unfortunately I cannot expose the point cache in the VFX parameters to change this dynamically.
Is there a way to get the visual effects graph to use different Point Caches dynamically? Or maybe a way to disable the content blocks dynamically?
Singed Distance Field
The second approach was to conform to a signed distance field, which works great and actually feels closer to what I need. I can also expose the texture3D in the VFX parameters and swap it out dynamically to get the shapes to morph.
Unfortunately I'm not 100% on SDF's and how to make them from meshes.
I found this which looked very promising : https://github.com/xraxra/SDFr I slightly modified it to output the texture3D asset needed for the particles, and is was pretty succesful at swapping things out on the fly.
But after a couple of hours playing around, the generated SDF meshes always looked somewhat warped and deformed ( maybe I'm missing something obvious ).
Is there a 'nice' way of converting meshes to a SDF texture3D for use in Unity?
Answer by jg3d · Feb 11, 2020 at 10:28 PM
Heya- did you have any luck with this? I'm trying to assign point caches dynamically. I don't need to assign at runtime, I just don't want to create a new graph for every mesh in my scene that uses the effect.
Thanks!