From 688315ab76145a32d0aebf826fbbb7fc9ce24443 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 20 Oct 2012 23:06:56 +0200 Subject: ComputeSphereVisibility and fixes in CEngine TODOs - view frustum culling with ComputeSphereVisibility - game should run faster now - resolved/removed most TODOs from CEngine - fixed OpenGL tests --- src/graphics/engine/water.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/graphics/engine/water.cpp') diff --git a/src/graphics/engine/water.cpp b/src/graphics/engine/water.cpp index 18811eb..6c822b3 100644 --- a/src/graphics/engine/water.cpp +++ b/src/graphics/engine/water.cpp @@ -386,9 +386,11 @@ void CWater::DrawSurf() Math::Vector p = pos; p.x += size*(m_lines[i].len-1); float radius = sqrtf(powf(size, 2.0f)+powf(size*m_lines[i].len, 2.0f)); - if ( Math::Distance(p, eye) > deep+radius ) continue; + if (Math::Distance(p, eye) > deep + radius) + continue; - // TODO: ComputeSphereVisibility + if (device->ComputeSphereVisibility(p, radius) != Gfx::FRUSTUM_PLANE_ALL) + continue; int vertexIndex = 0; -- cgit v1.2.3-1-g7c22