Commit Graph

64 Commits

Author SHA1 Message Date
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 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
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
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 e069d7b9b8 style: update settings api to follow current coding style 2023-04-16 11:55:38 -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
Eric Wasylishen d1e5daedf0 light: fix lighting output change in last commit
if the center of a surface light fragment was exactly coplanar with a wall, the last commit would reject it
whereas previously, we would still emit light
2023-04-08 23:43:43 -06:00
Eric Wasylishen 28776464c7 light: MakeSurfaceLight: cull surface light fragments that are in the void 2023-04-08 16:39:09 -06:00
Eric Wasylishen 098ce84d7b light: fix minor threading bug with `total_surflight_points` stat
needs to be protected by mutex
2023-04-08 16:16:44 -06: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 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 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
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 d7acd046c3 light/qbsp: add _surflight_rescale key 2022-11-12 17:07:02 -07:00
Eric Wasylishen a5125583fa light: clear global data so light can run multiple times per process 2022-11-11 16:52:07 -07:00
Eric Wasylishen 2bd2515792 all: cleanup unused includes (Clion - detect not directly used) 2022-10-31 21:37:34 -06:00
Jonathan 3564f6085d merge surface lighting and bounce code (wip) 2022-08-30 15:46:14 -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
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 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Jonathan 0561766bc9 fix overblown lighting if light color is specified for radiosity 2022-07-22 22:10:22 -04:00
Eric Wasylishen d32d6ea81d light: rename options -> light_options 2022-07-10 17:28:28 -06: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 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 f089c5d145 fix bounced lighting
(cherry picked from commit 0baa788d7e)
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 022676fe63 fix AABB accumulation 2022-07-02 08:49:30 -04:00
Jonathan feaa15b712 only generate bounds if rays is enabled
don't lightmap sky again
2022-07-02 08:49:26 -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 e97ad64bdc allow a global override to enable radiosity mode on _surface
allow Q2-style rads and Q1-style rads to be added together; also mimic the behavior of _surface which loads multiple lights for a single surface
2022-06-21 17:29:26 -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 827d382d5a support color on surflights 2022-06-21 15:07:30 -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 2b43f2f0c6 slight speed up to compiling surf lights 2022-06-19 12:35:43 -04:00
Jonathan 51f2bc1ff0 fix visapprox rays crashing
fix visapprox rays to work with surface lights; it's slower than vis but it at least works now
2022-06-19 12:09:12 -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 41ef66190f consistency rename; gtexinfo_t -> mtexinfo_t 2022-06-16 09:36:31 -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 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 008d6db056 Fix detail for Q2 maps
Simplify winding::flip
Add an assert that a generated surface has a non-empty bounds (have a map that generates a face with 0,0,0 bounds)
2022-01-20 19:25:58 -05:00
Jonathan e0ed70cc87 no more Vector! 2021-10-25 10:38:15 -04:00
Jonathan cb3c81aaf8 vec3_t gonedy 2021-10-21 20:21:28 -04:00
Jonathan 01b8abf93c Removed a lot of unused functions
Moved vector-related operations from mathlib to qvec, moved a few into qv::
Use clamp/max/min directly instead of #define'ing them
Move a few single-use functions directly above their usages
2021-10-10 14:04:09 -04:00
Jonathan 0833d84a7a Calculate tangents and bitangents (need to clean this up)
Implement formatters for qvec
Add -nolighting, which skips all non-lightstyled lights
2021-10-05 01:07:13 -04:00