Welcome to the forum, feel free to ask questions here.
// NOTE: I'm using default object names here vector $vPw = << samplerInfo1.pointWorldX, samplerInfo1.pointWorldY, samplerInfo1.pointWorldZ >>; vector $vCamPos = << persp.translateX, persp.translateY, persp.translateZ >>; float $fDistance = mag($vPw - $vCamPos); ramp1.vCoord = $fDistance / 50; // The divider (50) is acting like a max distance value. You may need to adjust it depending on your scene size.
vector $vPPos = lpos; // last position of the particle vector $vCPos = << persp.tx, persp.ty, persp.tz >>; // current camera position float $fDistance = mag($vPPos - $vCPos) / 20; // particle's distance from camera (scaled to be in range of 0 - 1) opacityPP = 1.2 - $fDistance; // the opacity will be at least 0.2 but degrades when the distance increases from the cam