Hi Zoombapup,
From your description, I'd say there's only so many problem areas that could be causing the incorrect behaviour; I don't pretend to be particularly knowledgeable on the subject, but here are my thoughts:
Code:
gl_Position = gl_ProjectionMatrix * calcParticleViewPos();
This seems to be what you've come up with, which matches existing shaders for building translucency - hopefully you're not seeing bizarre mismatches of colours, just incorrect fading. If that is the case, then I'd surmise your code is fine at this point and getting the correct data; it's the next step of working out the alpha that'll need tweaking.
From marciano's code:
Code:
const float scale = 100;
vec3 fragCoord = (vpos.xyz / vpos.w) * 0.5 + 0.5;
float sceneDepth = texture2D( depthBuf, fragCoord.xy ).x;
gl_FragColor.a *= clamp((sceneDepth - fragCoord.z) * scale, 0, 1);
I apologise if my understanding is wholly incorrect, but isn't a scale of 100 out of place here? Between the clamped sceneDepth and fragCoord 'depth' values of [0..1] I'd expect this to represent the relevant alpha value.
Hope this helps.