diff --git a/Engine/Graphics/3DRenderer.cpp b/Engine/Graphics/3DRenderer.cpp index 6851577..b7bb07c 100644 --- a/Engine/Graphics/3DRenderer.cpp +++ b/Engine/Graphics/3DRenderer.cpp @@ -283,8 +283,8 @@ float Graphic3DRenderer::ComputeSGRatio() { // The triangle made by the ground plane intersection with the frustum. This intersection // cross the far plane at some point. Instead of computing the coordinate of the point, we // directly use the far plane length to get the corresponding ratio for the screen. - sgRatio = -(altitude * fovCos - mMainCamera->GetFarZ() * fovThetaSin) - / (2.f * mMainCamera->GetFarZ() * fovSin * thetaCos); + sgRatio = -(altitude * fovCos - 1000.f * fovThetaSin) + / (2.f * 1000.f * fovSin * thetaCos); } // Clamp diff --git a/Engine/Graphics/Camera.cpp b/Engine/Graphics/Camera.cpp index 86716ff..ab99709 100644 --- a/Engine/Graphics/Camera.cpp +++ b/Engine/Graphics/Camera.cpp @@ -8,7 +8,6 @@ Camera::Camera() { void Camera::SetFrustrum(float fov, float r, float zn, float zf) { //if (!frameDirty) this->fov = fov; - this->zf = zf; M3D_MATRIX pMat = M3D_TransformMatrixFrustrumFovLH(M3D_Deg2Rad(fov), r, zn, zf); M3D_V4StoreF4x4(&mProjMat, pMat); frustrumUpdated = true; diff --git a/Engine/Graphics/Camera.hpp b/Engine/Graphics/Camera.hpp index 7f3f2d1..72e800a 100644 --- a/Engine/Graphics/Camera.hpp +++ b/Engine/Graphics/Camera.hpp @@ -14,7 +14,6 @@ public: Camera& operator= (Camera const&) = delete; float GetFoV() const { return fov; } - float GetFarZ() const { return zf; } const bool IsFrustrumUpdated() const { return frustrumUpdated; } const bool IsCameraMoved() const { return camMoved; } M3D_VECTOR GetPos() const { return M3D_V4LoadF3(&mPos); } @@ -45,7 +44,6 @@ public: private: float fov; // It's the Y-FoV! - float zf; bool frustrumUpdated = true; bool camMoved = true;