diff --git a/ref/gl/gl_cull.c b/ref/gl/gl_cull.c index a897db8a..9316207e 100644 --- a/ref/gl/gl_cull.c +++ b/ref/gl/gl_cull.c @@ -67,16 +67,15 @@ int R_CullSurface( const msurface_t *surf, const gl_frustum_t *frustum, uint cli { cl_entity_t *e = RI.currententity; - if( unlikely( !e || !surf || !surf->texinfo || !surf->texinfo->texture )) + if( surf->visframe != tr.framecount && e == CL_GetEntityByIndex( 0 )) + return CULL_VISFRAME; + + if( unlikely( !surf->texinfo || !surf->texinfo->texture )) return CULL_OTHER; if( unlikely( r_nocull.value )) return CULL_VISIBLE; - // world surfaces can be culled by vis frame too - if( e == CL_GetEntityByIndex( 0 ) && surf->visframe != tr.framecount ) - return CULL_VISFRAME; - // only static ents can be culled by frustum if( !R_StaticEntity( e )) frustum = NULL; diff --git a/ref/gl/gl_frustum.c b/ref/gl/gl_frustum.c index 06e54af6..e3aa897e 100644 --- a/ref/gl/gl_frustum.c +++ b/ref/gl/gl_frustum.c @@ -165,6 +165,9 @@ qboolean GL_FrustumCullSphere( const gl_frustum_t *out, const vec3_t center, flo if( unlikely( r_nocull.value )) return false; + if( !iClipFlags ) + return false; + for( i = FRUSTUM_PLANES, bit = 1; i > 0; i--, bit <<= 1 ) { const mplane_t *p = &out->planes[FRUSTUM_PLANES - i];