Skip to content

Commit

Permalink
xrRender: implement simple occlusion culling for particles on OpenGL …
Browse files Browse the repository at this point in the history
…render
  • Loading branch information
eagleivg authored and Xottab-DUTY committed May 8, 2020
1 parent 7c7b027 commit 5b421e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Layers/xrRender/ParticleEffect.cpp
Expand Up @@ -643,6 +643,13 @@ void CParticleEffect::Render(float)
TAL_SCOPED_TASK_NAMED("CParticleEffect::Render()");
#endif // _GPA_ENABLED

#ifdef USE_OGL
// Due to the big impact on performance
const float distSQ = RDEVICE.vCameraPosition.distance_to_sqr(m_InitialPosition) + EPS;
if (distSQ > _sqr(100.f*psVisDistance))
return;
#endif

u32 dwOffset, dwCount;
// Get a pointer to the particles in gp memory
PAPI::Particle* particles;
Expand Down

0 comments on commit 5b421e6

Please sign in to comment.