xvs.1.1 def c9, 2, 12, 1, 1 ; min point size, max point size ; c0-3 world-view-projection ; c4 camera position ; v0 3 float vertex position ; v1 1 float per-vertex sprite size ; Transform the position into screen space. m4x4 oPos, v0, c[ 0 ] ; Calculate 1/distance from vert to eye point sub r0, v0, c4 dp3 r0, r0, r0 rsq r0, r0 ; Compute point size for sprites mul r0, r0, v1.x ; Clamp to >= min point size max r0, r0, c9.x ; Clamp to <= max point size min oPts, r0, c9.y