Commit Graph

1301 Commits

Author SHA1 Message Date
Eric Wasylishen 02be89079f light: fix test failures from refactoring 2024-06-04 22:41:55 -06:00
Jonathan b5089ce349 slight speedup by helping embree with alignment
merge some light algorithms together
allow changing attenuation on surface lights with _surflight_atten
replace some emplace_back's with push_back to improve compilation times
2024-06-02 19:49:32 -04:00
Jonathan 0f844ad3e2 don't output debug stuff if we don't need it 2024-05-29 07:12:56 -04:00
Eric Wasylishen 30868eacb7
light: LIGHTING_E5BGR9 + HDR .lit support (#427)
* light: Add support for LIGHTING_E5BGR9.

This is not really finished. Currently mutually exclusive with
regular RGBLIGHTING, and not tested with external .lit file.

* light: replace HDR_PackResult with a version following the OpenGL spec

- add HDR_UnpackE5BRG9 for unpacking
- caller is now responsible for scaling 128 -> 1
- expose in header for tests

* light: move HDR_PackE5BRG9/HDR_UnpackE5BRG9 to common/litfile.hh

* build: std::powf not available in gcc

* common: move LoadLitFile to litfile.hh

* common: LoadLitFile: return hdr variant as well

* lightpreview: add an Exposure slider

* lightpreview: support hdr .lit's, wip

* tests: refactoring to set up testing for hdr lit's

* tests: add test for -hdr and -bspxhdr

* tests: fix LM_Sample to deal with styles correctly

* lightpreview: fix glsl error

* lightpreview: show dialog box for glsl compile errors

---------

Co-authored-by: Daniel Svensson <dsvensson@gmail.com>
2024-05-26 21:55:10 -06:00
Jonathan 6c9962eb8c some more memory adjustments
settings cleanup, maputil/bsputil changes

(cherry picked from commit 59ac57306f13ff53f935f51bb5df1e59e76753ef)

# Conflicts:
#	bsputil/bsputil.cc
2024-05-20 11:28:03 -04:00
Eric Wasylishen 28190f5065 light: warn rather than fatal error on invalid "delay" settings 2024-04-01 12:02:39 -06:00
Eric Wasylishen 21b3b696f3 light: enable RTC_SCENE_FLAG_ROBUST to fix q1_light_sun_artifact 2024-03-30 23:06:07 -06:00
Eric Wasylishen 992b6f0064 light: fix "mangle" on _sun 1 entities
Fixes #266
2024-03-30 11:41:12 -06:00
Eric Wasylishen 3d68b12473 light: never write .lit/.lux in Q2 mode
fixes `-dirtdebug` broken in lightpreview
2024-03-16 15:07:18 -06:00
Jonathan 71aa8aaeea
Paril/mem write (#412)
* simplify light_surfaces storage

* memory on writes

* Revert "batch together traces on the whole surface - saves a small amount of time"

This reverts commit 72611b7e97.

# Conflicts:
#	light/ltface.cc

* fix a use-after-move

* don't try to write lightmap if it has no styles

* fix issue with alignment
2024-03-13 20:01:05 -06:00
Eric Wasylishen aa3b8479b4 qbsp: shrink node_t from 280 to 208 bytes
- contentflags_t from 80 to 8 bytes
2024-03-09 19:37:23 -07:00
Jonathan 3d419853d3 store leaves on surf instead of surface light 2024-03-09 00:14:03 -05:00
Jonathan 6c1feb5af8 cut per-surface memory usage down by making streams re-usable per thread 2024-03-08 23:09:16 -05:00
Eric Wasylishen f3da00395d style: replace (void) with () 2024-02-26 21:07:22 -07:00
Eric Wasylishen 12b8066246 light: change remaining double -> float
tiny perf improvement on base1-test.map with light params:

-emissivequality high

before: 7.4s
after: 6.9s

no visible changes in base1.
2024-02-25 23:42:45 -07:00
Eric Wasylishen 227a92f8a2 build: get rid of "bin" subdirectory 2024-02-04 19:52:16 -07:00
Jonathan 53850d94ac fix crash in embree tracing due to new batching code
simplify structs for tracing
2024-01-21 08:52:16 -05:00
Jonathan 72611b7e97 batch together traces on the whole surface - saves a small amount of time 2024-01-19 08:48:51 -05:00
Jonathan 0ff4e8ddd5 fix gate on lightgrid 2024-01-17 02:27:50 -05:00
Jonathan a04bb771ce disable gate on high quality 2024-01-14 23:10:21 -05:00
Eric Wasylishen 07e050f484 light: restore -bounce flag with no arguments as a shorthand for -bounce 1 2024-01-13 18:35:18 -07:00
Jonathan Linat 39074b8249
CI: Enable Qt5 + lightpreview (#406)
* chore(CI): refine current 'cmake.yml' file content

* chore(CI): enable Qt5 on Linux and macOS

* Appveyor.yml: remove deploy step

we are deploying from GitHub Actions now

* build-linux-64.sh: adjust .zip wildcard

to hopefully not break on PR builds

* build-linux-64.sh: remove fragile unzip/readelf lines

* lightpreview\CMakeLists.txt: only install Qt on Win/Mac

* lightpreview: attempt to fix mac Qt packaging

* lightpreview: apple fixes

* Install qtdbus on macOS

* try alternate dbus module name

* try cmake find_package for dbus

* also find Qt5PrintSupport

* build-osx.sh: remove coreutils install

we don't use sha256sum anymore

* lightpreview/CMakeLists.txt: create .app bundle on macOS

* Update CMakeLists.txt

* build-*: run cpack as part of the build command

on my macOS test system, running cpack separately
is doubling the build time

* cmake: factor out add_loader_path_to_rpath function, apply to all targets

* chore(CI): add steps to re-pack the 'doc' and 'bin' directories

* chore(CI): remove GitHub release-related step (to be re-introduced)

* chore(CI): adjust inflating destination directories

---------

Co-authored-by: Eric Wasylishen <ewasylishen@gmail.com>
2024-01-08 20:16:41 -07:00
Eric Wasylishen 8db1d32e9f light: fix excessive bouncing with lit water, or _shadow -1
Fixes #397
2023-12-24 00:44:56 -07:00
Eric Wasylishen 6351cc50e6 rename: vec_t -> double 2023-12-23 21:09:16 -07:00
Eric Wasylishen 89908df90f light: fix nan's (fully black lightmap) in some cases when using _surface lights 2023-12-23 18:53:58 -07:00
Eric Wasylishen f0c8d92993 qbsp: add -missing_textures_as_zero_size flag to allow writing 0x0 textures when a texture is missing
this allows us to write the texture name, but it's non-standard.

light: warn when a surface light template doesn't match any faces in the bsp
2023-12-21 00:05:40 -07:00
Eric Wasylishen 3673162f63 fix build errors + test failures from double -> float changes 2023-12-07 23:06:52 -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
Eric Wasylishen ad9fd7fc59 common: structured bspxbrushes reading/writing 2023-11-25 17:28:26 -07: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
Eric Wasylishen 22ad2f4141 light: cache list of lightsurfs that are actuall emissive
light.exe -visapprox none ad_sepulcher.bsp

45.5s -> 22.7s
2023-11-13 23:35:32 -07:00
Eric Wasylishen 7e5ad9a39b lightpreview: add support for Q1 visdata 2023-11-06 22:54:21 -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 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
Eric Wasylishen 872f5fe8a0 build: copy + install mingw dll's libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll 2023-09-16 14:28:06 -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
Eric Wasylishen 507c315f78 light: fix missing textures accidentally activating "suntexture" feature and breaking sunlight
Fixes #376
2023-09-11 21:44:38 -06:00
Jonathan 69bc2c04c0 fix crash if projected texture is not found 2023-09-08 10:43:48 -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 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 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 b71a4ebaf1 light: wip fix for two-sided liquid lighting + surface lights 2023-08-28 23:33:55 -06:00
Jonathan 8cb2b72237 restore default visapprox 2023-08-26 23:06:49 -04: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