From ecaccfd0e08a9c28561149f745730526e47b5db0 Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sun, 1 Dec 2024 11:49:36 +0100 Subject: [PATCH] Some defines --- Engine/Graphics/3DRenderer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Engine/Graphics/3DRenderer.cpp b/Engine/Graphics/3DRenderer.cpp index e285418..3b3c175 100644 --- a/Engine/Graphics/3DRenderer.cpp +++ b/Engine/Graphics/3DRenderer.cpp @@ -3,7 +3,8 @@ #include "../World/DbgCube.hpp" #include "../World/Tank.hpp" -//#define DISABLE_INVISIBLE_VERTICES +//#define DISABLE_AABB_CLIPPING +//#define DISABLE_TRIANGLE_CLIPPING // Rendering pipeline: @@ -113,7 +114,7 @@ void Graphic3DRenderer::Draw(sf::RenderTexture& context) { // Object outside frustrum clipping projAABB.Transform(projAABB, oTMat); M3D_ContainmentType objInFrustrum = camFrustrum.Contains(projAABB); -#ifndef DISABLE_INVISIBLE_VERTICES +#ifndef DISABLE_AABB_CLIPPING if (objInFrustrum != DISJOINT) #endif { @@ -140,10 +141,12 @@ void Graphic3DRenderer::Draw(sf::RenderTexture& context) { break; // Triangle clipping - //TODO: scissor/clipping depending of how many vertices are outside/inside the clipspace, implement complete Cohen-Sutherland algo or similar +#ifndef DISABLE_TRIANGLE_CLIPPING + //TODO: scissor/clipping depending of how many vertices are outside/inside the clipspace, implement complete Cohen-Sutherland algo or Cyrus–Beck one if (VertexClipTest(projVertices[indicePtr[i]], mRTSize, 2.5f) && VertexClipTest(projVertices[indicePtr[i+1]], mRTSize, 2.5f) && VertexClipTest(projVertices[indicePtr[i+2]], mRTSize, 2.5f)) +#endif { M3D_VECTOR V1 = M3D_V4LoadF4(&projVertices[indicePtr[i]]);