Not very well tested, but the loopback client works. Still missing entity
alpha, lerpfinish and a few other things.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Currently not supported by the software renderer. Intersecting bmodel
surfaces will behave weirdly (and people tend to assume it does work,
because glquake handle's it just fine).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This really seems like a thinko to me. Patch below.
snd_mix.c (SND_InitScaletable): fixed an off-by-one mistake in the
signed char conversion.
Signed-off-by: Ozkan Sezer <sezero@users.sourceforge.net>
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Pre-calculate the frustum clip flags and cull backward facing bmodel
faces. This takes advantage of the surface bbox info and gives a small
speedup on maps having large/complex submodels.
Restructured the main loop in R_DrawBEntitiesOnList so that there are a
few less levels of code indentation there.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Yes, it looks like crap but not really any worse than it looks in glquake.
Will do something to fix it at some stage...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Not used by the edge/span driver at all. If I ever discover I want it back
again... well it's in the commit history.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Pre-calculate frustum clip flags for each node/surface in the PVS by using
a separate walk of the tree before drawing. Doesn't seem to be any
measureable performance benefit, but it was nice to separate this step
from the drawing.
The BSP walk doesn't need to be ordered, so could be done iteratively with
no node stack.
I'm hoping I can apply this to submodels too without too much performance
impact for small models and with some benefit for large, complex models...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Move the logic for checking cached edges into R_EmitCached edge to
simplify R_RenderFace (slightly).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Basically just skip to the next loop iteration if polygon is back facing
and reduce the indentation of the rest of the loop body.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Probably the bigger win comes from skipping over big blocks of zeros 32/64
bits at a time, but it was neat to use the ffsl function in there to take
advantage of hardware instructions to find the next set bit (i.e. bsf on
x86).
Cleaned up the proliforation of "unsigned long" throughout the code and
replaced with the leafblock_t typedef.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Only of interest to someone working on the engine... could tune cache size
if use cases show it's worth it.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Uses unsigned long instead of byte so we don't need to cast between bytes
and int/long and we can use the long type for the bit tests as well. Had
to rewrite the decompress routine so that the bit order is correct within
the long words.
Things not as neat as I'd like on the QWSV side where the whole PVS/PHS
is decompressed - a bit too much pointer arithmetic to juggle but working
for now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Instead of saving the PVS into a static buffer, save the leaf of the
client entity into the server_t struct and look up the PVS as needed. If
it is done frequently, the PVS cache should stop performance from
becoming too terrible.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Constify Mod_PointInLeaf and Mod_{Leaf,Fat}PVS functions. Set a consistent
argument ordering for each, putting the model first. Renamed a couple of
local variables along the way.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Re-implement SV_FatPVS as Mod_FatPVS and move to model.c. The buffer for
the FatPVS can then be allocated the appropraite size at map load time.
Also made the bitwise OR of vis data use unsigned long type for
(potentially) better efficiency.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
No need to keep a separate hunk of memory for the novis data set, may as
well use the cache space. Also fix the memset to be all ones instead of
zeros.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
At level load time, allocate space for decompressed visdata on the hunk.
Not sure that a cache is really necessary in the main case, but wanted to
add it to take care of other users (pr_cmds, sv_main, sv_ents) later.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
A few pieces to this one:
- Convert "minmaxs" member in mnode_t and mleaf_t to vec3_t mins/maxs
- Constify BoxOnPlaneSide arguments
- Rip out the old frustum cull tests and replace with BOPS calls
Should be a small speed improvement, but hard to measure on a modern PC.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>