How to get the position of a vertex in a particles-shader?

I’m writing a shader for a particle system (or rather trying to), that changes its look depending on its position in local space. (either the position of the particle, or of each individual vertices, doesn’t really matter much).
for meshes this is easy, you can directly access the local position in the vertex shader.
However, I tried this with a particle system, and it appears then that the vertex postion does not match the local postion, but rather some sort of weird screen space position.

So does anyone know how to get a particle’s (or its vertices) local or world space position in a shader?

1 Like

It’s a bit tricky, this is the closest I’ve gotten;

looking at your code, it would seem all that needs to be done is multiply the vertex position with the Camera2World matrix.
but I tried that and it doesn’t seem to work,
am I missing something?

Edit:

no wait, my bad, that totally does work.

thanks Farfarer