Commit Graph

279 Commits

Author SHA1 Message Date
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -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
Eric Wasylishen d32d6ea81d light: rename options -> light_options 2022-07-10 17:28:28 -06:00
Jonathan 2a70cafa32 kinda fix overbrightness? still needs work..
allow lmshift force on light
2022-07-10 13:31:38 -04:00
Jonathan 865217c655 adjust final output warning 2022-07-09 01:36:26 -04:00
Jonathan 0e4066f312 fix LMSTYLE containing 16-bit values sometimes 2022-07-09 01:36:26 -04:00
Jonathan 56e1e2dde0 adjust lightstyle overrun warnings to be less annoying
fix potential overrun in lightstyle writing
2022-07-09 01:36:26 -04:00
Jonathan 7f64c9dfeb simplify saving 2022-07-09 01:36:25 -04:00
Jonathan 88905d4a69 secondary fix to lmstyle code 2022-07-09 01:36:25 -04:00
Jonathan b1a30496c3 fix bspx_lightmap not getting output by bspinfo
fix LMSTYLE getting output when there's no need for it from -novanilla
2022-07-09 01:36:25 -04:00
Jonathan adc54dac61 fix bug with output of lmstyle/lmoffset lumps
bspinfo will output proper atlasses now
use faceextents_t everywhere
2022-07-08 02:06:07 -04:00
Jonathan 705ab73169 rename light option `lmscale` to `lightmap_scale` to reflect its qbsp usage (a forced replacement of the "default" lightmap scale)
allow qbsp to be passed an `-lmscale` to facilitate a global lmscale change for BSPX
fix code paths for writing both lightmap sizes out

# Conflicts:
#	include/qbsp/qbsp.hh
2022-07-08 02:06:06 -04:00
Jonathan 0483db5c55 remove sky visibility stuff; not necessary with the approx methods
show sky hits in light points stats
merge surface light stuff (minlight, etc)
default surface lights with radiosity to spotlight, to match Q2

(cherry picked from commit defa4cafce)
2022-07-04 20:47:06 -04:00
Jonathan a0d81372d1 improved path detection (and overriding) routines
(cherry picked from commit 32f33fb4b3)
2022-07-03 18:23:40 -04:00
Jonathan 0bcd92300a bounce lighting fix
change defaults for Q2 to look a bit closer to how it looked before

(cherry picked from commit b8bb4cdd2a)
2022-07-03 14:21:25 -04:00
Jonathan cc16b886a4 move "points" instead of copying
pre-offset points
remove double calculation for pos/dir in lightface (didn't seem to have any visual effect on the output)
2022-07-02 08:49:34 -04:00
Jonathan 9f734ff976 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspfile.cc
#	include/common/bspfile.hh
#	light/trace.cc
2022-06-30 05:23:05 -04:00
Jonathan 03ee5c52e8 add an entry point for specifically loading meta-only file formats, like .wal; used for discerning replacements from their source material (since replacements are often larger than the default, we need the scale info)
add a new meta format, which is just a JSON representation of the metadata contained in a .wal
simplify texture loading in `light`
fix `light` not handling replacement textures very well
string_iequals take string_view like the others
move averageColor to be alongside pixel data, where it belongs
2022-06-29 12:59:33 -04:00
Jonathan c1dc3cb7d8 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	include/common/bspfile.hh
2022-06-28 04:13:26 -04:00
Jonathan 44c50717c3 move generic image loading routine to `img`
move light-specific "load textures from BSP" routine to light
fix a couple bugs with external wad textures (there should always be at least a 40-byte miptex in there)
light can now load external textures
move -paths to common settings
fix bug with missing texture not filling miptex name
2022-06-28 01:37:12 -04:00
Jonathan 3b777a05a9 remove unnecessary init_palettes 2022-06-27 08:13:32 -04:00
Jonathan cf04f644e0 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspinfo.cc
#	include/common/bspfile.hh
#	include/qbsp/map.hh
#	include/qbsp/wad.hh
#	qbsp/wad.cc
2022-06-27 06:44:45 -04:00
Jonathan 062ff86a0d cache texture pointers, saving expensive lookups per ray 2022-06-25 04:28:00 -04:00
Jonathan 90c08ca1da move bounce lighting into a post-processing operation and split LightFace into Direct and Indirect 2022-06-24 04:33:08 -04:00
Jonathan c7169e11ee split LightFace into three distinct phases: Create, Light, and Save 2022-06-24 02:54:41 -04:00
Jonathan 70d87a52d6 more pointers to vectors 2022-06-23 16:05:11 -04:00
Jonathan 1d221d3999 only use Embree stuff 2022-06-22 22:23:48 -04:00
Jonathan 3f75bb4039 put ExportObj behind an option 2022-06-22 18:13:56 -04:00
Jonathan cb3ef7b19f allow radlights to specify an entity dictionary instead (if the input is a .ent, it is an entity dict) which is more flexible 2022-06-22 17:03:00 -04:00
Jonathan 210d994445 cherry pick commit 96cd23761c from @Shpoike
Removed legacy switchable lightstyles limit (requires updated engines when exceeded). Added -facestyles argument that allows for >4 styles per face, as well as potentially increasing style indexes to 16bit for far far more switchable styles.
2022-06-21 15:35:39 -04:00
Jonathan 72914b4724 moving more raw pointers to vectors/smart pointers
support for radiosity _surface lights with `_surface_radiosity` key
allow lightstyles for _surface radiosity lights
bounce enabled by default on Q2
remove ValueForKey, use epairs directly
2022-06-21 13:41:51 -04:00
Jonathan df3e6d3988 remove Little* funcs, not used any more
remove byteswap as it wasn't used any more
re-introduce imemstream and omemstream to make it harder to accidentally use the wrong operators
add dynamic padding stream manipulator
use memstreams for BSPX
2022-06-20 21:39:08 -04:00
Jonathan c79e263753 simplify bspx code
remove old obj preview for wrnormals
2022-06-20 20:42:34 -04:00
Jonathan e366898796 re-introduce vis culling, mainly for Q2/surface lit maps
-novisapprox gone; replaced with -visapprox auto|none|vis|rays
2022-06-18 23:56:45 -04:00
Jonathan 78b979d670 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	include/light/entities.hh
#	qbsp/brush.cc
#	qbsp/map.cc
2022-06-14 17:19:30 -04:00
Jonathan d24ea4922a entdict cleanup 2022-06-14 17:18:13 -04:00
Jonathan 4a20305077 clean up light conditional 2022-06-12 06:38:29 -04:00
Jonathan 812797f7ed enable lighting for warp/sky in Q2
simplify bitflag definitions
change nudging light warning to make more sense
another #define -> constexpr pass
2022-06-10 06:29:14 -04:00
Jonathan 19fafd9d46 don't add bounce lights that have no color
increase bounce scale a bit to match Q2 again
2022-06-03 14:59:06 -04:00
Jonathan a824b9436c hardcode omnidirectional surface lights - seems closer to Q2's defaults
hardcode dot of 1.0 for surface lights
halve bounce data since the former changes blow out lighting a bit
2022-06-02 22:12:31 -04:00
Jonathan 11f937f0ad add mottling that was used for _minlight on objects in Q2 maps
fix _minlight for Q2
set up a few better defaults for Q2
temp-ish fix for areaportals
2022-06-02 01:05:41 -04:00
Jonathan 65852ef042 adjust settings_set to only accept one token per entry
radlights is now a set (only loads one though)
2022-06-01 20:42:06 -04:00
Eric Wasylishen d763b2e336 build: support clang-cl 2022-05-10 21:39:58 -06:00
Eric Wasylishen 4042f1c7b9 light: fix compile after previous change 2022-05-09 23:27:33 -06:00
Jonathan cc0e1a5561 move Face_IsLightmapped to light
Fix q2rtx, needs to include lightstyle for nodraw for emissive invisibles with lightstyles
fix wal (for the 900th time)
auto-set -nolighting for -q2rtx
2022-04-30 23:27:21 -04:00
Bryan Haley ccac9d4979 Add check for SSE2 in light.cc (#328) 2022-03-28 23:08:07 -06:00
Jonathan c81e9ace28 remove old threading code entirely
add new parallel logging stuff in common/parallel which wraps parallel_for(_each) and provides automatic percentage indicator
fix issue with light not pulling in settings
move logging stuff into its own namespace and simplify
2022-03-01 10:28:59 -05:00
Jonathan 6baea3bc03 Fix three bugs that slipped by for cmdargs
Remove old threading code, use tbb internally
2022-02-27 04:09:28 -05:00
Jonathan df92d9ce12
Command line args systems (#2)
* cmd

* cmake change for tbb DLLs
add in test for double-hyphens

* cmd

* game version

* settings!

* bsp texture usage
decompile fix for q1bsp

* finish up the options for qbsp

* light finished?

* finish up the few missing bits

* move scalar/int32 up

* Run clang-format pass

* natvis for our mathlib
use slightly faster storage for winding
fix light tests

* allow dictionary to be a base type

* re-run style

* Remove cfg_static
Fix options summary

* natvis for lockable_value<T>

* last-ish pass?

* format

* forgot last few lockables
2022-02-27 00:01:57 -05:00
Jonathan 0c827208ec Allow `-subdivide 0` to turn off subdivision
imglib now lives in common
fs 'load' split into two functions, where and load. the former allows you to query for and return archive & path for a given file, whereas the latter handles that for you.
use log verbose in light rather than own verbose flag
2021-11-21 15:08:02 -05:00