summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/rw/VisibilityPlugins.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index 5184860b..46ec8ae2 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -557,12 +557,16 @@ RpAtomic*
CVisibilityPlugins::RenderPedCB(RpAtomic *atomic)
{
int32 alpha;
+ RwV3d cam2atm;
- alpha = GetClumpAlpha(RpAtomicGetClump(atomic));
- if(alpha == 255)
- AtomicDefaultRenderCallBack(atomic);
- else
- RenderAlphaAtomic(atomic, alpha);
+ RwV3dSub(&cam2atm, &RwFrameGetLTM(RpAtomicGetFrame(atomic))->pos, ms_pCameraPosn);
+ if(RwV3dDotProduct(&cam2atm, &cam2atm) < ms_pedLod1Dist){
+ alpha = GetClumpAlpha(RpAtomicGetClump(atomic));
+ if(alpha == 255)
+ AtomicDefaultRenderCallBack(atomic);
+ else
+ RenderAlphaAtomic(atomic, alpha);
+ }
return atomic;
}