Commit Graph

32 Commits

Author SHA1 Message Date
Eric Wasylishen 832d7d0413 lightpreview: add .lit loading 2023-09-03 11:31:41 -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 40a10b2c52 bspinfo: serialize missing textures (offset -1) to json as null
previously, we were writing a json dictionary which was confusing

- bspfile: fix reading a valid texture followed by a missing texture
(offset -1)

- add missing texture testcase
2023-07-18 00:17:24 -06:00
Eric Wasylishen 7691706bda build: only use <fmt/core.h>, other headers have a heavy compilation time impact 2023-07-02 17:08:14 -06:00
Eric Wasylishen fbea58d679 code formatting pass 2023-06-25 18:29:48 -06:00
Eric Wasylishen 698a492822 bspinfo: factor out lightmap atlas generation from .obj writer 2023-05-20 13:05:22 -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 54ada5be6d bspinfo: don't crash if light data is missing 2022-12-21 20:58:08 -07:00
Eric Wasylishen 4c218f5e91 common: factor out LMSCALE_DEFAULT = 16.0; 2022-11-15 23:52:34 -07:00
Eric Wasylishen ca0efbf3d3 light: wip -world_units_per_luxel and DECOUPLED_LM BSPX lump 2022-11-03 02:39:15 -06:00
Eric Wasylishen 586204a6bc bspinfo: fix half-texel error in .obj lightmap preview 2022-10-29 22:47:35 -06:00
Eric Wasylishen a70ef5ea7b bspinfo: log the .obj/.png creation (lightmap preview) 2022-10-29 22:37:26 -06:00
Eric Wasylishen 636b376577 squash brushbsp-compilation-speedup branch
move function implementations out of headers
2022-10-21 18:00:58 -06:00
Jonathan 25cbbd42aa fix phong calculation
obj output adjustment
2022-09-21 05:35:11 -04:00
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Jonathan 8fc089aa34 fix lmscale with bounce lighting 2022-07-09 23:09:02 -04:00
Jonathan 72fc2f9e07 write out lightmaps by style ID, and do it faster 2022-07-09 01:36:26 -04:00
Jonathan 8696c6ee56 output all lightstyled lightmaps too 2022-07-09 01:36:25 -04:00
Jonathan b1a30496c3 fix bspx_lightmap not getting output by bspinfo
fix LMSTYLE getting output when there's no need for it from -novanilla
2022-07-09 01:36:25 -04:00
Jonathan 13245d14d6 don't crash on unlit maps 2022-07-08 03:45:14 -04:00
Jonathan adc54dac61 fix bug with output of lmstyle/lmoffset lumps
bspinfo will output proper atlasses now
use faceextents_t everywhere
2022-07-08 02:06:07 -04:00
Jonathan 491071260e lightmap display, both vanilla and bspx 2022-07-08 02:06:07 -04:00
Jonathan 43c5e942b2 move faceextents_t & friends to common
use stb_image_write for PNGs for better compression on bsp.json
add in code for spitting out a lightmap from a face. doesn't support other styles and such yet.
2022-07-08 02:06:06 -04:00
Jonathan 59bff81e9d tests for new WAD stuff 2022-06-27 08:14:30 -04:00
Jonathan 26608c1b37 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspfile.cc
#	common/bspinfo.cc
2022-06-27 08:14:03 -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 cf04f644e0 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspinfo.cc
#	include/common/bspfile.hh
#	include/qbsp/map.hh
#	include/qbsp/wad.hh
#	qbsp/wad.cc
2022-06-27 06:44:45 -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
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 df3e6d3988 remove Little* funcs, not used any more
remove byteswap as it wasn't used any more
re-introduce imemstream and omemstream to make it harder to accidentally use the wrong operators
add dynamic padding stream manipulator
use memstreams for BSPX
2022-06-20 21:39:08 -04:00
Jonathan c79e263753 simplify bspx code
remove old obj preview for wrnormals
2022-06-20 20:42:34 -04:00
Eric Wasylishen ba37ae3a54 move serialize_bsp() to common/bspinfo.cc 2022-05-14 14:54:21 -06:00