clamp rendering cover points to 50 units

changes from az render cover points
This commit is contained in:
marauder2k7 2025-07-31 19:12:26 +01:00
parent b9193072c1
commit 78a553a74f
2 changed files with 14 additions and 3 deletions

View file

@ -31,6 +31,7 @@
#include "gfx/gfxDrawUtil.h"
#include "renderInstance/renderPassManager.h"
#include "console/engineAPI.h"
#include "T3D/gameBase/gameConnection.h"
extern bool gEditingMission;
@ -285,14 +286,22 @@ void CoverPoint::prepRenderImage(SceneRenderState *state)
void CoverPoint::render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat)
{
initGFXResources();
if (!state->isDiffusePass()) return;
if(overrideMat)
GameConnection* conn = GameConnection::getConnectionToServer();
MatrixF camTrans;
conn->getControlCameraTransform(0, &camTrans);
if ((getPosition() - camTrans.getPosition()).lenSquared() > 2500) return; //50 unit clamp
if (overrideMat)
return;
initGFXResources();
if(smVertexBuffer[mSize].isNull())
return;
PROFILE_SCOPE(CoverPoint_Render);
// Set up a GFX debug event (this helps with debugging rendering events in external tools)

View file

@ -427,6 +427,8 @@ void duDebugDrawTorque::clearCache()
void duDebugDrawTorque::render(SceneRenderState* state)
{
if (!state->isDiffusePass()) return;
const Frustum& frustum = state->getCameraFrustum();
for (U32 i = 0; i < mDrawCache.size(); ++i)