Commit Graph

55 Commits

Author SHA1 Message Date
Jonathan 41ef66190f consistency rename; gtexinfo_t -> mtexinfo_t 2022-06-16 09:36:31 -04:00
Jonathan f5cda68416 clean up percent stuff
comment out "didn't split" message
fix winding resize
merge phong loops together
2022-03-07 14:49:50 -05: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 0cca14d1b2 Fix bug in bitangent calculation - thank you AlexP
Allow `calc_sides` to skip writing outputs if they are not required, & return counts since they are constant sized
2022-01-20 16:35:56 -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 550cacef3f Clean warnings 2021-10-25 13:46:04 -04:00
Jonathan f4c1d3d863 use TexSpaceToWorld since it seems to generate the same results anyways 2021-10-24 23:18:03 -04:00
Jonathan e1771daf58 More-correct tangent calculation maybe 2021-10-24 17:45:28 -04:00
Jonathan 11c3511605 new normal calculation cherry-picked from branch
Fix entdata not having its '\0'
don't write unnecessary extended texinfo
2021-10-24 15:21:26 -04:00
Jonathan d0e557b9cb Fix BSPX on q2bsp
Fix normalize generating NaNs to match old behavior of generating zero on zero length
Remove extended texinfo file before potentially not writing new one
2021-10-24 06:56:31 -04:00
Jonathan a21be0362c replace VectorCompare, CrossProduct, DotProduct
qv::dot handles inputs a bit more gracefully now
plane::distance_to for distance checks, and dplane has the fast version
2021-10-21 23:25:19 -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 fd18fc154c Fix various warnings by testing a clang-cl compile 2021-10-12 14:39:15 -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 01b8abf93c Removed a lot of unused functions
Moved vector-related operations from mathlib to qvec, moved a few into qv::
Use clamp/max/min directly instead of #define'ing them
Move a few single-use functions directly above their usages
2021-10-10 14:04:09 -04:00
Eric Wasylishen f0f7722909 light: fix build 2021-10-09 11:48:18 -06:00
Jonathan 1b1679fa22 normals are now a special tuple-ish type, so that we can calculate tangents and bitangents for Q2RTX if requested (currently it always does it, but we can fix that later)
always emit texinfo for q2 brush sides
2021-10-08 14:17:48 -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 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
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 a6f6cc2d15 qvec now has an empty default initializer, for speed purposes; fixed up places that relied on this behavior
simplified constructor for qvec(T...) that uses fold expressions
simplified rgba_miptex_t
fixed a lot of broken winding_base_t behavior
merged all winding types into winding_base_t
removed now-empty files
2021-09-27 20:44:15 -04:00
Jonathan 87d31e6d4f A lot of type-y stuff here:
- bsp store vectors now
- vis stored in a way that is compatible with both Q2 and Q1
- binary reading of stuff, so swapping is done at load time now
- vis cleanup, although there's still a lot of raw long modification that should get simplified later
2021-09-25 23:58:02 -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 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 8fd1d89b8d Fix double-delete
Fix typo
2021-09-05 17:39:17 -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 968a840e47 light: make a certain degenerate face non-fatal
seen compiling ad_sepulcher.map with qbism q2 tools
2021-08-29 20:43:55 -06:00
Eric Wasylishen ffe90adc1c light: improve logging 2021-05-21 22:01:09 -06:00
Eric Wasylishen 00e41688c3 light: quake2: arghrad-compatible phong support
(set face "value" to the same non-zero number, have light flag unset)
2020-12-31 12:39:17 -07:00
Eric Wasylishen 707acbc9c5 light: fix lighting artifacts with _mirrorinside. Was missing a plane side
check, so the inside faces were incorrectly considered as neighbours
for distributing sample points onto.

Fixes #236
2019-03-25 20:24:39 -06:00
Eric Wasylishen 339c1d0219 light: add area weighting to phong calculation 2018-01-31 22:52:30 -07:00
Eric Wasylishen cae501972e light: _phong_angle_concave support 2018-01-30 01:48:25 -07:00
Eric Wasylishen 4c86676b6f light: NeighbouringFaces_new: make sure returned edges are orderer right 2017-12-06 00:39:14 -07:00
Eric Wasylishen 71d9f8ce8a light: move NeighbouringFaces_new to phong.cc 2017-12-06 00:23:21 -07:00
Eric Wasylishen 92bacbe7e1 light: FacesOverlappingEdge: return the edge that overlaps 2017-11-24 14:22:54 -07:00
Eric Wasylishen 7170aac1c3 light: FacesOverlappingEdge 2017-11-23 23:45:05 -07:00
Eric Wasylishen 501fb9ee40 light: add FacesUsingVert 2017-11-19 23:47:29 -07:00
Eric Wasylishen 8813d272cb common, light, vis: change from bsp2_t to mbsp_t 2017-10-01 22:32:20 -06:00
Eric Wasylishen c8ac9d2670 light: print position of degenerate faces during phong shading 2017-07-30 12:01:00 -06:00
Eric Wasylishen c0b88b7e99 light: fixes for degenerate faces 2017-07-05 20:43:47 -06:00
Eric Wasylishen ca58e90e15 common: remove EQUAL_EPSILON from mathlib.hh 2017-04-26 14:25:55 -06:00
Eric Wasylishen b1f86d7ac1 common: implement buildMeshFromBSP 2017-04-24 02:01:16 -06:00
Eric Wasylishen 68b084a6c3 replace glm with qvec 2017-04-24 00:26:49 -06:00
Eric Wasylishen 15dd49e093 light: fix last commit 2017-03-18 17:04:22 -06:00
Eric Wasylishen 9c82068160 light: phong: guard against accessing phong caches before they are built 2017-03-18 16:43:22 -06:00