mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-01 21:41:12 +00:00
- activate r_line_distance_cull in the hardware renderer
This commit is contained in:
parent
58f4af6ded
commit
4e968d9c4c
1 changed files with 17 additions and 0 deletions
|
@ -75,6 +75,21 @@ void HWDrawInfo::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 HWDrawInfo::AddLine (seg_t *seg, bool portalclip)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
@ -123,6 +138,8 @@ void HWDrawInfo::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