Let X⊆Pm be a totally real, non-degenerate, projective variety and let Γ⊆X(R) be a generic set of points. Let P be the cone of nonnegative quadratic forms on X and let Σ be the cone of sums of squares of linear forms. We examine the dimensions of the faces P(Γ) and Σ(Γ) consisting of forms in P and Σ, which vanish on Γ. As the cardinality of the set Γ varies in 1,2,…,codim(X), the difference between the dimensions of P(Γ) and Σ(Γ) defines a numerical invariant of X, which we call the gap vector of X. Our main result is a formula relating the components of the gap vector of X and the quadratic deficiencies of X and its generic projections. Using it, we prove that gap vectors are weakly increasing, obtain upper bounds for their rate of growth and prove that these upper bounds are eventually achieved for all varieties. Moreover, we give a characterization of the varieties with the simplest gap vectors: we prove that the gap vector vanishes identically precisely for varieties of minimal degree, giving another proof that P≠Σ when X is not a variety of minimal degree [4]. We also characterize the varieties whose gap vector equals (0,…,0,1).