Commit Graph

2676 Commits

Author SHA1 Message Date
Jonathan defa4cafce 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
2022-07-04 14:48:22 -04:00
Jonathan 32f33fb4b3 improved path detection (and overriding) routines 2022-07-03 18:23:19 -04:00
Jonathan b8bb4cdd2a bounce lighting fix
change defaults for Q2 to look a bit closer to how it looked before
2022-07-02 17:22:11 -04:00
Jonathan 0baa788d7e fix bounced lighting 2022-07-02 16:59:04 -04:00
Jonathan b43e80911e fix some weird maps with zero area faces trying to bounce 2022-07-02 09:30:41 -04:00
Jonathan 0e27f96e7b 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-01 23:28:02 -04:00
Jonathan c112dee937 fix AABB accumulation 2022-07-01 23:07:51 -04:00
Jonathan b0ae7d86bf only generate bounds if rays is enabled
don't lightmap sky again
2022-07-01 22:41:46 -04:00
Jonathan f3df01472e merge in all of the non-bsp-related brushbsp changes so the brushbsp branch isn't so diverged 2022-07-01 19:12:31 -04:00
Jonathan 8139a80112 re-add nodraw/sky warning
# Conflicts:
#	qbsp/map.cc
2022-06-30 15:13:18 -04:00
Jonathan ee65e46d0a init palette for Q2 2022-06-30 02:43:25 -04:00
Jonathan 410106ff90 fix uninitialized memory 2022-06-29 14:27:00 -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 aac5027ec6 simplify texture load 2022-06-28 10:35:17 -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 c23b7d2ec9 allow Quake-likes to load textures similarly to Q2 (finding best place to load them from)
allow Quake and Q2 to handle other texture formats (mainly just TGA for now)
2022-06-27 11:30:28 -04:00
Jonathan bf1cb56e5a fix build
add setting to control file priority
2022-06-27 10:41:24 -04:00
Jonathan 3b777a05a9 remove unnecessary init_palettes 2022-06-27 08:13:32 -04:00
Jonathan 732621c59a fix bugs in miptex writing
clear FS when loading filesystem again (for tests mainly)
move img::load_palette to where it is in brushbsp
2022-06-27 08:13:04 -04:00
Jonathan ba7c18fd35 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-06-27 03:58:41 -04:00
Jonathan 510023e089 step 1 of finishing the rewrite I started of the image subsystems.
- for Quake-likes, WADs will be added as file system archives directly when the first brush is encountered since the wad key is ready to go by that point.
- after loading the .map and before constructing the BSP, what I call secondary textures (animation frames for Quake-likes) are added to the list, and the BSP's miptex data is filled.
- BSP miptex data is now opaque to the BSP process; the BSP simply copies the raw miptex information from the input. This simplifies the BSP structures and reading/writing routines.
- the img subsystem supports reading from raw miptexes now, although in practice this only happens for Quake-likes atm
- instead of a "wal cache", maps now have a "meta cache" which stores the metadata information for all games instead of just Quake II
- texture meta can now be ref'd out rather than needing to be copied every time (mainly only a gain for the std::string)
- wad.cc/wad.hh is gone; wads are now pushed into the filesystem archive
- fixed broken wad_archive
- fs subsystem iterated on a little bit; supports marking archives as external (only used for wads currently; see `LoadTextureData`)
- load_tga has better error handling
- add in foot-gun protection to the BSP readers; now they assert on failure to read instead of silently propagating that error throughout the rest of the process
- bsputil uses img stuff now, so it should handle palettes better
2022-06-27 03:58:23 -04:00
Eric Wasylishen 9423e68e9f qbsp: fix _noclipfaces 2022-06-17 17:55:17 -06:00
Eric Wasylishen 8c90c5c3dc qbsp: fix dangling std::string access through string_view 2022-06-16 20:58:46 -04:00
Eric Wasylishen a746506d6a clang-cl build fix 2022-06-16 20:54:15 -04:00
Jonathan eedabe6f1c fix bugs 2022-06-14 18:38:22 -04:00
Jonathan d24ea4922a entdict cleanup 2022-06-14 17:18:13 -04:00
Jonathan 79ca3c1543 fix inversion on content types portal visibility in Q2 (opaque water, etc was considered see-through; now it correctly assumes they are solid) 2022-06-10 06:53:38 -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 5b4660fa63 simplify crc code 2022-06-10 04:47:10 -04:00
Jonathan 42c4060a64 canonize plane stuff into an enum type, remove duplicates
more macros into constexpr's
use options.epsilon directly instead of ON_EPSILON in qbsp
2022-06-10 04:43:56 -04:00
Jonathan 0d56c49d7a remove hardcoded lightstyles max, use config option 2022-06-10 04:22:12 -04:00
Eric Wasylishen 4941a86cbe qbsp: rest of fix for qbsp_q2_bmodel_collision, only needed on type-cleanup branch 2022-06-07 19:49:39 -06:00
Eric Wasylishen 0326374d68 testqbsp: bmodel collision issue where world and bmodel are interfering 2022-06-07 19:27:42 -06:00
Eric Wasylishen 633aaf3954 testqbsp: mark lavaclip test as [!mayfail] 2022-06-07 19:27:16 -06:00
Jonathan 76ac68861e Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-06-07 20:36:22 -04:00
Jonathan d348a4cb6b fix nodes getting negative planes from certain splits
# Conflicts:
#	include/qbsp/brush.hh
#	qbsp/solidbsp.cc
2022-06-07 20:31:28 -04:00
Eric Wasylishen a12427b47d decompile: fix --decompile-ignore-brushes 2022-06-06 00:07:39 -06:00
Eric Wasylishen c2b39a6502 decompile: fix texture name crash with missing texinfo 2022-06-06 00:07:37 -06:00
Eric Wasylishen fe31e1c1ce bsputil: add --decompile-ignore-brushes option for visualizing leafs in q2 maps 2022-06-06 00:07:31 -06:00
Jonathan 490ea24fc1 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-06-04 02:28:29 -04:00
Eric Wasylishen e3892617ed testqbsp: add testmap for q2 lava intersecting clip (fails currently) 2022-06-03 23:29:23 -06:00
Eric Wasylishen b6c421d30e bspfile.hh: #define -> constexpr for content flags 2022-06-03 20:12:04 -06: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
Eric Wasylishen 3d8da90eec Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-06-02 20:58:06 -06:00
Eric Wasylishen 5488f47eda light: GetDirectLighting: fix wrong order in surfpointToLightDist calculation 2022-06-02 20:58:03 -06: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 d05b8fc3db don't output texinfo for SKIP faces - rendered faces won't reference them anyways (unless includeskip is on) 2022-06-02 18:59:51 -04:00
Jonathan a7afc4fbb5 fix infinite loop chain again 2022-06-02 14:31:23 -04:00
Jonathan 9bce4fd80a move the sky|nodraw fix to an earlier stage 2022-06-02 12:18:58 -04:00
Jonathan 6ba71cb1b9 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-06-02 10:23:44 -04:00