Commit Graph

1461 Commits

Author SHA1 Message Date
Jonathan b83c4a6440 use fold expr instead of for statements in vec3
fix a bunch of clang warnings
2023-11-04 19:01:08 -04:00
Eric Wasylishen d6fbefaf0e lightpreview: decompile hulls for leaf visualization 2023-10-19 00:10:42 -06:00
Eric Wasylishen 91734ac8f6 light: fix gcc9 build 2023-09-17 21:24:04 -06:00
Eric Wasylishen e6d9605b86 light: fix lightgrid assertion failure if lightgrid gets a nan (separate bug) 2023-09-17 20:27:29 -06:00
qruf d189145a01
build: fixes for mingw support (#373) 2023-09-16 13:15:31 -06:00
Jonathan 0509c9a790 fix multiple bounce interaction with lightgrid 2023-09-16 11:55:10 -04:00
Jonathan 147be8f87a some optimizations in indirect lighting code
multiple bounce support
2023-09-16 00:41:05 -04:00
Jonathan 6baa1243cf allow auto-gamedir to handle subdirectoried maps properly
fix include paths
2023-09-08 08:41:56 -04:00
Jonathan 5619e2abef map file separation 2023-09-07 14:55:37 -04:00
Jonathan ba532ac0ab Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-09-04 02:51:27 -04:00
Jonathan 7d881768fa Revert "Revert "reduce memory usage by only storing VPLs when we need to, and only once""
This reverts commit 2e0e23622b.

Disable rescale by default on sky faces.
Light is now in control of rescales' default value.
Multiply omni light faces by 0.5 to better match qrad3
Remove some asserts to increase perf
2023-09-04 02:51:20 -04:00
Eric Wasylishen 7c124a0538 build: work around gcc wanting member initializers in constexpr constructor 2023-09-04 00:45:45 -06:00
Jonathan 1262ce3f78 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-09-04 00:16:36 -04:00
Jonathan cec120dfc9 maputil starting point 2023-09-04 00:16:23 -04:00
Eric Wasylishen 832d7d0413 lightpreview: add .lit loading 2023-09-03 11:31:41 -06:00
Eric Wasylishen b893e67309 light: add _light_twosided 1 key for forcing two-sided light receiving on opaque surfaces 2023-08-29 01:44:16 -06:00
Eric Wasylishen 44dadd87b2 imglib: add -tex_saturation_boost [n], defaults to 0.0, 1.0 emulates Q2 tools 2023-08-26 23:49:48 -06:00
Jonathan 2e0e23622b Revert "reduce memory usage by only storing VPLs when we need to, and only once"
This reverts commit fcf39b2ef8.

# Conflicts:
#	include/light/light.hh
#	include/light/surflight.hh
#	light/bounce.cc
#	light/light.cc
#	light/ltface.cc
#	light/surflight.cc
2023-08-26 23:03:25 -04:00
Eric Wasylishen 54d5838f29 docs: fill in some missing docs
- fix comments around new BSPX lumps
2023-08-13 22:38:31 -06:00
Eric Wasylishen 7608a78b44 style: use std::min/std::max/std::clamp and remove using 2023-08-07 15:42:29 -06:00
Eric Wasylishen db42b2116a use std::abs in remaining places that were using C abs() 2023-08-07 15:23:12 -06:00
Fabian e099c292b0
Use std::abs instead of abs() from C standard library (#369)
abs() from C standard library operates on integers, which is almost certainly not what was intended.
2023-08-06 11:08:06 -06:00
Eric Wasylishen 9f7ba65758 lightpreview: fix bmodel rendering when vis culling is in use 2023-07-30 12:21:54 -06:00
Eric Wasylishen 40a10b2c52 bspinfo: serialize missing textures (offset -1) to json as null
previously, we were writing a json dictionary which was confusing

- bspfile: fix reading a valid texture followed by a missing texture
(offset -1)

- add missing texture testcase
2023-07-18 00:17:24 -06:00
Eric Wasylishen 99be5a84bc qbsp: experimental -filldetail feature (defaults to on)
also change default -filltype from auto to inside
2023-07-09 23:00:15 -06:00
Eric Wasylishen f3edc52a00 qbsp: cleanup outside.cc terminology to reflect what is actually happening 2023-07-09 16:08:00 -06:00
Eric Wasylishen aa74b76815 common: add qmat::transpose() 2023-07-06 17:13:14 -06:00
Jonathan 9898eab474 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-07-06 08:25:11 -04:00
Jonathan 064e7980fd allow --scale to take three parameters. negatives *kind of* work but won't work with lightgrid, etc. 2023-07-06 08:25:02 -04:00
Eric Wasylishen 7691706bda build: only use <fmt/core.h>, other headers have a heavy compilation time impact 2023-07-02 17:08:14 -06:00
Eric Wasylishen 5616fd97f4 common: use compile-time format string checking 2023-06-26 01:19:54 -06:00
Eric Wasylishen 1c85bb882a light: minimize includes 2023-06-26 01:19:54 -06:00
Jonathan 11d73b71d8 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-06-26 00:50:15 -04:00
Jonathan 93da0c9905 add the ability to specify a chop order; this is to help with "nested" func_groups and layers, since TB makes them an implicit object at random spots in the BSP. Now you can be sure your objects will chop in the right order. 2023-06-26 00:50:08 -04:00
Eric Wasylishen fbea58d679 code formatting pass 2023-06-25 18:29:48 -06:00
Eric Wasylishen 36e157254c build perf: de-templateize texvec<T>, we only need texvecf 2023-06-25 18:25:45 -06:00
Eric Wasylishen 26dedb603f common: move numeric_cast to dedicated common/numeric_cast.hh 2023-06-25 17:50:17 -06:00
Eric Wasylishen 10581327b3 build: remove some unneeded includes from bspfile.hh 2023-06-25 16:35:26 -06:00
Jonathan caa7418375 async threading for map progress, etc. no cancelling yet 2023-06-19 15:38:16 -04:00
Jonathan 08db6e9bf9 remove fastbounce, add emissivequality
emissivequality affects both emissives
2023-06-19 09:54:25 -04:00
Jonathan aeece2a730 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	light/ltface.cc
2023-06-19 04:12:11 -04:00
Jonathan 1fbe12767e decouple lightmapping state from emissive state
allow sky to skip lightmapping if lightgrid is enabled in Q2 mode again
2023-06-19 04:11:20 -04:00
Eric Wasylishen 64146f306e fix gcc build? 2023-06-18 23:44:28 -06:00
Jonathan 94357818f9 experiment with keeping sample data all together in memory, which might help caching. not certain. 2023-06-18 14:06:58 -04:00
Jonathan fcf39b2ef8 reduce memory usage by only storing VPLs when we need to, and only once
fix visapprox auto not actually being auto
2023-06-18 13:29:53 -04:00
Eric Wasylishen 1c6a76e1f8 light: autominlight extensions
- now apply per-luxel, not just to faces that are fully occluded
- add "_autominlight_target" key for specifying a target
  to take the light sample from
- add "_autominlight" key: 0 = force off, default = apply to occluded luxels, 1 = apply to all luxels

wip / subject to change!
2023-06-16 00:14:27 -06:00
Jonathan 0c8c10f553 post-process phase, so minlight doesn't affect emissives 2023-06-10 14:20:53 -04:00
Eric Wasylishen 9c6f6c2589 common: change FError to throw an exception 2023-06-03 22:24:20 -06:00
Jonathan c3461a107b Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-05-29 04:38:08 -04:00
Jonathan 6c2b4f6f04 sky rendering (still needs work)
wireframe slightly easier to work with
2023-05-29 04:37:23 -04: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 896da81bd6 bsputil: refactor into a static lib 2023-05-27 13:45:45 -06:00
Eric Wasylishen 2d60b017d7 lightpreview: support FACENORMALS bspx lump 2023-05-23 22:44:13 -06:00
Jonathan 3f3b765780 use STB for TGA as well 2023-05-21 23:20:49 -04:00
Eric Wasylishen 698a492822 bspinfo: factor out lightmap atlas generation from .obj writer 2023-05-20 13:05:22 -06:00
Eric Wasylishen b7f4a2759b imglib: clear texture cache between tests 2023-05-19 00:51:14 -06:00
Eric Wasylishen 9e1ead5f78 common: move load_textures() from light.cc into common/imglib.cc 2023-05-19 00:50:31 -06:00
Eric Wasylishen 895a28584c light: experimental autominlight for solid black sides of doors 2023-05-11 00:17:47 -06:00
Eric Wasylishen 290af832af style: rename dirt related member variables to match the actual names 2023-05-08 23:02:59 -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 c9e41ab4db style: remove GLM_ prefix (no longer using glm) 2023-05-07 21:44:29 -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
Random b49d4879f2
include cstdint in vec.hh to fix build (#354) 2023-05-03 19:13:45 -06:00
Eric Wasylishen 5d142e4ab2 qbsp: remove -contenthack (dead code) 2023-05-01 22:38:00 -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 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 3997e8c9bc imglib: add jpg/png loading using stb_image 2023-04-10 13:47:33 -06:00
Eric Wasylishen addc6e922b tests: add test case for culling of surface lights in the void 2023-04-09 12:39:19 -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 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 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
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 adb7ecce15 light: remove -lightgrid_force_cube, -lightgrid_force_pot 2023-03-04 14:43:04 -07:00
Eric Wasylishen 6c3fd1503f light: remove -lightgrid_format uniform, cluster 2023-03-04 14:41:59 -07:00
Eric Wasylishen f0749450d3 light: support -extra for lightgrid 2023-03-04 11:05:50 -07:00
Eric Wasylishen ce030f53be qbsp: fix func_detail_wall deleting merged faces 2023-02-23 19:08:35 -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 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 1d38ff0ff3 light: add -lightgrid_force_pot (power of two) 2023-02-18 20:15:47 -07:00
Eric Wasylishen c590400c46 light: lightgrid: add -lightgrid_force_cube 2023-02-18 19:15:34 -07:00