Eric Wasylishen
7170aac1c3
light: FacesOverlappingEdge
2017-11-23 23:45:05 -07:00
Eric Wasylishen
88ee157b97
mathlib: add LinesOverlap function
2017-11-23 23:45:00 -07:00
Eric Wasylishen
501fb9ee40
light: add FacesUsingVert
2017-11-19 23:47:29 -07:00
Eric Wasylishen
b85d627c8f
change branding to ericw-tools
2017-10-19 16:35:37 -06:00
Eric Wasylishen
41527a1c39
light: don't discard near-black lightmaps in q2
2017-10-03 18:16:28 -06:00
Eric Wasylishen
2dc22b7088
common: add loadversion to mbsp_t
2017-10-03 14:17:42 -06:00
Eric Wasylishen
71d675ce09
light: factor out TEX_SPECIAL tests to Face_IsLightmapped
2017-10-03 14:10:57 -06:00
Eric Wasylishen
dff71edfe9
light: very early q2 support. half of the faces seem to be saved without lightmaps for some reason
2017-10-03 00:33:14 -06:00
Eric Wasylishen
8813d272cb
common, light, vis: change from bsp2_t to mbsp_t
2017-10-01 22:32:20 -06:00
Eric Wasylishen
f7635162c9
common: bspfile refactoring
2017-10-01 20:51:16 -06:00
Eric Wasylishen
41b85db84d
light: add comment about last commit.
2017-09-30 21:43:00 -06:00
Eric Wasylishen
0a8a25b95c
Revert "light: for curved surfaces, don't reject hits when the dot product of the surface point normal and surface-point-to-light vector is < 0, since "anglescale" will typically boost the angle factor to 0.5"
...
This reverts commit 26c5f65f4e .
2017-09-30 20:07:27 -06:00
Eric Wasylishen
993e8fb590
light: don't mark sample points inside semi-transparent shadow casters as occluded.
...
fixes #178
2017-09-23 20:31:57 -06:00
Eric Wasylishen
7252ba7841
light: hack -soft to give better results on https://github.com/ericwa/tyrutils-ericw/issues/171
2017-09-16 17:47:40 -06:00
Eric Wasylishen
26c5f65f4e
light: for curved surfaces, don't reject hits when the dot product of the surface point normal and surface-point-to-light vector is < 0, since "anglescale" will typically boost the angle factor to 0.5
...
fixes https://github.com/ericwa/tyrutils-ericw/issues/172
2017-09-16 17:10:48 -06:00
MaxED
d86913aaaf
light: fixed "_sun" light direction was calculated incorrectly when using a light without a target and mangle
2017-08-27 14:20:43 -06:00
MaxED
15871d2531
light: add _spotlightautofalloff
2017-08-27 14:20:03 -06:00
MaxED
604aa92e6f
light: remove dead code
2017-08-27 14:08:18 -06:00
MaxED
fe1e040cd1
Added "_falloff" light property. Allows to set light falloff in map units.
2017-08-23 15:00:32 -06:00
Eric Wasylishen
1d12d6ab4e
Support multiple suns with "_sun" "1" entities.
...
Drop support for overriding properties of these entities with worldspawn keys.
2017-08-23 13:37:59 -06:00
Eric Wasylishen
e5ac4da8a2
Convert indentation to spaces
2017-08-23 12:43:29 -06:00
MaxED
97ab6fcdab
Added arghrad-style sun setup using light entity.
2017-08-23 14:18:10 +03: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
c5370b16eb
light: update -help text
2017-06-27 19:31:19 -06:00
Eric Wasylishen
6f07303504
light: implement _shadowworldonly, fix _shadowself which was broken
2017-06-27 14:48:27 -06:00
Eric Wasylishen
fef1142808
light: add shadowworldonlylist
2017-06-27 13:13:32 -06:00
Eric Wasylishen
78ed70e2a5
light: modelinfo_t: take bsp param
2017-06-27 12:59:17 -06:00
Eric Wasylishen
4dcfc12f50
light: refactor _shadowself handling
2017-06-26 17:42:50 -06:00
Eric Wasylishen
563307445d
light: fix logic for switching lightmaps for switchable shadows
2017-06-26 14:20:15 -06:00
Eric Wasylishen
6e707130be
light: rename dynamic shadow stuff to switchshadstyle" for QC,
...
and "_switchableshadow" for the mapper.
2017-06-26 13:41:24 -06:00
Eric Wasylishen
b71f769c0a
light: experimental support for switchable bmodel shadows:
...
Current specs/limitations:
- only supported for sunlight and regular lights
- enabled with "_dynamicshadow" "1"
- writes the lightstyle to a "dynshadowstyle" entity key, hardcoded
- only handles one dynamic occluder for a given lightmap sample
- styled lights passing through a dynamic occluder turn non-styled
2017-06-25 20:06:46 -06:00
Eric Wasylishen
ce8ad6c384
light: handle iffy faces
2017-06-15 13:43:42 -06:00
Eric Wasylishen
2c0e58e628
mathlib: add test for FractionOfLine with degenerate line
2017-06-15 03:30:48 -06:00
Eric Wasylishen
42af888f3d
testlight: add failing test for ClosestPointOnLineSegment_Degenerate
2017-06-15 03:30:35 -06:00
Eric Wasylishen
3fc72e37d1
build: fix path for embree .dylibs/.so's
2017-06-10 22:00:49 -06:00
Eric Wasylishen
ea099775ef
qbsp, light: allow _shadow -1 to disable shadows from func_detail
2017-06-05 14:01:12 -06:00
Eric Wasylishen
197697ca73
light: fix black rotators
2017-06-05 14:00:50 -06:00
Eric Wasylishen
66bc8209eb
light: loosen point off plane assertion
2017-06-05 14:00:16 -06:00
Eric Wasylishen
b096019237
build: update mac and linux for embree 2.15.0
2017-04-28 15:26:40 -06:00
Eric Wasylishen
f0935f1f93
build: fix light CMakeLists.txt
2017-04-28 14:07:36 -07:00
Eric Wasylishen
e0564e8c2a
common: mathlib: don't need #define ANGLEEPSILON
2017-04-26 14:29:07 -06:00
Eric Wasylishen
ca58e90e15
common: remove EQUAL_EPSILON from mathlib.hh
2017-04-26 14:25:55 -06:00
Eric Wasylishen
902c45c946
all: make VectorCompare take an explicit epsilon
2017-04-26 14:20:45 -06:00
Eric Wasylishen
15cc98eb27
common: move SignedDegreesBetweenUnitVectors from qbsp, add test
2017-04-26 14:04:33 -06:00
Eric Wasylishen
b1f86d7ac1
common: implement buildMeshFromBSP
2017-04-24 02:01:16 -06:00
Eric Wasylishen
5eb4fd8790
common: make Face_Plane_E return a plane3f
2017-04-24 01:54:25 -06:00
Eric Wasylishen
0a64905df8
common: fix msvc build errors
2017-04-24 00:34:37 -06:00
Eric Wasylishen
68b084a6c3
replace glm with qvec
2017-04-24 00:26:49 -06:00
Eric Wasylishen
122b5ff51c
common: qmat: use NaN to indicate no inverse
2017-04-24 00:19:47 -06:00
Eric Wasylishen
7887318def
common: move vec_from_mangle and mangle_from_vec to mathlib
2017-04-23 19:31:00 -06:00
Eric Wasylishen
881f12da52
common: add test for RotateFromUpToSurfaceNormal
2017-04-23 19:28:05 -06:00
Eric Wasylishen
4da864707c
light: remove use of glm::quaternion
2017-04-23 17:58:24 -06:00
Eric Wasylishen
eeb00bf74c
common: tidy qmat
2017-04-23 17:41:19 -06:00
Eric Wasylishen
efd48b48f5
common: add test for matrix inverse
2017-04-23 16:08:58 -06:00
Eric Wasylishen
8a4d1ff218
common: add 4x4 (from mesa) and 2x2 matrix inverse
2017-04-23 15:58:51 -06:00
Eric Wasylishen
0358bc07b8
common: mesh_t: first draft of tjunc fixing
2017-04-23 02:06:20 -06:00
Eric Wasylishen
3f067e001a
common: add DistToLineSegment
2017-04-23 02:05:19 -06:00
Eric Wasylishen
56513cdb8e
common: add DistToLine
2017-04-23 01:39:59 -06:00
Eric Wasylishen
b8f5a4f8e1
common: change mesh_t to use qvec3f
2017-04-22 20:39:50 -06:00
Eric Wasylishen
4996796944
light: reduce size of mathlib.octree_basic perf test
2017-04-22 20:36:03 -06:00
Eric Wasylishen
28081f50c6
common: make float/double versions of aabb3
2017-04-22 15:11:41 -06:00
Eric Wasylishen
ee7181521d
fix build
2017-04-22 13:54:12 -06:00
Eric Wasylishen
c1189abccd
common: split up new octree/mesh/aabb/qvec stuff
2017-04-22 13:29:32 -06:00
Eric Wasylishen
60418ce9a7
light: add maximum switchable lights to log message
2017-04-22 11:53:55 -06:00
Eric Wasylishen
f4c9b6c1a7
mathlib: expand qvec constructors
2017-04-20 12:32:37 -06:00
Eric Wasylishen
814e1675c9
test_light.cc: add missing include
2017-04-19 19:59:20 -06:00
Eric Wasylishen
5b63ddbeba
mathlib: octree, aabb_t rework
2017-04-19 14:02:30 -06:00
Eric Wasylishen
055b5061f1
light: start a mesh_t class
2017-04-19 14:02:19 -06:00
Eric Wasylishen
a0a7021707
light: refactor position_t from tuple to class
2017-03-29 16:09:49 -06:00
Eric Wasylishen
10386581a6
light: make bounce of styled lights opt in with "_bouncestyled" worldspawn key
2017-03-27 16:44:04 -06:00
Eric Wasylishen
f957cba775
light: experimental bounce version using final gather
2017-03-21 21:01:09 -06:00
Eric Wasylishen
b911c70372
light: do bounce after phong
2017-03-19 14:20:47 -06:00
Eric Wasylishen
30d9a53341
light: move FractionOfLine to mathlib
2017-03-18 23:26:16 -06:00
Eric Wasylishen
3e7b4448c1
mathlib: add GLM_PolyArea
2017-03-18 23:26:10 -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
Eric Wasylishen
880ad3b381
bpsutil, common, light, vis: bounds check bsp->dfaces access
2017-03-18 16:31:52 -06:00
Eric Wasylishen
29884e2b4a
bsputils: add bounds checking to Face_GetNum
2017-03-18 16:17:01 -06:00
Eric Wasylishen
8a83e3d351
light: BounceLightsForFaceNum(): return indices so we have 1 main copy of the bounce lights
2017-03-15 13:22:43 -06:00
Eric Wasylishen
c2c3e915e6
light: fix leak of lightsurf->realfacenums
2017-03-15 13:22:35 -06:00
Eric Wasylishen
18b75ec904
light: rewrite -bouncelightsdebug to handle patches smaller than a face
2017-03-15 10:59:40 -06:00
Eric Wasylishen
33fbe56e12
light: save poly edge planes for bouncelights
2017-03-15 10:59:31 -06:00
Eric Wasylishen
1d66039b2c
light: save poly for bouncelights
2017-03-15 10:59:25 -06:00
Eric Wasylishen
154158ddba
light: BounceLightsForFaceNum: avoid an unnecessary std::vector copy
2017-03-15 10:59:16 -06:00
Eric Wasylishen
b8f015d452
light: Texture_AvgColor: return glm vector
2017-03-12 15:56:46 -06:00
Eric Wasylishen
686696c362
light: Palette_GetColor: return glm vector
2017-03-12 15:41:52 -06:00
Eric Wasylishen
102bdc49f0
light: drop IntersectSingleModel api
2017-03-12 15:06:07 -06:00
Eric Wasylishen
0eb6864744
mathlib: add GLM_PolyRandomPoint
2017-03-12 12:58:36 -06:00
Eric Wasylishen
63e8f42c87
light: ray stream api: allow getting hit face
2017-03-07 13:37:52 -07:00
Eric Wasylishen
553f02d582
light: restore performance of bounce lighting
2017-03-06 22:50:20 -07:00
Eric Wasylishen
8e24cc764d
Revert "build: force a test failure"
...
This reverts commit f45a1a715d .
2017-03-06 14:01:56 -08:00
Eric Wasylishen
e314a3547f
light: vs2013 doesn't support constexpr
2017-03-06 13:54:47 -08:00
Eric Wasylishen
f45a1a715d
build: force a test failure
2017-03-06 13:48:48 -07:00
Eric Wasylishen
48a6314dfb
light: bounce styled lights
2017-03-05 20:05:34 -07:00
Eric Wasylishen
bc5d293072
light: try moving rpath setting in CMakeLists.txt
2017-03-05 13:21:29 -07:00
Eric Wasylishen
461afbc15d
light: remove ltface2.cc/hh
2017-03-01 13:20:09 -07:00
Eric Wasylishen
b163f766bb
light: drop unneeded light2.cc/hh
2017-02-27 19:10:55 -07:00
Eric Wasylishen
34947ced9c
light: delete RotationAboutLineSegment
2017-02-27 19:06:28 -07:00
Eric Wasylishen
69d5669773
light: delete some dead code
2017-02-27 17:43:56 -07:00
Eric Wasylishen
d513f43540
light: remove more tuple initializer lists
2017-02-27 12:40:03 -07:00
Eric Wasylishen
1c80f8c8d8
light: don't use initializer lists to construct tuples (for gcc)
2017-02-27 12:35:05 -07:00
Eric Wasylishen
ea382c50f2
light: don't use constexpr (for vs2013)
2017-02-27 12:33:03 -07:00
Eric Wasylishen
97a00f0f41
light: avoid recomputing things in CalcPointNormal
2017-02-26 22:58:08 -07:00
Eric Wasylishen
3d69845b71
light: rewrite Face_EdgeIndexSmoothed to use faceToEdgeMap, and also return non-phong shaded faces on the same plane
2017-02-26 00:43:27 -07:00
Eric Wasylishen
410bec9d62
light: wip: make CalcPointNormal also position the point
2017-02-26 00:28:23 -07:00
Eric Wasylishen
6c946038ee
light: move edgeToFaceMap_t stuff to phong.hh/cc
2017-02-25 14:44:59 -07:00
Eric Wasylishen
abf0c13b2d
light: cleaning CalcPointNormal
2017-02-25 13:31:56 -07:00
Eric Wasylishen
22b5684c23
light: save the actual face number of each sample point
2017-02-24 21:05:59 -07:00
Eric Wasylishen
a183be75d7
light: minor tidying of CalcPoints ifdef
2017-02-24 14:11:47 -07:00
Eric Wasylishen
278c5f5b2b
light: LightFace_OccludedDebug: clear occluded flag in this debug mode
2017-02-24 00:24:29 -07:00
Eric Wasylishen
29c7f79a0b
light: misc stuff
2017-02-23 20:53:10 -07:00
Eric Wasylishen
d88581e2da
light: add GLM_ProjectPointOntoPlane
2017-02-22 01:40:58 -07:00
Eric Wasylishen
64e8090326
light: contributing faces: don't contribute if angle btn faces is 90 degrees or more
2017-02-22 01:40:53 -07:00
Eric Wasylishen
cafadddb62
light: expose faceextents_t in header
2017-02-21 22:59:40 -07:00
Eric Wasylishen
64dba663e0
light: faceextents_t: add another conversion
2017-02-21 21:19:15 -07:00
Eric Wasylishen
8ab0ef9687
mathlib: redo bilinear interpolation
2017-02-21 21:19:07 -07:00
Eric Wasylishen
b0662de90f
light: add some stuff to faceextents_t
2017-02-21 21:18:27 -07:00
Eric Wasylishen
8067e0fa45
mathlib: add PointsAlongLine
2017-02-21 21:18:16 -07:00
Eric Wasylishen
b31ae5d243
light: ltface.cc: use glm namespace
2017-02-20 14:39:56 -07:00
Eric Wasylishen
6c9f9f9727
light: fix minlight handling
2017-02-20 14:37:46 -07:00
Eric Wasylishen
c17c33a71c
light: rewrite blur
2017-02-20 14:37:41 -07:00
Eric Wasylishen
7c0e8f9b24
light: fix -extra4 downsampling to use occlusion values
2017-02-20 14:37:36 -07:00
Eric Wasylishen
418d83cbeb
light: skip raytracing occluded points
2017-02-20 14:36:50 -07:00
Eric Wasylishen
f890d739d3
light: improving faceextents_t
2017-02-20 14:32:37 -07:00
Eric Wasylishen
d40c6b9912
mathlib: add bilinear interpolation
2017-02-20 14:32:31 -07:00
Eric Wasylishen
21fa5c5949
Revert "light: rewrite -debugface picking code"
...
This reverts commit 20c92fc676 .
2017-02-16 15:55:13 -07:00
Eric Wasylishen
ea9c456367
Revert "light: Face_Pick: make more lenient"
...
This reverts commit 5292728fe3 .
2017-02-16 15:55:01 -07:00
Eric Wasylishen
d811d33d22
light: add slightly concave poly test
2017-02-16 15:47:45 -07:00
Eric Wasylishen
7294f06ccc
light: disable EdgePlanesOfNonConvexPoly test for now
2017-02-16 15:47:26 -07:00
Eric Wasylishen
6ea56b987a
light: fix mangle_from_vec
2017-02-15 00:14:51 -07:00
Eric Wasylishen
365c143039
light: use mangle_from_vec in CalcPoints_Debug to dump point normal
2017-02-14 23:52:39 -07:00
Eric Wasylishen
77baa2b90b
light: fix mangle_from_vec test epsilon
2017-02-14 23:50:05 -07:00
Eric Wasylishen
5292728fe3
light: Face_Pick: make more lenient
2017-02-14 23:46:10 -07:00
Eric Wasylishen
6f66473836
light: add mangle_from_vec
2017-02-14 23:45:38 -07:00
Eric Wasylishen
e8e5df0f6e
light: SetupContributingFaces_R: handle a type of invalid face that showed up in ad_swampy.bsp
2017-02-14 20:52:27 -07:00
Eric Wasylishen
bef9dd63d2
common: GLM_MakeInwardFacingEdgePlanes: handle non-convex poly
2017-02-14 20:51:36 -07:00
Eric Wasylishen
05e144a5ca
light: MakeEdgeToFaceMap: handle invalid faces with repeating vertices
2017-02-14 20:51:31 -07:00
Eric Wasylishen
20c92fc676
light: rewrite -debugface picking code
2017-02-13 13:33:11 -07:00
Eric Wasylishen
2a17b4bccf
build fix
2017-02-12 11:54:52 -07:00
Eric Wasylishen
3a20d5410b
common: add shrink and clip poly funcs
2017-02-12 00:20:38 -07:00
Eric Wasylishen
7300aacdff
light: Add -debugoccluded
2017-02-11 22:22:26 -07:00
Eric Wasylishen
3c86c3d707
light: fix SetupContributingFaces_R not working on non-phong shaded faces that share a plane
2017-02-11 16:00:10 -07:00
Eric Wasylishen
1957fb1489
light: expose WorldToTexCoord_HighPrecision() in header
2017-02-11 15:45:50 -07:00
Eric Wasylishen
69ebb0c7a9
light: tidy WorldToTexSpace
2017-02-11 15:45:45 -07:00
Eric Wasylishen
5fe4f23371
light: add a debug mode for showing contributing faces
2017-02-11 15:45:30 -07:00
Eric Wasylishen
b54f893942
common: add GLM_InterpolateNormal
2017-02-11 11:02:37 -07:00
Eric Wasylishen
8ed7544063
light: fix up barycentric coords code, add tests
2017-02-11 11:02:28 -07:00
Eric Wasylishen
6f72ab5eda
light: CalcPoints_Debug: log 'occluded' state
2017-02-10 15:54:35 -07:00
Eric Wasylishen
9aae46bd1c
light: adjust Light_PointInSolid to take a model param
2017-02-10 15:54:07 -07:00