Commit Graph

246 Commits

Author SHA1 Message Date
Eric Wasylishen b17633f746 cleanup: set PackConstructorInitializers: Never 2023-02-20 10:23:59 -07:00
Eric Wasylishen f8b189c527 light: fix sample occlusion / object channel mask interaction 2023-02-20 01:03:12 -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 8516bfb5e2 light: skip lightmapping sky faces if lightgrid is in use 2023-02-17 17:41:49 -07:00
Eric Wasylishen 8cc7b0e3f3 light: add test for sky getting an optimized lightmap 2023-02-17 00:24:08 -07:00
Eric Wasylishen 641fb780ac light: allow customizing _world_units_per_luxel on func_group etc. 2023-02-17 00:07:43 -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
Eric Wasylishen 1c16a467f1 testqbsp: add a basic lit water test 2023-02-04 14:41:26 -07:00
Eric Wasylishen 302d600f4c qbsp: strip _tb_ keys, convert __TB_empty to skip 2023-01-30 00:28:31 -07:00
Eric Wasylishen 9edad10b0f common: add convenience version of EntData_Parse 2023-01-30 00:08:45 -07:00
Eric Wasylishen 23e98c0e94 test: remove unwanted doctest::may_fail() from light tests 2023-01-29 16:53:23 -07:00
Eric Wasylishen 439d0de7f2 testmaps: test case for hint brush causing faces to be deleted 2023-01-29 15:06:55 -07:00
Eric Wasylishen 6ede7925bc light: apply model offset to embree meshes
Fixes shadows in incorrect places when using shadow-casting rotators
Fixes https://github.com/ericwa/ericw-tools/issues/326
2023-01-24 20:18:14 -07:00
Eric Wasylishen 83d3774714 tests: hack for spurious test failure on CI only 2023-01-24 01:40:21 -07:00
Eric Wasylishen 2d64108ea4 light: add basic test case for _sun 1 entities 2023-01-24 00:57:26 -07:00
Eric Wasylishen fa8af3845b light: fix default _sunlight angle to be pointing straight down 2023-01-24 00:52:28 -07:00
Eric Wasylishen ee5c016b57 fix macOS build 2023-01-08 20:43:31 -07:00
Eric Wasylishen a497254874 tests: add q2 light cone test 2023-01-08 20:26:32 -07:00
Eric Wasylishen a2399ab48c tests: add dirt / object_channel_mask interaction test
was already working correctly
2023-01-08 19:59:19 -07:00
Eric Wasylishen e9cd29a394 tests: add test case for WINDOW being non-mirrored 2023-01-06 12:07:30 -07:00
Eric Wasylishen 64c0d8c0c4 qbsp: fix AUX to be non-mirrorinside by default 2023-01-06 12:00:32 -07:00
Eric Wasylishen aa928e1515 tests: add q2 ladder test case 2023-01-03 17:40:56 -07:00
Eric Wasylishen c43371213e tests: move benchmarks to new file, add clip benchmark 2023-01-03 16:20:22 -07:00
Eric Wasylishen a9a11159f4 light: add _surface_minlight_scale light key
for tweaking minlight given to faces matching surface light templates.

minlight = _surface_minlight_scale * light

lower default from 64 to 1 in q1 mode
2022-12-30 23:06:28 -07:00
Eric Wasylishen 710e70d74b testqbsp: add (failing) test case with off-grid geo and missing faces 2022-12-23 00:04:22 -07:00
Eric Wasylishen 1fb53cbe4d qbsp: fix area assignment on leaking q2 maps
reverts c9243d4fea
2022-12-21 21:18:06 -07:00
Eric Wasylishen fe5ce3765a test: add a few more area-related assertions 2022-12-21 20:56:18 -07:00
Eric Wasylishen 20af42c9aa test_ltface: disable "surface lights minlight" test for now 2022-12-21 01:10:39 -07:00
Eric Wasylishen 3d0c756b4f light: fix minlight color on surface lights
- extra `* 255` was unnecessary, setting_color already does this
- don't use qvec3b as it was causing colors to wrap around the 0..255 range
2022-12-20 23:44:21 -07:00
Eric Wasylishen 108d299482 test_ltface: test case for minlight surflight 2022-12-20 22:54:22 -07:00
Eric Wasylishen f652af9c7d bsputils: add .lit loader 2022-12-20 22:46:20 -07:00
Eric Wasylishen bf75ae8717 test_ltface: refactor to allow q1 tests as well 2022-12-20 00:19:05 -07:00
Eric Wasylishen 35fe26b7a6 qbsp: fix FindTargetEntity (was breaking hiprotate) 2022-12-19 00:55:20 -07:00
Eric Wasylishen 6ac564c64f build: remove unused subprocess.h dependency 2022-12-19 00:36:04 -07:00
Eric Wasylishen 6451a3f2aa qbsp: fix _mirrorinside 1 on func_detail_fence (q2) 2022-12-15 00:18:22 -07:00
Eric Wasylishen 8caaf7236f test: add q2 test case for alpha mask textures 2022-12-14 23:19:58 -07: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 513c47406b light: fix surface lights to check channel mask 2022-12-14 00:26:38 -07:00
Eric Wasylishen 287ac96363 light: fix sunlight to check object channel mask 2022-12-14 00:15:23 -07:00
Eric Wasylishen ccb72a3bf5 light: expand test case for light channels 2022-12-13 23:42:26 -07:00
Eric Wasylishen 6ebd4eba58 tests: log .bsp copying 2022-12-12 17:58:02 -07:00
Eric Wasylishen 63cac32f88 light: quick experiment with a _light_group feature for lights that only affect linked bmodels 2022-12-11 15:36:08 -07:00
Eric Wasylishen bded0ab344 light: fix negative lights breaking when bounce in use 2022-12-10 15:10:36 -07:00
Eric Wasylishen a5b83e088b light: work around visblocking opaque liquids causing light artifacts with -visapprox vis
in cases when we actually want light to shine through these surfaces
2022-12-09 00:07:50 -07:00
Eric Wasylishen 924847661c test_ltface: add test for `-visapprox vis` issue with opaque liquids 2022-12-08 21:46:35 -07:00
Eric Wasylishen a70c8f4835 light: fix artifacting with translucent shadows
Embree is allowed to call the filter function more than necessary.
The previous implementation had side effects that would cause
the translucent shadows to get darker in this case.

As a limitation, we're back to only allowing 1 layer of glass per ray.
2022-12-07 00:23:26 -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
Eric Wasylishen eae434736a light: support _minlightMottle on worldspawn 2022-12-06 15:18:16 -07:00
Eric Wasylishen 555f07ed61 test_lftace: add a test for an issue of wrapped luxels interacting with surface lights 2022-12-03 14:27:00 -07:00
Eric Wasylishen 96bdf141bb light: block phong if certain surfflag bits differ between the two faces
this prevents liquids from phonging with solids
2022-11-30 22:15:58 -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 5d3fab75b6 light: allow .wal_json metadata to contain "light": [ r, g, b ] to override emissive color
Use this to fix the "emissive lights" test case so it can run on CI without any texture data
2022-11-20 23:01:05 -07:00
Eric Wasylishen 047973a30a test_ltface: "emissive lights": disable test until we have a fix for needing real texture data 2022-11-19 19:37:42 -07:00
Eric Wasylishen c84d7a687e test_ltface: fix differing behaviour locally and on CI 2022-11-19 19:36:49 -07:00
Eric Wasylishen 91a0c8e86a test_ltface.cc: add assertions to catch command line options leaking
across tests
2022-11-19 18:41:46 -07:00
Eric Wasylishen 0c4aab737d light: fix angled emissive surfaces not shining on adjacent faces 2022-11-19 14:57:56 -07: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 46d460277a ltface: support -world_units_per_luxel without -novanilla
first pass implementation - quality of vanilla LM is bad, due to nearest sampling
the decoupled lightmap
2022-11-14 23:58:31 -07:00
Eric Wasylishen c6b19fe6da light: implement -novanilla with -world_units_per_luxel
currently it's required because the non-novanilla path
isn't yet implemented
2022-11-14 00:30:37 -07:00
Eric Wasylishen 99e5f15d42 Revert "ci: use older embree/tbb which support Win8.1"
This reverts commit 50c4709d31.
2022-11-13 16:52:14 -07:00
Eric Wasylishen 50c4709d31 ci: use older embree/tbb which support Win8.1 2022-11-13 15:54:30 -07:00
Eric Wasylishen 276aa147dc fix implicit qvec conversions reported as errors
in Apple clang version 12.0.0 with std=c++2a mode
2022-11-12 19:39:31 -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
Eric Wasylishen e6cec0eb5e qbsp: fix _mirrorinside 0 in q2 mode 2022-11-06 23:53:06 -07:00
Eric Wasylishen ca0efbf3d3 light: wip -world_units_per_luxel and DECOUPLED_LM BSPX lump 2022-11-03 02:39:15 -06:00
Eric Wasylishen 9edadf93cd light: CalcPoints: use faceextents_t::LMCoordToWorld 2022-11-02 01:16:36 -06:00
Eric Wasylishen f3cc0907c8 faceextents_t: refactor to remove lightmapshift member 2022-11-02 00:56:23 -06:00
Eric Wasylishen c39ee38454 qvec: add 3x3 matrix inverse, row major factory method 2022-11-02 00:32:06 -06:00
Eric Wasylishen 2bd2515792 all: cleanup unused includes (Clion - detect not directly used) 2022-10-31 21:37:34 -06:00
Eric Wasylishen da5910e732 tests: first steps on a light test case 2022-10-30 15:32:41 -06:00
Eric Wasylishen 53a0be5e50 build: compile time optimizations 2022-10-26 23:30:02 -06:00
Eric Wasylishen 27045404d3 tests: add CSGFaces basic test 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 501ced4bfe qbsp: restore func_detail_wall support 2022-10-21 18:33:38 -06:00
Eric Wasylishen c84f5898df tests: doctest 2022-10-21 18:33:19 -06:00
Eric Wasylishen 636b376577 squash brushbsp-compilation-speedup branch
move function implementations out of headers
2022-10-21 18:00:58 -06:00
Jonathan 315ab418d2 fix warning
only enable the clock counter errors in debug
2022-10-02 16:20:27 -04:00
Eric Wasylishen e8aeab3a55 test_qbsp.cc: split out q2 tests to a new file 2022-09-30 00:10:01 -06:00
Eric Wasylishen d9d4ee99ad include only needed catch2 headers 2022-09-29 19:49:53 -06:00
Eric Wasylishen 1726f95484 use <fmt/core.h> instead of <fmt/format.h>
Should lighten compile times.

The only loss here is we'll no longer inherit e.g. "float" format specifiers for qvec3f.
2022-09-29 19:49:48 -06:00
Eric Wasylishen 8bfd11ba13 testqbsp: add a obj2map terrain test case
some terrain I created in Blender
2022-09-26 22:40:09 -06:00
Eric Wasylishen 4369cd6313 tests: suppress colors when running tests 2022-09-22 00:11:37 -06:00
Eric Wasylishen addf621074 tests: simple_worldspawn_detail passing now 2022-09-17 21:49:22 -06:00
Eric Wasylishen c2e455e5b0 testqbsp: fix incorrect test expectation 2022-09-12 22:18:27 -06: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 a8a8966e28 test_qbsp: add failing test for 0.125 unit wide faces (currently not generated) 2022-09-08 23:51:51 -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 1ab6cc1e65 qbsp: fix iterator debug assertion in ChopBrushes
"cannot decrement begin list iterator"
2022-08-27 14:54:36 -06:00
Jonathan 2d8827e031 Revert "Q3 didn't need chop, we don't either!"
This reverts commit f57ecaf599.

# Conflicts:
#	include/qbsp/brushbsp.hh
2022-08-21 15:04:26 -04:00
Jonathan 1aaa513368 collapse certain map face issues into loggable warning stats to lessen maps spamming warnings on things that legacy compilers allow
adjust the wording of certain warning messages
don't display face crunching on bmodels/hulls by default
2022-08-20 20:13:27 -04:00
Eric Wasylishen f3a2d99544 testqbsp: adjust q1_rocks test case
avoid potential ambiguity for BrushBSP over whether sky should split wall brushes
2022-08-20 00:22:21 -06:00
Eric Wasylishen 251a6dc7ca testmaps: add a more minimal q1_rocks that's just a cube 2022-08-19 22:55:27 -06:00
Eric Wasylishen 648ffab77b testqbsp: improve q1_rocks test 2022-08-19 22:10:16 -06:00
Eric Wasylishen 10051ceff5 testmaps: remove some accidental brushes in q1_hull_expansion_lip.map
testqbsp: more detailed q1_hull_expansion_lip tests for clipnodes

testqbsp: decompile hull1 of testmaps by default

testqbsp: corrections to the q1_hull_expansion_lip.map expectation

adjust gitignore
2022-08-19 20:49:59 -06:00
Jonathan 057ae544c4 use references in places where we know it's non-null 2022-08-19 12:11:35 -04:00
Jonathan f57ecaf599 Q3 didn't need chop, we don't either! 2022-08-18 19:47:34 -04:00
Eric Wasylishen 4801e87b1c testqbsp: don't allow q1_hull_expansion_lip to fail 2022-08-16 23:05:17 -06:00
Eric Wasylishen cad5b3ccf3 testqbsp: add failing hull expansion test 2022-08-16 00:43:40 -06:00
Eric Wasylishen 2cc97c2519 testqbsp: start q1_rocks test case 2022-08-15 22:23:52 -06:00
Eric Wasylishen 41f765376f testqbsp: adjust test expectations now that we're inside filling hull1/2 2022-08-15 21:16:53 -06:00
Jonathan f7b8f85ece use an optional<uint8_t> to store hull number, which gets rid of special -1 collision hull number.
fixed no-hull always chopping even with chop off
2022-08-15 06:13:30 -04:00
Jonathan 97665d15a9 fix slight mistype in Brush_LoadEntity
make ~settings_container virtual so light_t can be freed properly
reset visible to false on all brush sides
2022-08-15 03:37:38 -04:00
Eric Wasylishen 0642ad16d3 testqbsp: start a hull1 content type test 2022-08-14 18:14:56 -06:00
Eric Wasylishen 35859a6ea4 tests: add q1_wad_mapname test 2022-08-14 13:45:31 -06:00
Eric Wasylishen 995ac04673 tests: add a few clipnode count tests
adjust qbsp_simple_worldspawn_detail.map so it seals in hull1/2
2022-08-13 20:11:22 -06:00
Jonathan 6d66e6d5cf group together # of clipped faces, to reduce console spam of Q1 maps
always allow midplane split for hulls
2022-08-12 21:38:41 -04:00
Eric Wasylishen 06a116670b winding_t: make non-copyable 2022-08-12 02:06:23 -06:00
Eric Wasylishen f3b9de57c6 build: add tbbmalloc 2022-08-09 00:19:39 -06:00
Jonathan 1c6b2e5a95 fix duplicate plane test 2022-08-08 21:27:42 -04:00
Jonathan e5602358c1 Merge branch 'brushbsp-plane3-bevel' of https://github.com/ericwa/ericw-tools into brushbsp-plane3-bevel 2022-08-08 15:50:31 -04:00
Jonathan b3fbf8841d allow update_bounds to tell the caller that a brush may have been destroyed 2022-08-08 15:50:23 -04:00
Eric Wasylishen 9cb0d9b52c testqbsp: add test for the previously missing face in base1 2022-08-08 00:16:09 -06:00
Jonathan 2abdeb2616 remove Face_Plane since we can directly access the real plane now
speed up CreateBrushWindings slightly since we know where the inverted plane is stored
2022-08-08 01:06:50 -04:00
Jonathan 4ec30e02a2 remove "brushes" from mapentity_t - it is now local to the ProcessEntity process
"node_t::original_brushes" is now only used during construction and cleared on Prune; original_mapbrushes is used to track the map brushes on nodes post-construction
calculate and cache contents on mapbrush_t
2022-08-06 19:28:17 -04:00
Jonathan 335db1c0e4 move map_source_location to parser as parser_source_location since the locations actually come from there rather than from the map; now the parser keeps track of the location, so it's a bit easier to follow 2022-08-05 23:17:15 -04:00
Jonathan 33a23a99c2 Revert "tests: update aabb_contains to account for new behaviour"
This reverts commit ef613a69a9.
2022-08-05 07:01:20 -04:00
Eric Wasylishen 84cbd48777 test_qbsp: use "-tjunc rotate" on a face count sensitive test 2022-08-04 21:38:12 -06:00
Eric Wasylishen ef613a69a9 tests: update aabb_contains to account for new behaviour 2022-08-04 21:34:11 -06:00
Jonathan 627428756c track a shared pointer for `map_source_location` instead of memory pointer, so that we can allocate it as we go
use it for brushes and faces
2022-08-04 15:37:37 -04:00
Jonathan ec62a0e8d0 move in the rest of the missing code back into LoadBrush
fix bug with c_brushesremoved brushes
move & CreateBrushWindings use where required
store the source face we made a bspbrush_t side from
fix test issue
2022-08-03 12:35:47 -04:00
Jonathan 58d1e5230e remove hullbrush_t; just directly work via the bspbrush_t since we have the bevels pre-calculated in mapbrush_t
track the mapbrush we were created from in bspbrush_t; we use this later for outputting the collision brush for q2bsp. bevels are busted though..
2022-08-03 04:47:50 -04:00
Jonathan 24168c8e40 clang pass 2022-08-02 21:57:33 -04:00
Jonathan 5f35575c02 remove map.faces and map.brushes; now, brushes are stored inline in mapentity_t, and faces are stored inline in mapbrush_t
calculate brush bounds (and winding) and add bevels after all of the rest of the map has loaded, so that it has proper world extents
calculate world extents right after the map is loaded
2022-08-02 20:59:08 -04:00
Jonathan 1ad0eb530d going back to using planenums, but going for the qbsp3-esque system 2022-08-02 14:17:59 -04:00
Jonathan 93655913c0 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	include/qbsp/qbsp.hh
2022-08-02 06:24:46 -04:00
Jonathan 53adb9fed5 split winding_base_t into two types, so that we can switch out the backing storage
default winding_t for the main polylib to use heap-based, exact-memory-usage-only, winding
2022-08-02 06:09:20 -04:00
Eric Wasylishen e05a2bdf75 qbsp: "-add additional.map" feature 2022-08-01 19:13:10 -06:00
Eric Wasylishen f665cd5cb6 testqbsp: rename our copy of base1.map to base1-test.map
for easier loading in game in Q2
2022-07-31 21:29:25 -06:00
Jonathan 360daea172 fix test failure from map parsing 2022-07-29 22:41:57 -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
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
Eric Wasylishen 876646eeeb testqbsp: use "-tjunc rotate" on tests which are testing for a strict number of faces output 2022-07-22 22:40:24 -06: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
Eric Wasylishen 7f955a5247 testmaps: add q1_tjunc_angled_face 2022-07-13 00:59:46 -06:00
Eric Wasylishen a604c448c1 testqbsp: relax detail_illusionary_intersecting to pass with new tjunc code 2022-07-13 00:22:36 -06:00
Eric Wasylishen e2fe6f8963 testqbsp: turn on the q1 maps test on release builds 2022-07-12 23:36:55 -06:00
Eric Wasylishen f1f558b069 testqbsp: add detail_illusionary + water test 2022-07-12 00:07:39 -06:00
Eric Wasylishen da7e36390f testqbsp: start some contentflags tests 2022-07-12 00:02:05 -06:00
Eric Wasylishen f86a5343fb qbsp: rename options -> qbsp_options 2022-07-10 17:30:00 -06:00
Eric Wasylishen 1c59cc3a44 tests: add INCLUDE_DIRECTORIES(${EMBREE_INCLUDE_DIRS}) 2022-07-10 17:01:25 -06:00
Eric Wasylishen 050886f32c tests: unify tests under one target
to ease sharing code. vis/light tests are going to need the testqbsp infrastructure.
2022-07-10 16:36:15 -06:00