Commit graph

95 commits

Author SHA1 Message Date
Bill Currie
2ea143283c Rewrite mightsee_more to manipulate the sets directly.
While using set operators was clearer, it was rather expensive (about 25s
for gmsp3v2). qfvis now completes the map in about 695s (single threaded).
About 15s faster than tyr for the same conditions (1 thread, level 4).
2013-03-16 21:51:41 +09:00
Bill Currie
195bdcb92f Rework FindSeparators to make use of the winding direction.
This is the second part of the separator search optimization from tyrutils
vis. With this, qfvis is getting close to tyrutils vis when
running single threaded (qfvis is suffering some nasty thread contention
and thus can't get below about 350 seconds with 4 threads). 808s vs 707s.
2013-03-15 22:05:01 +09:00
Bill Currie
9b10304c2f Make CopyWinding const-correct. 2013-03-15 19:25:24 +09:00
Bill Currie
5a2ee06787 Reverse the winding for backside portals.
This is part 1 of another optimization from tyrutils vis. It seems that
just reversing the winding gives a tiny speedup.
2013-03-15 19:22:57 +09:00
Bill Currie
46d41ad9ac Split up separator finding and winding clipping.
Interesting, it makes very little (maybe faster) difference to find all the
separators for levels 3 and 4. This might be due to the higher levels using
most of the planes to fully clip source away. Anyway, it makes the code a
little clearer (one function, one task).
2013-03-15 16:00:39 +09:00
Bill Currie
f80ae52828 Make vis's ClipWinding const-correct. 2013-03-15 15:28:25 +09:00
Bill Currie
77c858060d Add a bunch more statistics.
Now I know why sphere culling was a loss: 78% of all tested target portals
were trimmed by ClipToSeparators (50% eventually clipped away entirely).
2013-03-14 19:43:46 +09:00
Bill Currie
8032d1d4d1 Split out the mightsee intersection/subset tests.
Having the code in separate functions makes the flow in the main loop a
little easier to follow.
2013-03-14 19:43:46 +09:00
Bill Currie
eec87bd61b Remove thread from stack_t.
It really wasn't gaining anything and made reading the code a little
harder.
2013-03-14 19:43:46 +09:00
Bill Currie
057a5cc624 Make BasePortalVis another 17% faster.
I had forgotten to skip the refined tests when the sphere was entirely on
the relevant side of the plane. Now BasePortalVis for gmsp3v2 takes 11s on
my machine (it was 13 with the previous optimization and 15.9 before that).

Also, write some comments describing how BasePortalVis works.
2013-03-14 14:01:26 +09:00
Bill Currie
5d6df082f2 Move the vis stats vars into thread data.
This should make the stats more reliable when running multi-threaded
(chains is still random, but it seems there are set access issues).
2013-03-14 12:52:40 +09:00
Bill Currie
0cae04d71a Alter test_sphere to return -1, 0 or 1.
Representing the side of the plane on which the sphere lies is much more
useful as more complicated tests can be done using just the one call.
-1: the sphere is entirely on the back side of the plane
 0: the sphere is intersecting the plane
 1: the sphere is entirely on the front side of the plane
2013-03-14 09:05:26 +09:00
Bill Currie
b9d71218f6 Use sphere culling in the base vis.
Base vis was done first for testing. Optimized base vis is down to ~12.4s
from ~16s (29% faster?).
2013-03-13 21:32:18 +09:00
Bill Currie
fe55bb678e Set the default level to 4.
It was supposed to be 2, but for some reason I neglected to set it when I
set up the options parsing. However, level 4 is the standard for production
maps, and it happens to be faster than level 2 (at least for gmsp3v2.bsp)
2013-03-09 15:01:54 +09:00
Bill Currie
3232c22795 Implement mightsee updates from tyrutils.
It doesn't seem to make much difference, but I suspect that's my set code
not being optimal for the job.
2013-03-09 14:32:51 +09:00
Bill Currie
d1e65257b6 Implement the cached separators idea from tyrutils.
I think the reason I didn't think of that when I tried to improve qfvis's
performance many years ago is I just simply did not understand
ClipToSeparators. However, the difference caching the separators makes is
phenomenal. Before the change, single threaded qfvis would get stuck on one
particular portal for at least a day (I gave up waiting), but now even a
debug build will complete gmsp3v2.bsp in less than 12 minutes (4 threads on
my quad-core). And that's at level 2! Getting stuck for a day was at level
0.
2013-03-08 22:20:29 +09:00
Bill Currie
dbdfdb6d28 Add support for PRT2 portal files.
These seem to be identical to PRT1-AM but with a different count order in
the header. Taken from tyrutils-0.5.
2013-03-07 18:51:32 +09:00
Bill Currie
0649fd7022 Correct some verbosity levels. 2013-03-07 18:51:23 +09:00
Bill Currie
4e87072d93 Fix a bunch of whitespace. 2013-03-07 14:31:00 +09:00
Bill Currie
4ccb4a4667 Make the test and vis set pointers const. 2013-03-07 14:28:15 +09:00
Bill Currie
281c5f185d Correct the "can see anything new" check.
I had the super-set and sub-set parameters backwards, but that's because I
had misinterpreted the old code.
2013-03-07 14:24:30 +09:00
Bill Currie
81e4d3072c Plug a bunch of memory leaks.
Not that they really matter, but it makes reading valgrind's output a
little easier.
2013-03-07 13:42:19 +09:00
Bill Currie
9b4beaf3f8 Use a set for portalsee.
This removes the hard coding of the size of portalsee, which looks to have
been too small for some maps.
2013-03-07 11:35:08 +09:00
Bill Currie
299ff8f575 Use set functions for qfvis.
While noticeably slower than the previous expanded set manipulation code,
this is much easier to read. I can worry about optimizing the set code when
I get qfvis behaving better.
2013-03-07 11:06:55 +09:00
Bill Currie
f1aefc969d Fix some 64-bit mingw compile issues.
Just one more issue to fix (alloca), but with a hack, QF compiles (no clue
yet if it works: wine doesn't seem to be an option at this stage)
2013-01-22 21:02:49 +09:00
Bill Currie
a37c5465e1 First step for BSP2 support. DOES NOT WORK!
All of the nastiness is hidden in bspfile.c (including the old bsp29
specific data types). However, the conversions between bsp29 and bsp2 are
implemented but not yet hooked up properly. This commit just gets the data
structures in place and the obvious changes necessary to the rest of the
engine to get it to compile, plus a few obvious "make it work" changes.
2012-09-07 16:09:24 +09:00
Bill Currie
a2f2d4d949 "Check" for the availability of pthreads.
Unfortunately, just because the header is there doesn't mean anything will
actually work :(. Also, the check is based on the host vendor/os for now.
Yes, it's rather lame but it will do for now.

With this, QF will build on an almost fresh ps3toolchain install. Only two
"fixes" are needed:
 o  In $PS3DEV/ppu/powerpc64-ps3-elf: ln -s ../include sys-include
 o  libsamplerate cross-built and installed.
2012-08-19 13:40:42 +09:00
Bill Currie
23a38738fc Massive whitespace cleanup.
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie
bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie
eefa89e72e Remove the AM_CONDITIONALs from tools.
Now that the tools directories aren't entered when those tools aren't being
built, there's no reason to use AM_CONDITIONAL in there.
2012-02-10 02:50:42 +09:00
Bill Currie
c0f7b4ba37 Fix qfvis for android.
pthread_cancel is not (and will not be) implemented, so rework the thread
finalization to not need it.
2012-02-05 14:29:46 +09:00
Bill Currie
de04e1b602 Lots of win32 (mingw cross) build fixes.
HTTP (curl) support is missing, but everything else builds.
2010-12-23 11:40:16 +09:00
Bill Currie
4ed7290d9f Fix an uninitizized variable. 2010-11-28 15:31:36 +09:00
Bill Currie
49ea878ad9 Slightly more informative progress.
Display per-thread current portal number. Will get messy if there are more threads than the screen width can handle.
2010-11-21 09:56:31 +09:00
Bill Currie
142defe9c0 Parameter consistency fixes.
Make the params for FreeWinding and CopyWinding consistent with those in
qfbsp. This fixes some doxygen warnings while I think about how best to
handle the duplicate code.
2010-10-13 20:52:07 +09:00
Bill Currie
f4042c5b91 Make the bsp disk data structures type size independent.
However, this assumes float is always 32 bits.

Also use size_t for the *size fields in bsp_t and clean up the mess.
2010-10-13 20:52:05 +09:00
Bill Currie
a51e888a1b Nuke MAX_OSPATH and clean up the mess. 2010-08-25 13:31:08 +09:00
Bill Currie
669771681a split up and modernize configure.ac
Most of the guts of configure.ac have been moved to config.d and are then
brought in by m4_include. This will make maintaining configure.ac much easier.

Also drop use of PROGRAM and VERSION, using PACKAGE_NAME, PACKAGE_VERSION, and
on occasion, PACKAGE_STRING instead, and clean out some old files we no longer
need.
2010-08-19 15:01:43 +09:00
Bill Currie
0dfff8fd58 ignore stuff 2010-08-07 10:42:09 +00:00
Bill Currie
997102fea8 audit the usage of "only"
There are still a few iffy places (notably around certain prepositions), but
the relevant sentences are now much easier to read.
2010-01-13 06:42:26 +00:00
Bill Currie
ff132bb536 64bit windows patch from phrosty 2007-04-04 07:48:14 +00:00
Bill Currie
3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Bill Currie
501180aaac gcc-4.0 fixes. even found some bugs :) (names /not/ mangled this time) 2005-06-08 06:35:48 +00:00
Bill Currie
38c5b92086 fix a really stupid error (missing {}s) that caused vis data to basicly get
lost when reading the new portal file format
2004-03-19 02:20:47 +00:00
Bill Currie
9e6be1e029 hopefully handle \r\n endings 2004-03-19 00:41:14 +00:00
Ragnvald Maartmann-Moe IV
527342d80d Whitespace, codingstyle, pouncing shalraths. 2004-02-08 02:53:58 +00:00
Bill Currie
371a0b8e75 support old-style portal files again 2004-02-02 05:44:46 +00:00
Bill Currie
39c0a0f08d make cluster recursion a warning rather than an error (see how this goes) 2003-09-24 00:59:53 +00:00
Bill Currie
0db01f41fb progress "meter" 2003-09-12 23:13:11 +00:00
Bill Currie
0a8867fde9 replace all VectorSubtract (vec3_origin, ... and
VectorCopy (vec3_origin, ... with VectorNegate (... and VectorZero (...,
respectively. Should be a small speedup.
2003-09-03 22:17:04 +00:00