Commit Graph

1439 Commits

Author SHA1 Message Date
Eric Wasylishen 0aeb0acd94 qbsp: adjust tjunc logic 2024-01-24 00:22:27 -07:00
Eric Wasylishen b66c95a53f tests: add q2_mist_transwater 2024-01-23 20:36:34 -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
Eric Wasylishen 07e050f484 light: restore -bounce flag with no arguments as a shorthand for -bounce 1 2024-01-13 18:35:18 -07:00
Eric Wasylishen 1c692d6f47 qbsp: record portal type 2024-01-05 12:32:01 -07:00
Eric Wasylishen 8ab9960ca0 lightpreview: don't crash when vis is run more than once 2023-12-24 17:22:01 -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 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
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
Erika b45871efdb
vis algorithm improvement (2h42 -> 57m on ad_dm5) (#361)
* vis algorithm improvement, new commandline option -targetchecks

* vis: only calculate num_expected_targetchecks if needed

Fixes a bit of performance regression when -targetchecks was added, when running
with -targetchecks 0, apparently due to the cost of all the std::popcount's.

gmsp3v2.bsp, 32 threads:
18s (brushbsp branch 9388d43b1c)
21.1s (vis algorithm improvement)
18.2s (this commit)

* vis: default targetchecks to 0.5

gmsp3v2.bsp vis, 32 threads: 18.2s -> 10.6s

---------

Co-authored-by: Eric Wasylishen <ewasylishen@gmail.com>
2023-12-02 13:41:56 -07:00
Eric Wasylishen b58b976693 tests: add qbsp content type tests 2023-11-26 00:23:41 -07: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 d5ffbd9d33 qbsp: remove unused type 2023-11-18 23:24:03 -07:00
Eric Wasylishen c77f4ba2dd qbsp: fix misc_external_map + -wrbrushes
- fix world extents not including external maps
- thanks @DaZombieKiller for pointing this out

Fixes #372
2023-11-18 15:14:38 -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 5bcb2d4657 vis: remove MAX_PORTALS_ON_LEAF
reduces memory use a bit

gmsp3v2.bsp - 51.96s elapsed
2023-11-11 13:10:01 -07:00
Eric Wasylishen 37fc62ca0e vis: remove dead code from header 2023-11-11 12:29:30 -07:00
Eric Wasylishen 8888506821 qbsp: fix -notex option 2023-11-09 23:57:07 -07:00
Eric Wasylishen 8845866c00 qvec: use fold expression for qv::dot
seems to help codegen on msvc.

gmsp3v2.bsp vis times: 51.9s , 52.1s
prev commit was 56s
2023-11-09 00:25:31 -07:00
Jonathan 0ea6b0989c clean up vec stuff a bit
constexpr assignment operators
2023-11-09 01:38:17 -05:00
Eric Wasylishen f1bf0f546d add missing #pragma once's 2023-11-08 21:30:44 -07:00
Eric Wasylishen c9edf4ddaa vis: huge speedup from fixing false sharing with stat counters
gmsp3v2.bsp, 32 threads 3950x, 157s -> 61s
2023-11-08 00:05:08 -07:00
Eric Wasylishen 7e5ad9a39b lightpreview: add support for Q1 visdata 2023-11-06 22:54:21 -07:00
Eric Wasylishen e9532346c7 vis: partly fix perf regression of Oct 2021
- drops usage of winding_storage_hybrid
- makes pstack_t trivially default initializable again (like the C
  original)
- we weren't making use of the unlimited size of winding_storage_hybrid;
  the original vis already has an allowance for if a winding exceeds
  the fixed stack allocation size (24) and we were still applying that
  limit

before:

cmake-build-release\tests\tests.exe -r=xml -sf=*benchmark.cc
Testing started at 1:53 PM ...

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|               45.15 |       22,149,002.06 |    0.1% |      0.01 | `create pstack_t`
|               47.04 |       21,256,429.80 |    0.1% |      0.01 | `create pstack_t + 1x AllocStackWinding`
|               48.28 |       20,710,594.32 |    0.2% |      0.01 | `create pstack_t + 2x AllocStackWinding`
|              128.52 |        7,780,603.30 |    0.3% |      0.01 | `setup + ClipStackWinding`

Benchmark from: https://www.quaddicted.com/tools/vis_benchmark

cmake-build-release\vis\vis.exe -nostate -nopercent gmsp3v2.bsp

153.31s elapsed

after:

cmake-build-release\tests\tests.exe -r=xml -sf=*benchmark.cc
Testing started at 1:46 PM ...

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|                1.64 |      610,528,630.06 |    0.3% |      0.01 | `create pstack_t`
|                3.29 |      303,895,535.45 |    0.6% |      0.01 | `create pstack_t + 1x AllocStackWinding`
|                5.20 |      192,172,148.84 |    0.2% |      0.01 | `create pstack_t + 2x AllocStackWinding`
|               66.84 |       14,960,818.66 |    1.0% |      0.01 | `setup + ClipStackWinding`

Benchmark from: https://www.quaddicted.com/tools/vis_benchmark

cmake-build-release\vis\vis.exe -nostate -nopercent gmsp3v2.bsp

141.42s elapsed
2023-11-05 13:58:36 -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 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