Spawning particles from a generated mesh with DepthKit in Unity ?

0 like 0 dislike
70 views
Hi PopcornFx team,

I've made a Fx with a sampler mesh attribute, and i want to fill this attribute with a generated mesh from DephtKit in Unity.
I'm using the sample code (mesh) in my script that i found here http://wiki.popcornfx.com/index.php/Effect_Attribute_Samplers_Animation

Mesh generated with DepthKit isn't static or skinned but vertex are animated, so i'm asking if you think it's possible to sample this sort of mesh into the Fx Attribute ?
asked Jun 21 by anonymous

1 Answer

0 like 0 dislike
 
Best answer

Hi,

The only way would be to create an Unity mesh and fill it's vertices with those you get from DepthKit (like here : https://docs.unity3d.com/ScriptReference/Mesh.html) and call the function SetSampler() with this new mesh each frame.

But if it's an big mesh, it will really impact your performances.

Hope this helps

answered Jun 23 by Valentin (6,860 points)
...