Commit Graph

1665 Commits

Author SHA1 Message Date
Jonathan d36e2f5114 --scale option for BSPUtil to do a post-process scale 2023-06-12 15:23:47 -04:00
Eric Wasylishen 9c6f6c2589 common: change FError to throw an exception 2023-06-03 22:24:20 -06:00
Eric Wasylishen d38ef2d8af qbsp: allow _litwater/_splitturb as a bmodel key
supports both opt-in and opt-out
2023-05-28 23:44:57 -06:00
Eric Wasylishen f6d5e6e24d qbsp: fix test failure in last commit (stale pointers in map.hashedges) 2023-05-28 16:51:20 -06:00
Eric Wasylishen 731bafd9fe qbsp: fix edge reuse causing software renderer artifacts with liquids
fixes q1_liquid_software.map in tyrquake
thanks to Mankrip for reporting this
2023-05-28 16:28:33 -06:00
Eric Wasylishen ed7a684583 qbsp: remove dead code contents_are_mirrored() 2023-05-28 11:43:30 -06:00
Eric Wasylishen fa890456f6 qbsp: don't merge faces across sky boundaries 2023-05-27 23:42:33 -06:00
Eric Wasylishen 2703761edb bsputil: fix --extract-textures writing in text mode
also correction to .prt writing, always use text mode
2023-05-27 16:56:07 -06:00
Jonathan 9d57f6dae7 fix region texture names getting picked up by accident 2023-05-23 17:54:20 -04:00
Eric Wasylishen 261d6da37d qbsp: revert b994bb7 "disable CheckPlaneAgainstVolume checks"
it was causing leaks through solids
2023-05-22 23:01:07 -06:00
Eric Wasylishen 752cd95c02 qbsp: -debugexpand: write to .bsp output dir 2023-05-20 21:17:14 -06:00
Random c6ea63ba95
made CMake relative for use as a sub-project within other CMake projects (#356) 2023-05-10 19:45:51 -06:00
Jonathan 0ab3aae111 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	common/bspfile.cc
2023-05-08 17:47:12 -04:00
Jonathan 1548f25daf allow individual brush chop control
allow passing _surflight_targetname to set targetnames for switchable lights on bmodels
2023-05-08 17:44:32 -04:00
Eric Wasylishen d9e16a943a qbsp: add -noextendedsurfflags flag to suppress .texinfo writing (for testing/debugging) 2023-05-07 23:56:30 -06:00
Eric Wasylishen 18a7df1a1b style: reformat 2023-05-07 21:44:29 -06:00
Eric Wasylishen 3e446e6ea6 qbsp, light: fix inheriting minlight from worldspawn
Update q2_light_group.map to support this
2023-05-07 21:44:29 -06:00
Eric Wasylishen b994bb750d brushbsp: disable CheckPlaneAgainstVolume checks
this check prevents splitting on small brush fragments, where we actually need to split.
if we don't the small fragments cause incorrect leaf contents to be assigned.
2023-05-05 23:07:16 -06:00
Eric Wasylishen 5d142e4ab2 qbsp: remove -contenthack (dead code) 2023-05-01 22:38:00 -06:00
Eric Wasylishen 0628f768e2 qbsp: minor clarification in SplitBrush 2023-04-29 12:26:48 -06:00
Jonathan bd047020d2 fix antiportals up a bit 2023-04-29 13:40:34 -04:00
Jonathan 5777fdf914 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-04-28 13:32:00 -04:00
Jonathan 39a54abfc6 add support for a region brush (code needs to be cleaned up a bit though)
allow _surflight_style on brush models
2023-04-28 13:31:50 -04:00
Eric Wasylishen 537bc3686d qbsp: experimental -scale flag for applying uniform scale to map 2023-04-25 18:41:21 -06:00
Jonathan 6035290c70 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	include/common/imglib.hh
#	light/entities.cc
#	light/light.cc
#	light/surflight.cc
2023-04-24 02:19:04 -04:00
Jonathan dddc48e98b simplify `needs_write` for surfflags
add `_surflight_color` key; allows overriding surface light color on an entity basis
load the .wal from wal_json and use the values as a base, if they exist
allow `_surflight_minlight_scale` to be specified on entities
2023-04-24 02:16:39 -04:00
Eric Wasylishen 50d97321d7 qbsp: add -bmodelcontents flag 2023-04-22 19:15:55 -06:00
Eric Wasylishen a2d89e3307 qbsp: q1: fix visportals being created to solid leafs
fixes crash on ej3_cc.map
2023-04-17 23:42:00 -06:00
Eric Wasylishen ed756bd602 common: add support for writing .rst documentation from settings 2023-04-16 14:55:43 -06:00
Eric Wasylishen e069d7b9b8 style: update settings api to follow current coding style 2023-04-16 11:55:38 -06:00
Eric Wasylishen 8d368060eb qbsp: sealing: in hull1/2 treat onnode point entities as being in empty space 2023-04-07 17:06:56 -06:00
Jonathan 00bcead0fb Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-04-03 05:26:49 -04:00
Jonathan a0e98242a4 fix hintskip; when loading a hint brush, mark all other sides as hintskip 2023-04-03 05:26:41 -04:00
Eric Wasylishen 68eaf37e40 qbsp: q1: fix detail to be non-sealing again 2023-03-27 21:43:54 -06:00
Eric Wasylishen 8830a949e6 qbsp: only print "doesn't touch two areas" once per entity
log source location as well
2023-03-27 20:15:19 -06:00
Eric Wasylishen 2a2bc5d966 qbsp: clean up debug spam from DebugAreaPortalBothSidesLeak 2023-03-27 20:09:01 -06:00
Eric Wasylishen 4569ab1b33 qbsp: delete leftover areaportal leak files on startup 2023-03-27 20:05:33 -06:00
Jonathan d067630bc1 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-03-27 03:23:19 -04:00
Eric Wasylishen d7db2bdae5 qbsp: debug helper for finding areaportal leaks 2023-03-27 01:20:53 -06:00
Eric Wasylishen f12cefb2c9 qbsp: if Q2_CONTENTS_SOLID bit is set, always assign invalid area 2023-03-26 19:02:25 -06:00
Jonathan 0bab917dc4 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-03-26 20:24:51 -04:00
Eric Wasylishen 759811b548 qbsp: fix Portal_EntityFlood check 2023-03-26 18:04:06 -06:00
Jonathan 1dcfe58563 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-03-26 18:29:41 -04:00
Jonathan 5daaeee6fb allow `surflight_minlight_scale` to be specified per brush 2023-03-26 18:29:37 -04:00
Eric Wasylishen 6e064ae3c7 qbsp: restore detail to non-sealing 2023-03-26 16:20:10 -06:00
Eric Wasylishen 3c408f5d30 qbsp: better debug visualization for "missing portal sides" warning
writes a .missing_portal_sides.prt file for inspection in TB
2023-03-26 14:09:54 -06:00
Eric Wasylishen 7b7cabaf09 qbsp: don't merge above- and below- water faces in Q1 mode
works around caustics effects in ezQuake/nQuake leaking onto above-water faces.
2023-03-13 23:50:32 -06:00
Eric Wasylishen 41a4375376 qbsp: q2: reject DEADMONSTER and MONSTER in input brushes
we currently (hackily) use MONSTER as detail_wall internally (this will likely change later though.)

In any case these are invalid in input maps.
2023-03-12 23:39:25 -06:00
Eric Wasylishen 7ed36c9bec qbsp: reject Q2 maps with mixed visible contents 2023-03-07 22:12:22 -07:00
Jonathan 1091183293 fix infinite loop if a texture is missing in the animation chain 2023-03-03 16:48:25 -05:00
Eric Wasylishen 06f2363902 qbsp: work around 45 degree plane issue in FindPortalSide 2023-03-01 21:09:15 -07:00
Eric Wasylishen 8130843fb3 qbsp: search for wad's relative to cwd 2023-02-26 23:27:38 -07:00
Eric Wasylishen ac3937300b qbsp: safer condition in last commit 2023-02-23 19:15:07 -07:00
Eric Wasylishen ce030f53be qbsp: fix func_detail_wall deleting merged faces 2023-02-23 19:08:35 -07:00
Eric Wasylishen 1c22f45b47 qbsp: avoid tjunc interaction between func_detail_wall and worldspawn 2023-02-22 23:12:40 -07:00
Eric Wasylishen 42da494707 qbsp: face_t: track front/back contents, instead of just front 2023-02-22 22:54:37 -07:00
Eric Wasylishen d8b903823a qbsp: create a tjunc.hh header
make some tjunc.cc functions static that weren't
2023-02-22 18:07:49 -07:00
Eric Wasylishen 096f347a12 qbsp: fix func_detail_fence/func_detail_wall with DETAIL set on brushes 2023-02-22 01:16:32 -07:00
Eric Wasylishen 60dea4af4c qbsp: fix func_detail_wall in q2 mode 2023-02-22 00:57:31 -07:00
Eric Wasylishen b17633f746 cleanup: set PackConstructorInitializers: Never 2023-02-20 10:23:59 -07:00
Eric Wasylishen dd6e49c89f light: support _object_channel_mask on func_group 2023-02-20 00:07:08 -07:00
Eric Wasylishen eda6155844 cleanup: run ./clang-format-all.sh
clang-format version 15.0.7
2023-02-18 22:59:43 -07:00
Eric Wasylishen 7d6ed20dc1 unused includes cleanup 2023-02-18 16:14:11 -07:00
Eric Wasylishen 641fb780ac light: allow customizing _world_units_per_luxel on func_group etc. 2023-02-17 00:07:43 -07:00
Jonathan 72a0a92d3a fix area assertion/test failure 2023-02-13 20:41:11 -05:00
Jonathan dd75cdf3e3 don't bother with area portal flooding if we are leaked 2023-02-13 20:18:09 -05:00
Eric Wasylishen 48fe527955 light: add _lightgrid_hint point entity key for customizing lightgrid bounds
use it as a info_null key: "_lightgrid_hint" "1"
2023-02-12 15:03:08 -07:00
Jonathan c954953735 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-02-12 08:10:59 -05:00
Jonathan 4c7459e673 fix the condition for Q2 phong warning 2023-02-12 08:10:52 -05:00
Eric Wasylishen 85ba6ca205 qbsp: fix "unsigned marksurfaces" warning printing wrongly after auto upgrade 2023-02-11 22:30:49 -07:00
Eric Wasylishen 71a0ce77ac qbsp: q2: set leaf 0's cluster to -1
leaf 0 is the invalid placeholder leaf, but we were giving it
cluster 0 which is valid. instead, give it cluster -1
2023-02-07 23:17:55 -07:00
Jonathan c2acae8c6b fix hint brushes 2023-02-06 21:58:53 -05:00
Eric Wasylishen c649fc2544 qbsp: add a warning message when the .bsp requires "extended limits" (unsigned marksurfaces) 2023-02-04 14:11:01 -07:00
Eric Wasylishen 302d600f4c qbsp: strip _tb_ keys, convert __TB_empty to skip 2023-01-30 00:28:31 -07:00
Jonathan 36b8b21990 set -wrnormals by default on -q2rtx
inherit -phong from worldspawn
2023-01-18 15:49:51 -05:00
Eric Wasylishen 1fb53cbe4d qbsp: fix area assignment on leaking q2 maps
reverts c9243d4fea
2022-12-21 21:18:06 -07:00
Eric Wasylishen 35fe26b7a6 qbsp: fix FindTargetEntity (was breaking hiprotate) 2022-12-19 00:55:20 -07:00
Jonathan d5e29a1c90 add _nofill key, which causes an entity to not count as an entity for the purposes of occupancy (for lights in walls, etc)
add _nonudge key, to disabling nudging of lights "stuck" inside walls
2022-12-15 04:30:22 -05:00
Eric Wasylishen 82aa1e4396 light: make "_light_alpha 0" behave as expected (invisible to light) 2022-12-14 21:46:36 -07:00
Eric Wasylishen e7b20733d3 qbsp: write .prt files in text mode for TB compatibility 2022-12-09 22:54:56 -07:00
Eric Wasylishen 3e673d2119 qbsp/light: restore TRANS33/TRANS66 faces casting translucent shadows by default 2022-12-06 23:38:43 -07:00
Eric Wasylishen 7ce14a376f qbsp/light: make liquids not cast shadows by default
previously opaque Q2 liquids (e.g. lava, opaque water) were casting shadows / dirt
2022-12-06 17:03:39 -07:00
Jonathan 15b9a78fd1 fix gate being incorrect
add surflight grouping
fix minlight on color'd _surface lights
2022-12-05 20:35:44 -05:00
Eric Wasylishen 41de747a9a qbsp: for "Q2 phong (value set, LIGHT unset) used on a mirrored face." warning, don't set value to 0
- setting value to 0 was not a robust way to disable phong
- it could actually have the reverse effect if "value 1" was
  being used to change a smoothing group, setting value back to 0
  could reintroduce unwanted smoothing
- that hack should be less useful with the phong system improvements
  in the previous commits
2022-12-01 01:23:28 -07:00
Eric Wasylishen f66e4790a4 qbsp/light: add no_phong texinfo flag (currently not used/exposed) 2022-12-01 01:16:17 -07:00
Eric Wasylishen 1065adecc6 qbsp/light: implement _phong_group key, equivalent to Q2 "value" field 2022-12-01 00:25:05 -07:00
Eric Wasylishen abb92d4b0f qbsp: fix crash when using -omitdetail and an all-detail bmodel 2022-11-21 01:13:31 -07:00
Eric Wasylishen 04adb17b1b qbsp: fix -nodetail in q2 mode 2022-11-21 00:10:26 -07:00
Eric Wasylishen 12d82db8b1 qbsp: implement -omitdetail for q2 2022-11-20 23:58:30 -07:00
Eric Wasylishen efac0c5a31 qbsp: make -noallowupgrade also disallow the extended-limits (int16_t -> uint16_t) subformats 2022-11-20 12:13:06 -07:00
Eric Wasylishen c9111b2a6c
Merge pull request #337 from TTimo/colorcodes
Enable support for ANSI color codes on Windows 10 and newer, without …
2022-11-19 09:10:24 -08:00
Eric Wasylishen 9ab4ea8176 Move SetConsoleMode() call to logging::preinitialize(); helper
Don't do ENABLE_VIRTUAL_TERMINAL_INPUT as it breaks arrow key history
navigation in Windows Terminal after running one of the ericw-tools exe's.
2022-11-19 10:05:14 -07:00
Eric Wasylishen 9c3a807391 qbsp: warn and disable q2-style phong if used on a mirrored face 2022-11-17 23:51:00 -07:00
Jonathan 328fa6ade6 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-11-17 13:55:37 -05:00
Jonathan 670347e64e fix infinite loop if map has uppercase animated textures 2022-11-17 13:55:31 -05:00
ttimo fb459253fe Enable support for ANSI color codes on Windows 10 and newer, without needing to enable system wide. Good for CreateProcess CREATE_NEW_CONSOLE situations. 2022-11-15 11:09:19 -06:00
Eric Wasylishen 959fe32e18 portals.cc: add -verbose logging for missing portal sides 2022-11-14 21:49:01 -07:00
Eric Wasylishen d7acd046c3 light/qbsp: add _surflight_rescale key 2022-11-12 17:07:02 -07:00
Eric Wasylishen b81b52da5a qbsp: fix nonsolid bmodels in hul1/2 2022-11-11 15:04:53 -07:00
Eric Wasylishen 93d059058f testqbsp: fix mirrorinside + bmodels in Q1 mode 2022-11-11 12:33:47 -07:00
Jonathan 8b524cf324 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-11-02 17:59:12 -04:00
Jonathan b89b71455b fix condition running in Q2 mode that isn't supported yet 2022-11-02 17:59:07 -04:00
Eric Wasylishen 2bd2515792 all: cleanup unused includes (Clion - detect not directly used) 2022-10-31 21:37:34 -06:00
Eric Wasylishen 0924423c20 light: header -> source move 2022-10-31 21:21:28 -06:00
Eric Wasylishen 35ffc00462 all: add LIGHT_/QBSP_/VIS_ prefixes to epsilons where necessary 2022-10-30 15:08:10 -06:00
Jonathan 5ea786702b always include NODRAW + LIGHT 2022-10-30 15:29:42 -04:00
Eric Wasylishen 34f32f851c common, qbsp: more functions moved from header -> source 2022-10-26 23:29:54 -06:00
Eric Wasylishen ba3befca9b qbsp: exportobj: re-add bspbrush_t::container version 2022-10-23 19:20:19 -06:00
Eric Wasylishen 9ff0752ad1 testqbsp: clean up clearing of data between tests 2022-10-23 19:20:19 -06:00
Eric Wasylishen a950d2fcb7 qbsp: add exportobj.hh header 2022-10-23 19:20:19 -06:00
Eric Wasylishen 87ae7d63fa qbsp: restore a variation on CSGFaces 2022-10-23 19:20:10 -06:00
Eric Wasylishen 501ced4bfe qbsp: restore func_detail_wall support 2022-10-21 18:33:38 -06:00
Eric Wasylishen 636b376577 squash brushbsp-compilation-speedup branch
move function implementations out of headers
2022-10-21 18:00:58 -06:00
Eric Wasylishen 2a9393cc54 bspbrush_t: add contains_point() query 2022-10-05 23:49:34 -06:00
Jonathan f51ab9b75e Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-09-30 18:30:50 -04:00
Jonathan 09447178f5 error on -onlyents in Q2 mode 2022-09-30 18:30:46 -04:00
Eric Wasylishen 1160352a24 qbsp: make -debugleafvolumes only write out solid leafs 2022-09-28 19:23:57 -06:00
Eric Wasylishen 7a014819f0 qbsp: keep bspbrushes around if -debugbspbrushes is used 2022-09-27 09:55:02 -06:00
Eric Wasylishen 8d5d3233b7 qbsp: call CountLeafs at the end of hull processing 2022-09-19 21:00:36 -06:00
Eric Wasylishen ed4e4d1327 qbsp: use tree_split_t::PRECISE on second BrushBSP for hulls 2022-09-18 18:05:28 -06:00
Eric Wasylishen acf334daee cleanup: rename surfflags_t::is_skip to is_nodraw
This is a break to the .json format
2022-09-18 15:47:14 -06:00
Eric Wasylishen 09f0e2a0c5 qbsp: preserve brush side texinfo in collision hulls
17k -> 9.8k clipnodes on testmaps\retrojam1_ericw.map

setting the texinfo to 0 was defeating the bsp heuristic, because
texinfo 0 was marked as is_skip, which makes side_t::is_visible()
return false (which makes us not care about splitting those brush sides)
2022-09-17 21:46:02 -06:00
Eric Wasylishen 04df42f8e0 qbsp: CreateSingleHull: remove unnecessary side.visible clearing (now done in CreateBrushWindings) 2022-09-17 21:00:01 -06:00
Eric Wasylishen cea123f955 qbsp: Brush_LoadEntity: print source brush side stats (visible/invisible) 2022-09-17 20:27:21 -06:00
Eric Wasylishen 8ee39cf874 qbsp: CountLeafs: also measure avg/max bsp height 2022-09-17 19:53:49 -06:00
Eric Wasylishen 9c46699b60 qbsp: experiment with fixing micro-leaks 2022-09-12 02:10:04 -06:00
Eric Wasylishen b17fc3eab1 qbsp: address missing "faceCopy.tested = false" 2022-09-12 00:56:10 -06:00
Eric Wasylishen c90c16ee45 qbsp: add -debugleafvolumes 2022-09-12 00:36:33 -06:00
Eric Wasylishen a926e5c397 qbsp: add -debugbspbrushes 2022-09-12 00:18:32 -06:00
Eric Wasylishen 4567f9b4b9 qbsp: add -debugleak for saving more info about leaks 2022-09-11 23:56:29 -06:00
Eric Wasylishen ae37a4e667 qbsp: write .leak.prt files in addition to .pts to aid leak debugging 2022-09-11 20:35:51 -06:00
Jonathan 6713fedcbc allow changing a brushes' lightmap color scale with `lightcolorscale` 2022-09-10 19:04:17 -04:00
Eric Wasylishen 68e2f97fbf qbsp: sync FindAreas to Quake-2-Tools version
fixes area portals in cases when area has no point entities in it
2022-09-10 15:49:17 -06:00
Eric Wasylishen b19527c3fd qbsp: don't use brush sides to texture a portal if they're not coplanar 2022-09-08 21:20:49 -06:00
Jonathan d4dde8350c always mark leaked maps' nodes/leaves areas 2022-09-06 14:44:44 -04:00
Jonathan b77dfbc7f9 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-08-31 12:58:56 -04:00
Jonathan 075481a36f add -nocolor for TB, etc
fix crashes on vis and light for invalid options
fix TB and others not receiving output
2022-08-31 12:58:04 -04:00
Eric Wasylishen 88a88882a9 qbsp: initialize 'visible' in CreateBrushWindings 2022-08-28 23:15:49 -06:00
Eric Wasylishen 3856dffc0a qbsp: compilation speedup: isolate pareto in map.cc 2022-08-28 18:10:01 -06:00
Eric Wasylishen c8c526ab57 qbsp: fix mist-clip intersection chopping up the faces
note it makes the simple_worldspawn_detail clipnodes count
test fail. Clipnode counts are way too high in general so this isn't
a huge issue yet.
2022-08-28 14:13:14 -06:00
Eric Wasylishen 7df6310d32 qbsp: init brush sides to visible
improves the quality of the first BSP build
2022-08-27 23:36:58 -06:00
Eric Wasylishen 1ab6cc1e65 qbsp: fix iterator debug assertion in ChopBrushes
"cannot decrement begin list iterator"
2022-08-27 14:54:36 -06:00
Jonathan 34a7079b64 reverse the portals for leak lines in inside filling 2022-08-27 03:28:57 -04:00
Jonathan b305ddaed9 port over the visible = true setting for hint sides 2022-08-25 21:45:33 -04:00
Jonathan f27f16cebf fix cherry pick error 2022-08-25 15:48:52 -04:00
Jonathan 5fb0d56da7 maxlight
# Conflicts:
#	include/common/bspfile.hh
2022-08-24 21:50:11 -04:00
Jonathan 1ce5c5a7b1 combine flood + emit areaportals into a single step, since they won't ever be run not together
add stats for edges and faces
2022-08-24 12:02:56 -04:00
Jonathan e14f42caba emit edges and faces together instead of in two passes 2022-08-22 13:40:47 -04:00
Jonathan e7ae158a10 split up BrushBSP and CountLeafs stat prints 2022-08-21 21:54:16 -04:00
Jonathan 4eebbd0bdd re-introduce qbsp3's "don't use clip brush sides as splitters" 2022-08-21 17:36:19 -04:00