5. Given that the angle between vectors $a$ and $b$ is $45^{\circ}$, and
$$
\begin{array}{l}
|a|=4, \\
\left(\frac{1}{2} a+b\right) \cdot(2 a-3 b)=12 .
\end{array}
$$

Then the projection of $\boldsymbol{b}$ onto $\boldsymbol{a}$ is equal to ( ).
(A) $\sqrt{2}$
(B) 4
(C) $4 \sqrt{2}$
(D) 1
5. D.

From the given information, we have
$$
\begin{array}{l}
a^{2}+\frac{1}{2} a \cdot b-3 b^{2}=12 \\
\Rightarrow|a|^{2}+\frac{1}{2}|a||b| \cos \theta-3|b|^{2}=12 \\
\Rightarrow 16+\frac{1}{2} \times 4|b| \cos 45^{\circ}-3|b|^{2}=12 .
\end{array}
$$

Solving, we get $|b|=\sqrt{2}$.
Thus, the projection of $\boldsymbol{b}$ in the direction of $\boldsymbol{a}$ is $|\boldsymbol{b}| \cos 45^{\circ}=1$.