Commit Graph

138 Commits

Author SHA1 Message Date
Jonathan 210d994445 cherry pick commit 96cd23761c from @Shpoike
Removed legacy switchable lightstyles limit (requires updated engines when exceeded). Added -facestyles argument that allows for >4 styles per face, as well as potentially increasing style indexes to 16bit for far far more switchable styles.
2022-06-21 15:35:39 -04:00
Jonathan c79e263753 simplify bspx code
remove old obj preview for wrnormals
2022-06-20 20:42:34 -04:00
Jonathan e366898796 re-introduce vis culling, mainly for Q2/surface lit maps
-novisapprox gone; replaced with -visapprox auto|none|vis|rays
2022-06-18 23:56:45 -04:00
Jonathan 41ef66190f consistency rename; gtexinfo_t -> mtexinfo_t 2022-06-16 09:36:31 -04:00
Jonathan 0d56c49d7a remove hardcoded lightstyles max, use config option 2022-06-10 04:22:12 -04:00
Jonathan 11f937f0ad add mottling that was used for _minlight on objects in Q2 maps
fix _minlight for Q2
set up a few better defaults for Q2
temp-ish fix for areaportals
2022-06-02 01:05:41 -04:00
Jonathan 65852ef042 adjust settings_set to only accept one token per entry
radlights is now a set (only loads one though)
2022-06-01 20:42:06 -04:00
Jonathan e5685b0909 fix "soft"'s special weirdness 2022-05-15 21:27:34 -04:00
Jonathan 8012d46e46 fix this so soft works at the end of the list 2022-05-15 21:24:01 -04:00
Eric Wasylishen 8fe5d9d694 common: adjust formatting of usage line
-remove version hash as it's printed above
-rename `usage` variable to `programDescription`
2022-05-15 17:44:17 -06:00
Eric Wasylishen abc799554d build: fix all clang-cl warnings 2022-05-10 21:57:17 -06:00
Jonathan 1b852e3a20 fix WINDOW issue
surflight_subdivide minimum 1.0, to allow for people breaking their computers
2022-04-30 22:26:08 -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 0c827208ec Allow `-subdivide 0` to turn off subdivision
imglib now lives in common
fs 'load' split into two functions, where and load. the former allows you to query for and return archive & path for a given file, whereas the latter handles that for you.
use log verbose in light rather than own verbose flag
2021-11-21 15:08:02 -05: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
Jonathan a7de4bdae2 Remove unused thingies
Use qplane3 where we can
2021-10-17 06:24:02 -04:00
Jonathan e1290fd0f4 Snap normals/tangents/bitangents written from WriteNormals to save some bits
Texvec inherits mat<2, 4> now, since it's the most logical type for it to be based on.
2021-10-12 13:52:47 -04:00
Jonathan 52839d4e7f Run clang-format pass 2021-10-05 15:54:06 -04:00
Jonathan 0833d84a7a Calculate tangents and bitangents (need to clean this up)
Implement formatters for qvec
Add -nolighting, which skips all non-lightstyled lights
2021-10-05 01:07:13 -04:00
Jonathan 037c587352 Merge remote-tracking branch 'remotes/origin/qbsp-contentflags' into type-cleanup
# Conflicts:
#	bspinfo/bspinfo.cc
#	include/common/bspfile.hh
#	include/light/light.hh
#	include/light/trace.hh
#	light/light.cc
#	light/ltface.cc
#	light/trace.cc
#	qbsp/brush.cc
#	qbsp/csg4.cc
#	qbsp/outside.cc
#	qbsp/qbsp.cc
2021-10-03 13:08:50 -04:00
Jonathan ae4512da2c BSPX structurization and cleanup
Some more vec3_t removals
A bunch of float -> vec_t in light
Simplified construction of lockables
mapdata_t writes directly to an mbsp instead of vector copies
2021-10-03 12:16:13 -04:00
Eric Wasylishen 2fc1e9099a light: remove dead / non-working code for non-embree light tracing 2021-10-02 21:12:12 -06:00
Jonathan 792951792c some more cleanup 2021-10-02 05:56:45 -04:00
Jonathan 9d828d2085 Structured texture data!
Move vis decompress/compress back to vis since phs is handled there now too
Fix missing textures in Q1BSP
Comment areaportaling for now
2021-09-30 11:33:04 -04:00
Jonathan 6ff2d67d12 major C++-esque change to BSP conversion:
- main mbsp types are declared first in the files, and types that were single-member are now not structs
- conversion is handled by the sub-types themselves. Currently no diagnostic for *what* members overflow, but, overflow is handled via thrown exceptions on all overflowable members
- aabb type is used where appropriate now, simplifying a few areas
2021-09-22 17:30:46 -04:00
Jonathan 326626f127 Remove some old stuff
Cleanup/rework of logging system. I'm not too happy about it still, but, it's at least a bit easier to follow now.
Started cleanup of file-related stuff.
2021-09-19 18:17:28 -04:00
Jonathan e8bd554cc0 winding_t is now a C++ type - a hybrid stack/heap array.
In preparation for converting all of the vec_t[3] to qvec's, the Vector routines are now templated and work with any type that provides indexing operators.
Polylib.cc is gone, since this all needs to be in header now
qvec can now implicitly convert from T[N]
constexpr where appropriate
static inline -> inline
side_t is now an enum, moved into mathlib
2021-09-16 03:10:51 -04:00
Jonathan 1dd4df1b20 calloc/malloc/free -> new/new/delete (except for specific scenarios) 2021-09-14 11:39:12 -04:00
Jonathan 7f8d2cfb49 Fix single line functions 2021-09-14 02:56:44 -04:00
Jonathan 4e7542b111 Clang format pass
typedef -> using
include guards -> pragma once
typedef struct x { } y; -> struct y { }
some fixes to extremely old code that shouldn't be required any more
2021-09-14 02:32:26 -04:00
Jonathan dad0e61f63 Fix for texinfo/miptex searching routines
surf flags now use the "native + extended" format that will eventually be used for brush contents. Q1 output seems identical, haven't tested Q2 yet.
2021-09-05 16:56:29 -04:00
Eric Wasylishen b5fcdec19e cleanup: remove "byte" typedef 2021-02-07 14:02:35 -07:00
Eric Wasylishen 94c30afac4 light: refactoring necessary to support embree3 2021-01-01 23:48:22 -07:00
Eric Wasylishen eb842ba165 light: arghrad compat: preliminary sky_surface implementation 2020-12-29 13:43:06 -07:00
Eric Wasylishen bb4d6fdea9 light: add arghrad compatible sunlight keys sun_light, sun_color, sun_angle 2020-12-29 12:59:44 -07:00
Julian Priestley 1b714108cd
Add ability to set phong in worldspawn #267 (#305) 2020-11-30 00:42:42 -07:00
Eric Wasylishen b35cb8eb7e light: fixes for bjptools skip faces (which have no associated model) 2020-08-20 12:08:46 -06:00
Eric Wasylishen 03ed0697a4 light: add -litonly option for re-lighting a bsp without modifying it 2020-08-03 00:40:13 -06:00
Eric Wasylishen b132152891 light: allow starting assigning switchable styles before default of 32 2019-10-31 00:40:23 -06:00
Eric Wasylishen f220b2f531 light: support "_suntexture" key on "_sun" "1" entities to limit them
to being cast from a specific sky texture.

Fixes #110
2019-10-09 00:47:39 -06:00
Eric Wasylishen d2ecc73db3 light: support "style" / "targetname" on "_sun" "1" entities.
Fixes #253
2019-10-08 23:43:22 -06:00
Eric Wasylishen ba7bdf86a1 light: increase max sky distance to 1M 2019-04-20 12:27:27 -06:00
Eric Wasylishen b343b9504a qbsp, light: support _minlight_exclude on func_group, detail, etc. 2019-04-05 21:14:39 -06:00
MaxED 07447a633e Rewritten parts of surface light logic. Should resemble qrad3 looks a bit more now...
Added "surflightscale", "surflightbouncescale" and "surflightsubdivision" cmdline/worldspawn settings.
Fixed: a face should not be skipped when it has both sky and nodraw texinfo flags.
Fixed some non-windows compilation errors.
2018-05-25 14:59:22 +03:00
MaxED 0661098bc5 Quake 2 support: area lights, palette/texture loading, transparent/sky/fence face flags. 2018-05-08 15:50:01 +03:00
Eric Wasylishen 69879b4104 light: add -highlightseams flag 2017-12-05 15:09:34 -07:00
Eric Wasylishen d9f112a97f light: add -phongdebug_obj flag 2017-11-25 23:12:23 -07:00
Eric Wasylishen 8ce7a682b1 light: add -debugneighbours 2017-11-23 23:45:15 -07:00