Hello! I’m trying to make a particle system that has butterfly mesh particles with animated vertices through shader.
I have come a pretty far way by making it work on a single mesh(not a particle system). But as soon as I use it on the renderer module in the particle system it breaks.
The shader I made is seen below:
And the desired result per particle is this:
On each particle in this system:
I am using unity 2020.3.18 and the URP, does anybody know where I went wrong or how this is fixable?
(I am quite new to shaders and particle systems)
Well, to be honest I dont know exactly what breaks or if it is even “broken”. But it is definately not the desired result. All the particles start spazzing around instead of flapping their wings as shown in the example and flying around in the behaviour represented above. On single meshes the shader works but for some reason that behaviour is not the same when I place the exact same shader and the exact same mesh in a particle system renderer module.
So i think my question needs to be rephrased to: How do I achieve the results, I get on a single mesh, in a particle system.
Never tried such animations, so I don’t know how to correctly fix it, but I can tell you whats the problem - it’s most likely particle batching. I mean, particle system generates single mesh from all particles, so your object space is not valid as it’s not middle of particle, but instead something like barycentric center of all particles. You can confirm this by generating only one particle - it should work.
To fix it you must ensure that each “particle” somehow knows it’s center.
// edit: It might be also possible to enable instancing, so each mesh is “separately” rendered on GPU
Bump. I having the same problem. I’m making a “rat” particle system where the rats wiggle around while moving, based on its world position and a noise. I’m also using shader graph.
This is how it looks on a mesh:
This is what it looks like on a particle: