Commit Graph

1292 Commits

Author SHA1 Message Date
Jonathan 755a9e65ca use std::set instead of vector for original_brushes since we need them implicitly sorted and no dupes
parallelize PruneNodes_R and CalcTreeBounds_r
2022-08-01 13:19:50 -04:00
Jonathan 26a18d5cc3 add logging::header/funcheader to easily and consistently print function or "active routine" headers
add OOP percent_clock wrapper to make printing percents easier, not used yet
2022-08-01 09:35:21 -04:00
Eric Wasylishen aac9513417 qbsp: parallelize MakeTreePortals 2022-07-31 21:39:47 -06:00
Jonathan 6a3e971a11 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-07-30 06:39:20 -04:00
Jonathan e60babdb9c add q3map2-style -blocksize option, using the same algorithm from it. it's optional and disabled by default.
pass through the "use mid split" boolean again
remove node_t::side; appeared to be unused in our current code, and needs to be removed anyways to support the other plane splitters
re-introduce ChooseMidPlaneFromList, but comment it out as it currently fails on a lot of BSPs.
2022-07-30 06:39:14 -04:00
Eric Wasylishen e1b6aba014 portals.cc: log number of tree portals 2022-07-30 00:29:54 -06:00
Jonathan 521daad432 always use world entity for looking for _wad key 2022-07-29 21:20:10 -04:00
Jonathan 77e5990016 set default subdivision to Q2 non-software maximum when Q2 is used (twice as large as Q1) 2022-07-29 13:42:26 -04:00
Jonathan 3ee28fc416 fix crash in light from bounce lighting storage
move bounce lights to a forwardly linked list
fix minlight affecting style 0 for switchables
2022-07-29 00:41:24 -04:00
Jonathan 7810875860 strip trailing spaces from keys 2022-07-28 20:41:43 -04:00
Jonathan dd39bf9940 better print for areaportal warnings 2022-07-28 20:41:33 -04:00
Jonathan 6399c743a7 fix bogus brush splits from old Q2 world extents 2022-07-28 20:00:43 -04:00
Jonathan faa4c38985 fix logging being disabled wrongly at the last steps
remove vertex snapping done as a post-processing step; it causes hall of mirrors and doesn't work the same way as qbsp3. need to find a better option.
2022-07-28 09:21:42 -04:00
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Jonathan e03d99d807 fix spacing 2022-07-28 05:59:06 -04:00
Jonathan d9a9046e46 fix some foot-guns with qbsp_plane_t - type is auto-set now 2022-07-28 05:51:55 -04:00
Jonathan 64cd39c229 add optional vertex snapping to match qbsp3 2022-07-28 03:56:12 -04:00
Jonathan 3fc6225fee although it's rare, if there's a case where a zero-angle triangle is *required* to close up a face (MWT determines it's part of the optimal case), we'll just let it through 2022-07-28 01:35:12 -04:00
Jonathan c9935aaa38 hook up merge and subdivide stats 2022-07-27 23:02:09 -04:00
Jonathan 146f20f677 qbsp_plane_t is now used by other structures, and contains a faster epsilonEqual; since the majority of planes (especially nodes) are going to be axial, there's no need to use the slower full comparison when we can check if the axial component is ready. 2022-07-27 22:44:09 -04:00
Jonathan c5d0c4dc67 use a dummy plane for nodes with only empty leaves 2022-07-27 20:29:53 -04:00
Jonathan 9c73416594 Squashed commit of the following:
change temp-named planeside_ to plane_flipped

commit 8b3938f5069837e76504a16ffd019a8682fd4325
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 05:35:05 2022 -0400

    fix compile errors/warnings

commit 0c19a922490a332a084ceb65bbb88368fecb40a1
Merge: 31edc84e a2451a41
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 05:30:54 2022 -0400

    Merge branch 'brushbsp' into paril/brushbsp_plane2

    # Conflicts:
    #	qbsp/portals.cc
    #	qbsp/tree.cc

commit 31edc84e5a0f16196aacb4e465657954a523ccf9
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 02:55:52 2022 -0400

    use std::map for the two other hashes (edge/vertex) for speed

commit a9bb68b6ea203226d21f73d42558ffe388fc3051
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 02:31:45 2022 -0400

    remove final uses of FindPlane

commit 951a2b1977f813751c93417901a775a7a0cb77f4
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 02:01:19 2022 -0400

    only set flipped status if we actually flipped; this seems to have no affect in practice, but it was wrong in theory

commit 97610203bebb115391ef39ea2b5c6400b9ce2d89
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 01:56:19 2022 -0400

    remove FindPositivePlane

commit d424afbb2cfa32669883f5aafcf34555169eec3e
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 01:22:10 2022 -0400

    side_t uses plane and side_ now

commit af883bc111049a8c6fcb12c8c888e17f03cf30ff
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 00:46:52 2022 -0400

    face_t uses internal plane

commit 1cd776c89b683b0af0d8a642eee7e54b5f54b559
Author: Jonathan <jonno.5000@gmail.com>
Date:   Tue Jul 26 22:59:47 2022 -0400

    node_t using plane directly, pulling planenum in when necessary

commit 8b34312ef9c3d416c011f2694a34fb9d5eba4faa
Author: Jonathan <jonno.5000@gmail.com>
Date:   Tue Jul 26 22:22:28 2022 -0400

    remove PLANENUM_LEAF, use a boolean for the separation
2022-07-27 05:38:50 -04:00
Eric Wasylishen a2451a41fb qbsp: rewrite of q1 contents representation in bspfile.cc
use q2-like bitflags so we can represent mixes like (water | mist), which we need within the compiler
2022-07-27 02:31:49 -06:00
Jonathan 4e3739c751 use a reader/writer-esque lock (shared_mutex) instead of exclusive-only recursive lock to speed up plane stuff 2022-07-24 19:05:28 -04:00
Jonathan f089d0db20 default -nosoftware for qbism 2022-07-22 20:01:36 -04:00
Jonathan f6d6972b17 fix percents being output when not requested for submodels
tjunc using MWT algorithm
2022-07-22 12:25:06 -04:00
Jonathan 09a03d1668 remove delabella 2022-07-21 20:06:33 -04:00
Jonathan 46591c05f9 storing delaunay version 2022-07-21 20:05:55 -04:00
Jonathan f1f11e6f3b Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-07-19 08:42:13 -04:00
Jonathan 989788cf71 add a switch to optimize compiles for no software mode (mainly for Q2)
fix tjunc 3 vert faces being destroyed
2022-07-19 08:41:59 -04:00
Eric Wasylishen 6025585f01 switch from std::any to class hierarchy for content_stats_t
Fixes bogus (huge integers) content stats reporting on macOS (also fix tjunc stats reporting)

having the non-copyable std::atomic<size_t> inside a std::any which must
be copyable was problematic

IMO this is slightly better because it lets us use non-copyable types
2022-07-18 20:13:33 -06:00
Jonathan b6153e3084 use make_unique where appropriate
use unordered_map/set where ordering isn't important (faster for searching and smaller footprint)
2022-07-18 20:16:50 -04:00
Jonathan 6f4f3a56ad make a few errors warnings 2022-07-18 11:27:48 -04:00
Jonathan 7e5c4fe311 fix animation loops 2022-07-18 11:24:22 -04:00
Jonathan 5e90c5c7a1 spacing 2022-07-18 08:57:50 -04:00
Jonathan 577592ce45 adjust tjunc output to match the step orders (input/deformations -> delaunay -> retopo -> rotation -> splitting) 2022-07-16 10:50:13 -04:00
Jonathan acac6cb720 add in a "validator" setting which is just a thin wrapper to another setting type allowing for an additional validation step
simplify the face structure; now, "fragments" just mean the output windings (if you opt out of tjunction fixing, then there will only be 1 fragment with the same values as original_vertices)
move MakeTangentAndBitangentUnnormalized to qvec.hh since we will use it later
-tjunc allows for more fine-grained control now (-notjunc still exists)
-maxedges now throws if you specify a bad value (1 and 2)
remove the checks to OmitFaces - we can tell if a face was omitted because it will have an empty winding
remove static variables from tjunc
2022-07-16 10:45:24 -04:00
Jonathan da9546e260 change settings semantics to be simpler and more clear:
- no more "isLocked" - use getSource directly (locked is a confusing name)
- no more split parse/setValue functions. there's only one entry point each now, and all they do is pass along the source passed to it from its parser.
- no separate setters, use setValue(value, source)
- add a "game target" source, which is low priority and indicates to the user that the value would have been default but was changed to a better value for the game target
2022-07-14 09:03:59 -04:00
Jonathan feb6055b07 remove errors pertaining to MAXEDGES (except on output) since we dynamically expand now
allow command line to specify maxedges
default maxedges to 0 (no limit) for Quake II
2022-07-14 04:57:52 -04:00
Jonathan 4cf81197a3 fix SplitFaceIntoFragments 2022-07-14 02:18:41 -04:00
Jonathan ae4c5cd365 change face output to be slightly more robust
fix tjunc multithreading; added `original_vertices` which is a copy of the `output_vertices` that is safe for tjunc to read from since tjunc writes to the former
2022-07-14 01:56:18 -04:00
Jonathan a435f67f13 fix outputting noisy stuff 2022-07-13 22:26:08 -04:00
Jonathan 8240d753ee Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-07-13 04:35:46 -04:00
Jonathan d9dc54d267 remove vertex rounding
fix vertex hash not including negative axis points
use angle instead of zero-area triangle
2022-07-13 04:35:42 -04:00
Eric Wasylishen d30d4000bc qbsp: fix log spam from BrushBSP 2022-07-13 00:30:53 -06:00
Jonathan 0fb1b429a8 finish tjunc algorithm - can now retopologize by splitting fans up
lower zero-area triangle epsilon
2022-07-12 17:43:25 -04:00
Jonathan 632facc6a7 implement a non-brute force method to reduce vertices to test 2022-07-11 08:29:53 -04:00
Jonathan c1168bc8ae fix tjunc output not actually outputting proper new vertices
allow for basic rotation of face to find a good orientation
2022-07-11 05:12:48 -04:00
Jonathan 1e84284977 fix tjunc using w instead of output_vertices 2022-07-11 02:43:37 -04:00
Jonathan 1aa2a9b250 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	qbsp/qbsp.cc
2022-07-11 01:41:10 -04:00