More Visibility Progress

David Etherton (etherton@megatek.com)
Wed, 20 Mar 1996 23:13:19 +0800

Date: Wed, 20 Mar 1996 23:13:19 +0800
From: etherton@megatek.com (David Etherton)
Message-Id: <9603210713.AA22306@fuzz.megatek>
To: quake-editing@nvg.unit.no
Subject: More Visibility Progress

Okay, here's what I've been able to nail down.

- If a leaf's visibility offset is -1, this means that it can see all
other leaves. Likewise, all other leaves can see this one. I determined
this by setting every leaf's offset to -1 in test1.bsp and then noting
that the reverse BSP draw now showed the entire level (and the framerate
dropped even more).

- The visibility list is 1-based, not 0-based. Furthermore, individual
bits are encoded using (1<<((offset-1)&7).

With this new formula, I was able to finally verify that every leaf's
visibility list does indeed contain its own leaf. So, in other words,
the visibility list

10 ff 00 03 7f

"unpacks" to

10 ff 00 00 00 7f

Leaf 5 is visible because 0x10 & (1<<((5-1)&7)) is true.
Leaves 9-16 are visible, leaves 1,2,3,4,6,7,8,17-40 are
not visible, and leaves 41-47 are visible. Leaf 48 is
not visible either. (It's almost midnight here, hope I
didn't screw that up).

Hope this helps,

-Dave