Add some portal segment culling and disable sector portals for now
This commit is contained in:
parent
dc07c2075f
commit
f1df400cc7
10 changed files with 129 additions and 29 deletions
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
void PolyCull::CullScene(const TriMatrix &worldToClip, const Vec4f &portalClipPlane)
|
||||
{
|
||||
ClearSolidSegments();
|
||||
PvsSectors.clear();
|
||||
frustumPlanes = FrustumPlanes(worldToClip);
|
||||
PortalClipPlane = portalClipPlane;
|
||||
|
|
@ -42,8 +41,6 @@ void PolyCull::CullScene(const TriMatrix &worldToClip, const Vec4f &portalClipPl
|
|||
CullSubsector(subsectors);
|
||||
else
|
||||
CullNode(nodes + numnodes - 1); // The head node is the last node output.
|
||||
|
||||
ClearSolidSegments();
|
||||
}
|
||||
|
||||
void PolyCull::CullNode(void *node)
|
||||
|
|
@ -109,6 +106,18 @@ void PolyCull::ClearSolidSegments()
|
|||
SolidSegments.push_back({ SolidCullScale , 0x7fff });
|
||||
}
|
||||
|
||||
void PolyCull::InvertSegments()
|
||||
{
|
||||
TempInvertSolidSegments.swap(SolidSegments);
|
||||
ClearSolidSegments();
|
||||
int x = -0x7fff;
|
||||
for (const auto &segment : TempInvertSolidSegments)
|
||||
{
|
||||
MarkSegmentCulled(x, segment.X1 - 1);
|
||||
x = segment.X2 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
bool PolyCull::IsSegmentCulled(int x1, int x2) const
|
||||
{
|
||||
x1 = clamp(x1, -0x7ffe, 0x7ffd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue