I’m trying to get the same effect that the PS3 home screen (or Naughty Dog’s “Last of Us”) achieves where the particles fade to a different texture when they are close to the camera. It would be an out-of-focus texture (such as a hexagon shape). You can see the effect on the left side of this image: http://i1.ytimg.com/vi/npR4iLzpCbU/maxresdefault.jpg
I’ve written a bunch of variations of shaders (both surface and vertex), that almost achieve the effect, but I think I’m stumbling over the fact that I can’t get the actual world position of the particle I’m rendering.
I’ve tried using this (in a vertex shader):
float3 worldSpaceObjectPos = mul(v.vertex, _Object2World).xyz;
As well as the built-in Input.worldPos (in a surface shader), but they both give me back screenspace coords.
Are particles simply not rendered in the same pipeline, and thus don’t have a true world position? Is there no way for me to get a particle’s distance to the camera?