[Shuriken] Vertex color data from emitter shape (mesh) fed into particle shader

I have painted in vertex colors on my custom emitter mesh. I want to use this data to control the size of my particles (use the red channel as a lerp between small and large sized particles)

Is there a way to do this?

E.g.: Custom emitter mesh (shape emitter):
5169401--512921--1.jpg

Then on each vertex I plan to spawn a particle. The red vertex colors on the emitter mesh will dictate the size of each particle.

So the question is how do I get this information fed into my particle shader?

You could use the color in the shader to adjust the size of the particles, but it would require you to write your own billboarding code and pass custom Vertex streams such as center and size to the shader.

An alternative in Unity 2019.3 is to use the c# job system integration. You could write a job that transferred the color to the size property. That would be the easiest way to solve this use case. You can read about it here: Particle System C# Jobs (2019.3) - Google Docs

Okay, thanks for the reply Richard. Will look into this. :slight_smile:

1 Like