[colobot] 247/377: Fix for fog distance
Didier Raboud
odyx at moszumanska.debian.org
Wed Mar 30 13:34:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit a924cf6a75ed8e38a78b1c74625a7895602a07ab
Author: Tomasz Kapuściński <tomaszkax86 at gmail.com>
Date: Sun Jan 31 00:38:24 2016 +0100
Fix for fog distance
---
src/graphics/engine/engine.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 80d08f8..68f7645 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -3045,7 +3045,7 @@ float CEngine::GetEyeDirV()
bool CEngine::IsVisiblePoint(const Math::Vector &pos)
{
- return Math::Distance(m_eyePt, pos) <= m_deepView[0];
+ return Math::Distance(m_eyePt, pos) <= (m_deepView[0] * m_clippingDistance);
}
void CEngine::UpdateMatProj()
@@ -3142,8 +3142,8 @@ void CEngine::Draw3DScene()
m_device->SetRenderState(RENDER_STATE_LIGHTING, true);
m_device->SetRenderState(RENDER_STATE_FOG, true);
- float fogStart = m_deepView[m_rankView]*m_fogStart[m_rankView];
- float fogEnd = m_deepView[m_rankView];
+ float fogStart = m_deepView[m_rankView] * m_fogStart[m_rankView] * m_clippingDistance;
+ float fogEnd = m_deepView[m_rankView] * m_clippingDistance;
m_device->SetFogParams(FOG_LINEAR, m_fogColor[m_rankView], fogStart, fogEnd, 1.0f);
m_device->SetTransform(TRANSFORM_PROJECTION, m_matProj);
@@ -3818,8 +3818,8 @@ void CEngine::DrawInterface()
m_device->SetRenderState(RENDER_STATE_FOG, true);
- float fogStart = m_deepView[m_rankView]*m_fogStart[m_rankView];
- float fogEnd = m_deepView[m_rankView];
+ float fogStart = m_deepView[m_rankView] * m_fogStart[m_rankView] * m_clippingDistance;
+ float fogEnd = m_deepView[m_rankView] * m_clippingDistance;
m_device->SetFogParams(FOG_LINEAR, m_fogColor[m_rankView], fogStart, fogEnd, 1.0f);
m_device->SetTransform(TRANSFORM_VIEW, m_matView);
@@ -4191,8 +4191,8 @@ void CEngine::DrawShadowSpots()
Math::Vector n(0.0f, 1.0f, 0.0f);
- float startDeepView = m_deepView[m_rankView]*m_fogStart[m_rankView];
- float endDeepView = m_deepView[m_rankView];
+ float startDeepView = m_deepView[m_rankView] * m_fogStart[m_rankView] * m_clippingDistance;
+ float endDeepView = m_deepView[m_rankView] * m_clippingDistance;
float lastIntensity = -1.0f;
for (int i = 0; i < static_cast<int>( m_shadowSpots.size() ); i++)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list