Get Particles Position from SPS inside Shader

I know we can access the position attribute. But I need to grab the particle.position essentially per particle on the vertex shader and pass that as a varying.

Not sure if there is just a section of the buffer I can reference or if I am going to have to do some witchcraft.

You can probably extract it back from the world matrix ???

No wait SPS is not using instances but a single buffer containing all the info so you would need an extra attribute to contain the value, but I am not sure if you can add custom info in the SPS.

@jerome might know a trick ?

yeah thats kinda what I thought… I guess if I know the stride and the position of the node I could update the uv3 and 4 channels on the SPS mesh with the correct data I bet.

2 Likes

That totally worked. :skull:

1 Like