Center directional light shadow to the cameras eye
- by Caesar
I'm currently drawing my directional light shadow using this view and projection:
XMFLOAT3 dir((float)pitch, (float)yaw, (float)roll);
XMFLOAT3 center(0.0f, 0.0f, 0.0f);
XMVECTOR lightDir = XMLoadFloat3(&dir);
XMVECTOR lightPos = radius * lightDir;
XMVECTOR targetPos = XMLoadFloat3(¢er);
XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f,…