mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 12:30:32 +00:00
- activate r_line_distance_cull in the hardware renderer
# Conflicts: # src/gl/scene/gl_bsp.cpp
This commit is contained in:
parent
358718de05
commit
373870787f
1 changed files with 17 additions and 0 deletions
|
@ -77,6 +77,21 @@ void GLSceneDrawer::UnclipSubsector(subsector_t *sub)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
EXTERN_CVAR(Float, r_line_distance_cull)
|
||||
|
||||
inline bool IsDistanceCulled(seg_t *line)
|
||||
{
|
||||
double dist3 = r_line_distance_cull * r_line_distance_cull;
|
||||
if (dist3 <= 0.0)
|
||||
return false;
|
||||
|
||||
double dist1 = (line->v1->fPos() - r_viewpoint.Pos).LengthSquared();
|
||||
double dist2 = (line->v2->fPos() - r_viewpoint.Pos).LengthSquared();
|
||||
if ((dist1 > dist3) && (dist2 > dist3))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void GLSceneDrawer::AddLine (seg_t *seg, bool portalclip)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
@ -123,6 +138,8 @@ void GLSceneDrawer::AddLine (seg_t *seg, bool portalclip)
|
|||
|
||||
uint8_t ispoly = uint8_t(seg->sidedef->Flags & WALLF_POLYOBJ);
|
||||
|
||||
if (IsDistanceCulled(seg)) { clipper.SafeAddClipRange(startAngle, endAngle); return; }
|
||||
|
||||
if (!seg->backsector)
|
||||
{
|
||||
clipper.SafeAddClipRange(startAngle, endAngle);
|
||||
|
|
Loading…
Reference in a new issue