Commit Graph

134 Commits

Author SHA1 Message Date
Jonathan 53850d94ac fix crash in embree tracing due to new batching code
simplify structs for tracing
2024-01-21 08:52:16 -05:00
Eric Wasylishen 8db1d32e9f light: fix excessive bouncing with lit water, or _shadow -1
Fixes #397
2023-12-24 00:44:56 -07:00
Jonathan 1eaf2170f8 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	light/trace_embree.cc
2023-12-07 14:13:36 -05:00
Jonathan 9ed4f3d042 bunch of double -> float
fix Q2 animated textures
2023-12-07 14:11:46 -05:00
Jonathan ec452e2291 remove implicit conversion for qplane3 2023-11-19 19:41:58 -05:00
Eric Wasylishen db0951dc40 light: support embree4 in addition to 3 2023-11-19 14:14:22 -07:00
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 7608a78b44 style: use std::min/std::max/std::clamp and remove using 2023-08-07 15:42:29 -06:00
Eric Wasylishen a2ea5d8217 style: remove all "using namespace polylib" 2023-08-07 15:33:09 -06:00
Eric Wasylishen f8886b6e60 style: remove all "using namespace std" 2023-08-07 15:28:50 -06:00
Eric Wasylishen 1c85bb882a light: minimize includes 2023-06-26 01:19:54 -06:00
Eric Wasylishen 5243fd8751 build: fix deprecation warnings 2023-06-25 16:02:03 -06:00
Eric Wasylishen e069d7b9b8 style: update settings api to follow current coding style 2023-04-16 11:55:38 -06: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 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 82aa1e4396 light: make "_light_alpha 0" behave as expected (invisible to light) 2022-12-14 21:46:36 -07:00
Eric Wasylishen 00754e588e light: setting an _object_channel_mask implicitly enables shadow casting 2022-12-13 23:37:00 -07:00
Eric Wasylishen 8aa49699f8 light: rename channel mask keys
models:
_object_channel_mask

lights:
_light_channel_mask
_shadow_channel_mask
2022-12-13 23:20:27 -07:00
Eric Wasylishen 181d608c7a light: add missing RTC_SCENE_FLAG_CONTEXT_FILTER_FUNCTION now needed
also check channelmask/shadowmask in Embree_FilterFuncN
2022-12-13 20:04:22 -07:00
Eric Wasylishen 92d5c75424 light: experimental light channel mask feature 2022-12-13 19:13:58 -07:00
Eric Wasylishen 8728d982c3 light: remove more dead code 2022-12-13 18:59:35 -07:00
Eric Wasylishen 54e598c5fb light: clean up dead code 2022-12-12 18:02:33 -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 a5125583fa light: clear global data so light can run multiple times per process 2022-11-11 16:52:07 -07:00
Jonathan 66d7ae98e5 half memory usage for lightmaps & ray colors 2022-11-06 02:21:11 -05:00
Eric Wasylishen ff54f86708 light: fix invisible shadow casters crash 2022-11-03 22:26:41 -06:00
Eric Wasylishen 2bd2515792 all: cleanup unused includes (Clion - detect not directly used) 2022-10-31 21:37:34 -06:00
Eric Wasylishen c78b0396a9 light: fix wrong opacity of trans33/trans66 translucent shadows
- support _light_alpha key in q2 mode
- add q2 translucent shadows testmap
2022-10-19 00:00:47 -06:00
Jonathan 4ecd945587 use kmq2 flag instead of 33 | 66, which no engine supports 2022-09-10 07:49:06 -04:00
Jonathan 426668701e clip_back/clip_front to match ChopWindingInPlace
simplify constructors for winding heap
use std::vector again for mapentity_t since it's being copied because of the std::list
2022-08-08 21:08:27 -04:00
Jonathan 24168c8e40 clang pass 2022-08-02 21:57:33 -04:00
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Eric Wasylishen d32d6ea81d light: rename options -> light_options 2022-07-10 17:28:28 -06:00
Jonathan 033a84cac8 cache anything related to triangle-face info in a single struct that we access per ray 2022-06-25 22:22:24 -04:00
Jonathan a4c304272a use floats for dealing with ray info, for consistency (and to avoid a bunch of float->double casts)
use raydir from hit point rather than calculating it twice
2022-06-25 04:47:26 -04:00
Jonathan 1d221d3999 only use Embree stuff 2022-06-22 22:23:48 -04:00
Jonathan 41ef66190f consistency rename; gtexinfo_t -> mtexinfo_t 2022-06-16 09:36: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 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 e2d64e0e5d FS simplification
Fix transparency calculation (33% is 33% opacity, not 33% transparency)
2021-12-20 14:51:14 -05:00
Jonathan 0e361f9323 Support for Q2BSP decompilation
- there's still a couple failure cases - specifically base1 in the outdoor area has a side that wasn't able to match to a face
- the clip brush at the start of base1 gets cut into a bunch of pieces because of the whole "check for texinfo, compare and split into multiple pieces" thing, but I'm pretty sure it's just one single brush - we need to ignore the splitting thing on clip brushes since they don't care about texture
- triggers don't pull in a temp texture
- origin brushes?
2021-10-27 17:56:56 -04:00
Jonathan e0ed70cc87 no more Vector! 2021-10-25 10:38:15 -04:00
Jonathan 3c2ca93b0c normalizeInPlace no longer nodiscard since you might want to only normalize the ref
remove VectorNormalize
2021-10-23 13:34:12 -04:00
Jonathan 74253fd189 Fixed Unix/Clang compilation
Adjusted makefile to work with both clang and msvc on win32
Removed "WIN32", use the standard _WIN32 instead
Fixed bad VectorCopy's
Use qvec4b instead of special color_rgba type
qvec now follows built-in type procedures for handling operators; this means that (qvec3i + qvec3f) will now properly produce a float, as one would expect, instead of adding the float to the integers without casting to the common type.
2021-10-23 07:35:41 -04:00
Jonathan a21be0362c replace VectorCompare, CrossProduct, DotProduct
qv::dot handles inputs a bit more gracefully now
plane::distance_to for distance checks, and dplane has the fast version
2021-10-21 23:25:19 -04:00
Jonathan cb3c81aaf8 vec3_t gonedy 2021-10-21 20:21:28 -04:00
Jonathan 95b47db922 More qmat/qvec where appropriate
Add a json.hh file which includes common JSON serialization types
surfflags_t::extended uses booleans instead of a bitflag for simplicity
JSON serialization for surfflags
2021-10-19 21:15:00 -04:00