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?
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?