When I swtich to 100% Ortho then the result is messed up, any ideas why?
protected void GenerateProjectionMatrix()
{
var presentationParameters = GraphicsDevice.PresentationParameters;
var aspectRatio = (float)presentationParameters.BackBufferWidth / (float)presentationParameters.BackBufferHeight;
// Combination of orthographic and perspective
var width = 512f;
var height = width / aspectRatio;
_projection = Matrix.CreateOrthographic(width, height, _nearClipPlane, _farClipPlane);
// Add slight perspective effect
if (EnableMix)
{
var perspective = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45f), aspectRatio, _nearClipPlane, _farClipPlane);
_projection = Matrix.Lerp(perspective , _projection, OrthoFactor);
}
else if (!OrthoOnly)
{
var perspective = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45f), aspectRatio, _nearClipPlane, _farClipPlane);
_projection = perspective;
}
}
All I am changing is the boolean to enable the ortho-only mode.
The result is the same, no matter how near or far I am.