Eric Wasylishen
285e0f84af
light: add warning for "_project_texture" missing texture
2016-06-01 20:35:55 -06:00
Eric Wasylishen
ecea00cec2
light: tweaks to usage text
2016-06-01 17:38:30 -06:00
Eric Wasylishen
26fd4b6d28
light: tidy log message
2016-06-01 16:34:35 -06:00
Eric Wasylishen
72e07f82fb
light: print message when visdata in use
2016-06-01 16:04:18 -06:00
Eric Wasylishen
45daf59df7
light: improve usage message. recognize -help flag. show usage when an unknown command given.
2016-06-01 13:55:41 -06:00
Eric Wasylishen
3e8d9b7dfd
light: warn about gate > 1
2016-05-31 18:23:37 -06:00
Eric Wasylishen
826f44d8cf
light: disable "interior verts" spam
2016-05-31 18:19:35 -06:00
Eric Wasylishen
2d0ede48cf
light: FixLightOnFace: only check against model 0, otherwise triggers etc. are wrongly considered to block lights
2016-05-31 18:18:25 -06:00
Eric Wasylishen
5303dae5fc
light: CalcPoints: reduce distance to 0.25
2016-05-30 20:53:52 -06:00
Eric Wasylishen
dba4739444
light: make Light_PointInSolid non-static
2016-05-30 20:53:05 -06:00
Eric Wasylishen
43ab4171d7
light: store bsp in lightsurf for convenience
2016-05-30 20:52:56 -06:00
Eric Wasylishen
280aadfbd8
light: add -debugface option for debugging CalcPoints
2016-05-30 00:15:07 -06:00
Eric Wasylishen
0b8ec4d169
light: CalcPoints: increase distance to pull back from obstructions to from 0.1 to 1.0.
...
fixes room corner seams on calcpointstest.map
2016-05-29 17:16:11 -06:00
Eric Wasylishen
7f182cf107
light: lit water: receive light from either side of the face
2016-05-29 16:01:31 -06:00
Eric Wasylishen
0b5786ebef
light: remove hack for lights on faces, now that we correct them properly
2016-05-28 15:18:58 -06:00
Eric Wasylishen
329d9ee512
light: correct lights directly on faces
2016-05-28 15:18:11 -06:00
Eric Wasylishen
92a9369bbc
light: remove hack for lights directly on faces, was breaking phong shading.
2016-05-28 13:38:12 -06:00
Eric Wasylishen
496fc4d52e
light: phong: reduce epsilon used for barycentric coordinates test. fixes interpolation on testphongtjunc.map
2016-05-27 22:06:17 -06:00
Eric Wasylishen
a63a96e877
light: update usage text
2016-05-27 20:45:44 -06:00
Eric Wasylishen
21a4fd5287
light: allow disabling bounce on command line
2016-05-27 18:47:12 -06:00
Eric Wasylishen
bb19618763
light: add -phong 0 flag to force phong shading to be disabled
2016-05-27 18:18:50 -06:00
Eric Wasylishen
a4445bdd77
light: allow force-disabling dirtmapping at the command line
2016-05-27 17:52:56 -06:00
Eric Wasylishen
af6b4aa375
light: remove useless -no_parse_escape_sequences flag
2016-05-27 15:51:33 -06:00
Eric Wasylishen
b17e345087
light: remove broken -fence feature
2016-05-27 15:50:52 -06:00
Eric Wasylishen
d524b4c3ad
light: fix parsing of command-line argument to -soft and -anglesense, when those are the last params
2016-05-27 15:43:24 -06:00
Eric Wasylishen
30673903ed
light: refactor dirt*SetOnCmdline variables
2016-05-27 15:22:32 -06:00
Eric Wasylishen
35e92abfcf
light: don't cast indirect light in phong/dirtdebug mode
2016-05-27 12:41:30 -06:00
Eric Wasylishen
ca0f0448fe
light: only allow one debug mode at a time
2016-05-27 12:25:51 -06:00
Eric Wasylishen
7687e4a927
light: fix normal interpolation outside the triangle when there are multiple choices of an edge to search across.
2016-05-21 20:29:17 -06:00
Eric Wasylishen
e290d844bf
light: only shadow-casting faces generate bounce lights
2016-05-20 13:34:30 -06:00
Eric Wasylishen
11ea23f6f2
light: don't delete litfile for -onlyents compile
2016-05-20 12:20:39 -06:00
Eric Wasylishen
55df37941c
light: add -bouncecolorscale flag
2016-05-20 12:00:57 -06:00
Eric Wasylishen
4e69914cb2
light: skip dirt on bouncedebug
2016-05-20 02:18:14 -06:00
Eric Wasylishen
45010089f3
light, common: move WindingFromFace to bspfile.c/h
2016-05-19 15:07:31 -06:00
Eric Wasylishen
fff12697e5
light: move DicePatch to polylib.c
2016-05-19 15:03:21 -06:00
Eric Wasylishen
a0f636a69a
light: bounce: refactor to do in a second lighting pass
2016-05-19 02:53:18 -06:00
Eric Wasylishen
8db1f56a20
light: add Lightmap_ClearAll util function
2016-05-19 02:35:17 -06:00
Eric Wasylishen
2c73da0856
light: fix dirtmapping to use interpolated normals
2016-05-15 15:51:51 -06:00
Eric Wasylishen
a5356c161c
light: bounce: scale bounced light by texture color
2016-05-14 20:51:21 -06:00
Eric Wasylishen
199cba7349
light: few optimizations to bounce code
2016-05-13 23:16:36 -06:00
Eric Wasylishen
f967b89cea
light: remove broken hitpoint feature of TraceLine
2016-05-11 16:46:51 -06:00
Eric Wasylishen
d0480049e8
light: move TRACE_HIT_ constants to trace.c
2016-05-11 16:30:26 -06:00
Eric Wasylishen
7bd93cce37
light: move private BSP tracing stuff from light.h to trace.c
2016-05-11 16:23:02 -06:00
Eric Wasylishen
1ed000cbde
light: move DirtTrace to trace.c
2016-05-11 16:16:49 -06:00
Eric Wasylishen
b1691cf10a
light: don't do bounce lighting when dirtdebug/phongdebug are in use
2016-04-30 01:04:53 -06:00
Eric Wasylishen
5e7e409966
light: bounce: remove some dead code
2016-04-30 01:00:57 -06:00
Eric Wasylishen
bd5a15fc82
Revert "light: bounce: handle 0 dist between bounce light and surface point"
...
This reverts commit d3b6adb955 .
2016-04-30 00:59:51 -06:00
Eric Wasylishen
d3b6adb955
light: bounce: handle 0 dist between bounce light and surface point
2016-04-30 00:44:01 -06:00
Eric Wasylishen
f446ba1ddf
light: bounce: use both bounce light normal angle, and receiving surface normal angle to scale bounced light
2016-04-30 00:26:08 -06:00
Eric Wasylishen
a283a623ae
light: bounce: refactoring
2016-04-30 00:24:50 -06:00
Eric Wasylishen
3fb8b7d1e5
light: delete -lightturb and related flags for generating lightmaps for TEX_SPECIAL textures.
...
mankrip's lit water implementation relies on qbsp splitting water, so this code is not needed.
2016-04-29 23:23:28 -06:00
Eric Wasylishen
6ba2d99782
light: bounce: add some debug code
2016-04-29 22:52:33 -06:00
Eric Wasylishen
bd68abad32
light: add LightWorld log header
2016-04-29 22:51:32 -06:00
Eric Wasylishen
99f6451741
light: bounce: don't generate bounce lights for "skip" texture
2016-04-29 22:43:42 -06:00
Eric Wasylishen
ae082fccdb
light: never generate lightmaps for "skip" texture
2016-04-29 22:43:12 -06:00
Eric Wasylishen
b6fb5ecca2
light: fix bouncedebug
2016-04-29 21:21:47 -06:00
Eric Wasylishen
afc43b0c55
light: make some functions non-static so they show up in profiling
2016-04-29 20:33:15 -06:00
Eric Wasylishen
83a5ef303d
light: bounce: refactor light culling for speed
2016-04-29 18:43:57 -06:00
Eric Wasylishen
72c47c1b56
light: bounce: refactor a bit
2016-04-29 18:11:14 -06:00
Eric Wasylishen
6fe504760c
light: don't compute regular lighting if we are doing -bouncedebug
2016-04-29 13:27:57 -06:00
Eric Wasylishen
9271a405d1
light: bounce: fix scaling of sunlight brightness
2016-04-29 13:06:40 -06:00
Eric Wasylishen
ebf04ceb24
light: bounce: multithread MakeBounceLights
2016-04-29 11:40:10 -06:00
Eric Wasylishen
2bca34265c
light: use vis acceleration for bounce lights
2016-04-29 11:27:02 -06:00
Eric Wasylishen
6459e53316
light: bounce: force a "gate" like cutoff for bounce lights
2016-04-28 23:18:49 -06:00
Eric Wasylishen
430c4b39b7
light: bounce: only scale by sending surface normal, not receiving.. seems to look better
2016-04-27 21:16:48 -06:00
Eric Wasylishen
713b92dcb5
light: preliminary bounce implementation
2016-04-27 19:19:29 -06:00
Eric Wasylishen
007696a734
light: fix face normal smoothing condition
2016-04-27 16:44:40 -06:00
Eric Wasylishen
d426c8d9da
light: some setup for bounced lighting
2016-04-26 15:14:22 -06:00
Eric Wasylishen
e77c10d31d
light: build polylib
2016-04-26 15:11:43 -06:00
Eric Wasylishen
f65565ba62
light: don't do light behind plane test for curved surfaces. I broke lighting on pipes by changing this recently
2016-04-26 01:47:46 -06:00
Eric Wasylishen
11d7c4c44c
light: fix build on travis
2016-04-26 01:13:42 -06:00
Eric Wasylishen
a9ea9891bf
light: calculate normals before correcting points, better results in concave areas
2016-04-26 01:10:15 -06:00
Eric Wasylishen
c58528499d
light: when interpolating a normal that lies outside of a face, recursively look it up on adjacent faces
2016-04-26 00:29:50 -06:00
Eric Wasylishen
8c28413a31
light: obj export: only export model 0
2016-04-26 00:22:26 -06:00
Eric Wasylishen
239d9c14f2
light: fix vis acceleration on bmodels
2016-04-24 19:17:27 -06:00
Eric Wasylishen
f3132f342c
light: Mod_LeafPvs: return whether we found a real pvs
2016-04-24 18:24:41 -06:00
Eric Wasylishen
318fc23481
light: implement "_bleed" light key.
...
"_bleed" "1" on a light entity skips the test that a light is on the front side of a face. useful for special effects.
2016-04-23 22:21:59 -06:00
Eric Wasylishen
b6116ff42a
light: don't skip light-behind-plane test for phong shaded faces anymore
2016-04-23 00:26:07 -06:00
Eric Wasylishen
824c1b613c
light: fix memory leak
2016-04-22 21:21:02 -06:00
Eric Wasylishen
5ac18e5c6f
light: index some PVS info at startup
2016-04-22 20:11:59 -06:00
Eric Wasylishen
5000f9d352
light: only do sunlight raytracing in leafs that can see sky
2016-04-22 19:27:17 -06:00
Eric Wasylishen
d309aa02b0
light: refactor CalcPvs to calculate the face pvs in a cleaner way
2016-04-22 19:15:49 -06:00
Eric Wasylishen
3b7dbe42b0
light: fix broken vis optimization
2016-04-22 01:00:10 -06:00
Eric Wasylishen
169c89120a
light: quick hack of 2nd sun. keys are "_sun2" "_sun2_mangle" "_sun2_color"
2016-04-21 01:05:48 -06:00
Eric Wasylishen
0a8965bae0
light: fix lighting with vis data
2016-04-21 00:22:35 -06:00
Eric Wasylishen
338ceae8c8
light: add face to lightsurf struct
2016-04-21 00:13:31 -06:00
Eric Wasylishen
1ea4d52eab
light: add -novis flag
2016-04-20 23:57:04 -06:00
Eric Wasylishen
9cfb8c3fef
light: make DecompressVis more robust
2016-04-20 14:53:33 -07:00
Eric Wasylishen
7ce9272f9d
light: avoid c99 vla's, seems to be not supported on msvc
2016-04-20 01:53:06 -06:00
Eric Wasylishen
e1bad1bbd6
light: rewrite normal interpolation
2016-04-20 01:39:42 -06:00
Eric Wasylishen
03df93851b
light: phong shading: handle some sources of nan's
2016-04-19 19:33:49 -06:00
Eric Wasylishen
9560ba3901
light: speedup: don't calculate AO when using -phongdebug
2016-04-19 18:02:07 -06:00
Eric Wasylishen
8fd3f41b42
light: expose GetLightValue in entities.h
2016-04-19 01:28:33 -06:00
Eric Wasylishen
0c93c5c3d0
light: DirtTrace: add extra argument for hit face
2016-04-19 01:26:21 -06:00
Eric Wasylishen
b087f0f010
build: specify c99
2016-04-18 14:22:33 -06:00
Eric Wasylishen
2a4168f35c
light: add _minlight_exclude bmodel key
2016-04-17 22:51:14 -06:00
Eric Wasylishen
fff8cbffbc
light: use vis data
2016-04-14 20:15:52 -06:00
Eric Wasylishen
32b48a443b
light: track interior verts for normal interpolation (not used currently)
2016-04-14 15:13:01 -06:00
Eric Wasylishen
321eac8aaa
light: make PrintFaceInfo non static
2016-04-12 01:07:37 -06:00
Eric Wasylishen
c6d8aff03b
light: guard against acos returning nan due to fp error in CalcualateVertexNormals
2016-04-11 01:49:02 -06:00
Eric Wasylishen
ed6dfbaf76
light: disable obj exporter
2016-04-11 01:14:54 -06:00
Eric Wasylishen
f2d33137ef
light: PrintFaceInfo: also print the interpolated normals
2016-04-11 00:59:01 -06:00
Eric Wasylishen
c86731ab58
light: make TriangleArea non static
2016-04-11 00:47:21 -06:00
Eric Wasylishen
8228bf979f
light: obj exporter
2016-04-11 00:46:42 -06:00
Eric Wasylishen
37d0d14ccd
light: fix phong shading debug code
2016-04-10 23:07:13 -06:00
Eric Wasylishen
cf8e3fc935
light: augment DirtTrace with the hit plane
2016-04-10 22:30:42 -06:00
Eric Wasylishen
ddbf55ac13
light: skip casting lights if -phongdebug or -dirtdebug are in use, gives a big speedup for those flags
2016-04-10 19:52:01 -06:00
Eric Wasylishen
e395a755ab
light: CalcPoint: correct point before interpolating normal
2016-04-10 19:42:24 -06:00
Eric Wasylishen
4207054709
light: avoid crash if no textures in bsp
2016-04-10 19:34:57 -06:00
Eric Wasylishen
986334a86b
light: unify "_anglescale" worldspawn key and "-anglescale" command line option, previously they were different.
...
Fix "-anglescale" command line option which was broken.
Make sunlight2 use the global anglescale setting.
2016-04-10 18:25:15 -06:00
Eric Wasylishen
9e2d54a9af
light: handle bsp's with no textures
2016-04-10 15:39:49 -07:00
Eric Wasylishen
f2a57d5b71
build: remove remaining embree stuff
2016-04-10 15:49:01 -06:00
Eric Wasylishen
b6c9873289
light: return hit normal for DirtTrace
2016-04-10 15:27:21 -06:00
Eric Wasylishen
0a6708edb0
light: remove embree support
2016-04-10 14:43:37 -06:00
Eric Wasylishen
4e34c48476
build: package embree license
2016-04-09 23:14:43 -06:00
Eric Wasylishen
5b2529ebd4
light: fix lighting on rotators, at least to the extent it was working before
2016-04-08 00:42:15 -06:00
Eric Wasylishen
7215b669f2
light: new CalcPoints implementation
2016-04-07 23:26:46 -06:00
Eric Wasylishen
c135ab6b2b
light: error if bsp->nummodels == 0
2016-04-07 23:26:23 -06:00
Eric Wasylishen
e6f58ece0c
Revert "light: phong shading: also weight by face area. this avoids cubes with rounded edges turning completely into blobs"
...
This reverts commit bbc95a1364 .
2016-04-07 22:20:24 -06:00
Eric Wasylishen
ecfa3c3e12
light: enable -parse_escape_sequences by default
2016-04-07 21:47:26 -06:00
Eric Wasylishen
82ff1dbd06
light: don't save lightmaps for "trigger" texture
2016-04-07 21:39:23 -06:00
Eric Wasylishen
96a8dc8c3d
light: disable "Failed to calculate normal for vertex" warning because it was not really an error and causing spam
...
qbsp T-Juncs generate lots of colinear vertices I think?
2016-04-07 21:16:54 -06:00
Eric Wasylishen
ab9be6bbf2
light: refactoring
2016-04-07 13:16:21 -06:00
Eric Wasylishen
0733499da5
light: fix for black corners on dirttest.map (test map from lunaran)
2016-04-06 22:38:09 -06:00
Eric Wasylishen
6fcf04a298
light: revert to older CalcPoints (push off hit normal) to fix artifacts in testlightonface.map
2016-04-06 19:15:19 -06:00
Eric Wasylishen
c9aad9d2ce
light: Refactor CalcPoints, store whether a point is occluded
2016-04-06 18:29:24 -06:00
Eric Wasylishen
a6a89db530
light: refactor tracelist to be a list of modelinfo_t instead of dmodel_t
2016-04-05 23:25:36 -06:00
Eric Wasylishen
bbc95a1364
light: phong shading: also weight by face area. this avoids cubes with rounded edges turning completely into blobs
2016-04-05 15:00:12 -06:00
Eric Wasylishen
a407b971bc
light: rework LightFace_Entity to fully fix testlightonface.map
2016-04-05 12:52:44 -06:00
Eric Wasylishen
aed29da060
light: tweak embree settings to fix "fireflies"
2016-04-05 12:27:51 -06:00
Eric Wasylishen
163b599900
light: tweak angle test for testlightonface.map.
2016-04-05 00:58:05 -06:00
Eric Wasylishen
47e7a981f6
light: get rid of unneeded unordered_set
2016-04-05 00:13:29 -06:00
Eric Wasylishen
f315366f43
light: hack to fix lights exactly on faces
2016-04-04 23:58:12 -06:00
Eric Wasylishen
33ee7e35f7
light: delete .lit file before starting
2016-04-03 18:25:30 -06:00
Eric Wasylishen
d53e67bf8a
light: copy embree DLL's
2016-03-30 15:26:36 -07:00
Eric Wasylishen
e11e9d5c1f
light: embree support
2016-03-30 14:58:21 -06:00
Eric Wasylishen
34858ed243
light: fix sunlight + phong shading
2016-03-05 23:56:28 -07:00
Eric Wasylishen
d2f1eb2b2b
light: support _phong and _phong_angle on bmodels for compatibility with other qbsp's.
2016-03-05 22:51:17 -07:00
Eric Wasylishen
1a48e5a24a
light: fix issue with CalcPoints trace hitting a corner, spuriously setting tr.hitback, and returning the wrong hitpoint
2016-03-05 00:57:47 -07:00
Eric Wasylishen
41972a376a
qbsp, light: Strip texinfo flags other than TEX_SPECIAL.
...
Write extended ones to a "mapname.texinfo" file.
Support "_dirt" and "_minlight" flags on func_detail/group.
2016-03-05 00:26:54 -07:00
Eric Wasylishen
0b4c044473
light: fix dirtmapping traces
2016-03-04 20:40:14 -07:00
Eric Wasylishen
72d7ce4231
light: handle degenerate triangles when smoothing normals
2016-03-03 12:38:03 -07:00
Eric Wasylishen
d66857b5a0
light: try fixing cmake msvc build
2016-03-03 11:14:14 -07:00
Eric Wasylishen
fec88c3186
light: fix build on MSVC
2016-03-02 19:21:30 -08:00
Eric Wasylishen
492d94c1fe
light: new phong shading keys, "_phong_angle" and "_phong".
...
"_phong" "1" is a shortcut for "_phong_angle" "89".
"_phong_angle" sets the max angle in degrees between faces that will get smoothed.
2016-03-02 20:00:05 -07:00
Eric Wasylishen
f641e93ca2
light: convert light.c to light.cc
2016-03-02 17:07:02 -07:00
Eric Wasylishen
3056971ae6
light: fix issue with lights within 1 unit of a face not casting light on that face
...
fixes https://github.com/ericwa/tyrutils-ericw/issues/10
2016-02-25 23:02:43 -07:00
Eric Wasylishen
48830f2b1a
light: revert CalcPoints changes as it was causing light leaking in jam2_mfx
...
(points on the top edge of a face were crossing a wall, but ended up in the open so they were accepted as OK)
2016-02-25 15:34:07 -07:00
Eric Wasylishen
ceec7b16c7
light: optimize TraceFaces
2016-02-22 22:11:12 -07:00
Eric Wasylishen
4ed6db3020
light: add new TraceFaces API which gives accurate info on the first hit face of a trace.
...
Need to use this for: dirtmapping, fence textures, GI
2016-02-21 22:31:06 -07:00
Eric Wasylishen
4e74e530c0
light: dynamically allocate memory for lighting each face
2016-02-20 14:43:38 -07:00
Eric Wasylishen
22dd1726de
light: move lightsurf_t etc. to header
2016-02-20 14:41:58 -07:00
Eric Wasylishen
942c87a98b
light: fix phong shading for sunlight
2016-02-16 19:16:42 -07:00
Eric Wasylishen
ae04899ce5
light: make CalcPointNormal more robust; don't use micro-triangles (<1 unit area) for interpolating normals
2016-02-16 19:09:43 -07:00
Eric Wasylishen
465cb2a555
light: avoid NaN's due to rounding error when calculating angles for weighting normals
2016-02-15 20:28:05 -07:00
Eric Wasylishen
1fd1637de1
light: add -phongdebug option
2016-02-15 20:27:03 -07:00
Eric Wasylishen
fdc1f25276
light: add phong shading debug function
2016-02-15 17:59:05 -07:00
Eric Wasylishen
a515a13107
Lightmap_ForStyle: change back to taking a const lightsurf_t*
2016-02-15 16:20:29 -07:00
Eric Wasylishen
537937f0eb
Lightmap_Soften: remove stack allocation
2016-02-15 16:20:29 -07:00
Eric Wasylishen
e896f3126b
entities.c: make SetWorldKeyValue / WorldKeyValue safer
2016-02-15 16:20:29 -07:00
Eric Wasylishen
b0777c2075
suppress compile warnings
2016-02-15 16:20:29 -07:00
Eric Wasylishen
b2687481d6
WriteLightmaps: revert to how I was getting the sample points
2016-02-15 16:20:29 -07:00
Eric Wasylishen
7128a8e956
code formatting, normalize most whitespace to 4 spaces
2016-02-15 16:20:29 -07:00
Eric Wasylishen
1f05b7976a
fix wrong FindTexinfo call
...
fix Lightmap_ForStyle call
change M_PI to Q_PI
switch to Q_strncasecmp
2016-02-15 16:18:51 -07:00
Eric Wasylishen
1630b8756e
tyrutils-ericw-spike rebased on to 998c9d3acb
2016-02-15 16:16:37 -07:00
Eric Wasylishen
9496991e60
LightFace_Min: allow delay 4 lights to use lightstyles
2016-02-14 20:45:56 -07:00
Eric Wasylishen
651e7ca827
CalcPoints: if NearWall() fails, first try fudging by 0.25 units in each direction
2016-02-11 23:30:21 -07:00
Eric Wasylishen
a439f891a1
CalcPoints: Skip the trace if a PointContents says the point is already unobstructed.
...
Handles beveled walkways in telefragged.bsp which touch a wall along one edge, but don't split the wall.
Previously, the walkways were blocking most of the traces for the wall, messing up all of the wall sample points.
2016-02-11 22:38:23 -07:00
Eric Wasylishen
7a5c7bbf6b
light: cleanup _sunlight3 code, support _sunlight3 without _sunlight2 properly
2015-12-10 14:58:49 -07:00
Eric Wasylishen
99d5a4d4f9
build: setup CPack to package binaries in a zip file
2015-12-09 16:23:36 -08:00
Eric Wasylishen
420125cc67
replace tabs with spaces.
...
for FILE in $(find . -name "*.h" -or -name "*.c"); do cat $FILE | expand > temp; cat temp > $FILE; done
2015-12-07 15:08:48 -07:00
Eric Wasylishen
c149ed2bf6
build: VS2015 support
2015-12-07 14:23:13 -07:00
Eric Wasylishen
fe65004f17
light: test out _sunlight3
2015-12-05 21:40:15 -07:00
Eric Wasylishen
e6fcf3d6da
light: add -surflight_dump option to export generated surface lights to a map file
2015-12-05 20:27:51 -07:00
Eric Wasylishen
81cefad71a
light: handle surface lights on rotators
2015-12-05 20:07:20 -07:00
Eric Wasylishen
50b556993a
light: experimental -parse_escape_sequences option to toggle \b escape sequence (toggles bold text)
2015-11-26 18:30:10 -07:00
Eric Wasylishen
f154a00e3a
light: fix "_mincolor" bmodel key which was only accepting 0-255
...
now accepts 0-1 or 0-255.
2015-11-20 14:27:25 -08:00
Eric Wasylishen
b3472d89e7
light: fix antilights which were broken with the light culling change
2015-11-07 11:58:07 -07:00
Eric Wasylishen
8e18933f5d
light: silence "no model has face" warning
2015-10-25 23:41:19 -06:00
Eric Wasylishen
d0fb0bd410
light: remove entity->fadedist, it was error-prone, and instead just check light level. it's only very slightly slower.
2015-10-25 23:18:17 -06:00
Eric Wasylishen
7f1beca6b4
light: add "_surface_spotlight" key for making surface lights into spotlights based on the surface normal
2015-10-25 22:35:29 -06:00
Eric Wasylishen
1e9a0ac2b3
light: add "-sunsamples" flag to control number of samples for _sunlight_penumbra and _sunlight2
2015-10-23 19:54:41 -06:00
Eric Wasylishen
69fab3fc96
light: clean up SetupSkyDome
2015-10-23 18:31:39 -06:00
Eric Wasylishen
c0d61d4147
light: cull light bounding sphere against surface bounding sphere before checking each surface point. gives a modest speedup.
2015-10-23 15:10:35 -06:00
Eric Wasylishen
244243b121
light: fix "-gate" (was calculating too-large bounding spheres for delay 2 lights.)
2015-10-23 01:36:16 -06:00
Eric Wasylishen
d4d63efd87
light/trace.c: Adjust the trace algorithm to match that in q3map.
...
Fixes some weird artifacts I noticed when experimenting with lava surface lights in jam6_ericwtronyn.map
2015-09-25 00:13:25 -06:00
Eric Wasylishen
532704f54e
light: fix duplicate surface lights being generated
2015-09-14 22:16:53 -06:00
Eric Wasylishen
1cf7af0c17
light: remove unused FaceArea function
2015-09-12 19:07:58 -06:00
Eric Wasylishen
8e29319309
light: avoid doing the trace twice when there is no obstruction
2015-09-12 18:53:56 -06:00
Eric Wasylishen
46cbcfd12b
light: add -dirtangle flag to control dirtmapping cone angle
2015-08-28 20:22:54 -06:00
Eric Wasylishen
3c918db489
light: add -onlyents switch
2015-08-20 12:14:13 -06:00
Eric Wasylishen
b345dccfe7
light: disable deviance if samples <= 1 or deviance <= 0.
2015-08-14 14:28:53 -06:00
Eric Wasylishen
79d1871e56
light: document -surflight_subdivide key
2015-08-10 10:04:25 -06:00
Eric Wasylishen
72a5885437
light: fix crash in "Bad texture axes on face:" error. Print more detailed face info.
2015-08-09 12:27:55 -06:00
Eric Wasylishen
18dce775dd
light: fix lighting of rotatating entities (hiprotate). the model offset was not being used correctly.
...
todo: the trace code needs to take the model offset into account too, so shadow casting and self-shadowing are broken for hiprotate.
2015-08-08 21:37:58 -06:00
Eric Wasylishen
b68ba8c983
light: average the color to get the value to write to the .bsp lightmap.
...
This avoids issues with some engines that require the lit and internal lightmap to have the same intensity. (MarkV, some QW engines).
Previously, if you used low-value colors (e.g. "0.2 0 0"), the .bsp lightmap and .lit file could have vastly different brightness.
2015-08-05 13:47:04 -06:00
Eric Wasylishen
bc0e1778dc
light: allow negative surface offsets for niche use
2015-08-05 12:10:17 -06:00
Eric Wasylishen
3005504fe5
vis, light: set low process priority on windows
2015-08-05 12:10:17 -06:00
Eric Wasylishen
5302a3b539
light: add -surflight_subdivide command line flag to control subdivision size
2015-08-05 12:10:14 -06:00
Eric Wasylishen
6004e1b94c
light: log total number of lights including generated ones
2015-08-05 12:08:55 -06:00
Eric Wasylishen
f24b1a1101
light: update usage text
2015-07-13 15:07:46 -06:00
Eric Wasylishen
a56dad56c2
light: add logprint for "_anglescale"/"_anglesense" worldspawn key (to control angle sensitivity of sunlight)
2015-07-13 14:33:21 -06:00
Eric Wasylishen
e9f240b623
light: .lux file support from Spike
2015-07-09 16:34:12 -06:00
Eric Wasylishen
a219d3e0a0
light: WriteEntitiesToString: add explanation from Spike
2015-07-09 16:34:06 -06:00
Eric Wasylishen
6ca1c6957a
light: fence texture tracing: fix handling of negative texture coords
2015-07-09 16:33:44 -06:00
Eric Wasylishen
e242a9c910
light: Add gamma control with -gamma flag and "_gamma" key
2015-07-09 16:33:07 -06:00
Eric Wasylishen
26a03ace45
light: optimization: avoid iterating over non-light entities in light thread.
2015-06-02 00:51:37 -06:00
Eric Wasylishen
4105bc505f
light: optimization: avoid unnecessary memsets, from spike
2015-06-01 23:14:19 -06:00
Eric Wasylishen
e0d3f872ff
light: rewrite part of WriteLightmaps for more readable code
2015-05-31 12:27:40 -06:00
Eric Wasylishen
c39971bb94
light: rename -dirty flag to -dirt for consistency
2015-05-19 12:11:17 -06:00
Eric Wasylishen
ab78c07320
light: make fence texture tracing opt-in
2015-05-16 23:33:39 -06:00
Eric Wasylishen
1996bce56d
light: support switchable lights with any light* classname, not just "light"
2015-05-15 09:54:19 -06:00
Eric Wasylishen
8bde00a732
light: ensure "_surface" value is case-insensitive
2015-05-14 17:42:26 -06:00
Eric Wasylishen
3a109ac84d
build: split up cmake build system into subprojects.
...
-DDOUBLEVEC_T now correctly used for qbsp only.
2015-05-05 12:34:39 -06:00
Eric Wasylishen
86d3aa990d
light: remove "Jittering" debug message
2015-05-04 14:13:18 -06:00
Eric Wasylishen
0a6d3f4167
light: fix hang when using _deviance, make _samples default to 16 when _deviance is set.
2015-05-01 02:17:29 -06:00
Eric Wasylishen
d2840f4cba
light: fix for always generating a .lit file when surface lights are used
2015-04-30 14:54:23 -06:00
Eric Wasylishen
54e7c2ab8e
light: fence texture tracing
2015-04-27 00:26:42 -06:00
Eric Wasylishen
a33c4b0136
light: surface light support via "_surface" "texturename" light key
2015-04-26 02:24:57 -06:00
Eric Wasylishen
59bb786880
light: remove unused bsp_origin constant
2015-04-25 21:18:28 -06:00
Eric Wasylishen
aa5dfa8b19
light: respect "_dirt" "-1" bmodel key in -dirtdebug mode
2015-04-25 20:46:05 -06:00
Eric Wasylishen
6fe67cd2fb
light: allow setting _dist and _range in worldspawn
2015-04-25 20:46:00 -06:00
Eric Wasylishen
ef471ee44f
Support "_dirt" "-1" on bmodels to disable dirtmapping
2015-04-25 20:45:54 -06:00
Eric Wasylishen
be8c42460c
_sunlight2 (sky light, light dome) support from q3map2
...
_sunlight penumbra (deviance) from q3map2
light penumbra from q3map2
2015-04-25 20:45:44 -06:00
Eric Wasylishen
741d341332
Dirtmapping (ambient occlusion) from q3map2
2015-04-25 20:45:32 -06:00
Eric Wasylishen
2d5ea4fe73
light: accept _sunlight_mangle as an alternative for _sun_mangle
2015-03-27 00:35:28 -06:00
Eric Wasylishen
2cd885729a
light: MatchTargets: disable copying 'style' key/value to the targeting entity. Don't see any reason why that would be done.
2015-03-27 00:33:32 -06:00
Eric Wasylishen
c51326e8b0
trace.c: Undo part of cc36d8e that flipped the signs of ON_EPSILON for one of the checks in the TraceLine.
...
This fixes cracks in sunlight shadows spotted by Lunaran, and greatly improves the AO quality
2015-02-05 11:36:59 -07:00
Eric Wasylishen
11678eaa74
trace.c: fix bug in determining hitpoint->point
2015-02-05 11:35:15 -07:00
Eric Wasylishen
24c6b9524a
_color support: support values in the range 0-1 by automatically scaling them to 0-255
2015-02-05 11:33:21 -07:00
Eric Wasylishen
4df394f9fe
light: Increase precision of lightmap extents calculations
...
This bug is a counterpart to this bug in quakespasm:
https://sourceforge.net/p/quakespasm/patches/15/
If the precision of the calculation in WorldToTexCoord done by ‘light’
is significantly different than the precision of the same calculation
in the engine, you can get corrupted lightmaps. The problem affects
light when it’s built as something other than vanilla 32-bit
x86. (e.g. x86_64 on a mac).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-06-30 12:58:30 +09:30
Kevin Shanahan
d68748d1d8
light: fix minlight clamping for coloured lights
...
Colours need to be scaled correctly by the light intensity.
Thanks to Mechtech for reporting this issue.
Reported-by: Paul R <automan1001@yahoo.com>
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-15 18:56:44 +10:30
Kevin Shanahan
4b1e3aec1a
light, vis, bsputil, bspinfo: Add BSP2 support
...
Add BSP2 support to the remaining utils. Since these share the common
bspfile.[ch] files, it was more effort than is justifiable to break this
into multiple staged patches - so you just get this disgustingly big
commit instead. Here is basically what was done:
* Modify the bspdata_t struct with a union of the two bsp formats
* Modify the tools to use bsp2_t for all internal processing
* Split out the byte swapping routines for the different bsp data types
* Add simple (although verbose) code to convert bsp29 <-> bsp2
Hundreds of lines added to bspfile.c, but mostly trivial stuff. The tools
internally had little modification except to substitute the bsp2 type
names.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-25 15:18:50 +09:30
Kevin Shanahan
e970bea8c7
common: save the bsp version in the bspdata struct
...
Adjust the Load and Write API functions as appropriate.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-22 13:25:47 +09:30
Kevin Shanahan
89abf25218
common: convert all tools to instanced bsp data
...
Transition all tools to access the BSP data via the bspdata struct instead
of the shared globals. Remove the compatibility code from bspfile which
copied the global values to/from the instanced bspdata struct.
Mostly the changes just involved passing along the bspdata struct to the
various functions which needed to reference the data. TraceLine and
MakeTNodes in light got some extra changes so that we cache the node
dplane pointer and remove the need to pass the bspdata struct to every
trace operation!
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-22 11:01:08 +09:30
Kevin Shanahan
d0617760f5
common: add the ability to pass an arg to spawned threads
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 19:27:40 +09:30
Kevin Shanahan
6ddb109dde
light: convert WriteLitFile to use the bspdata struct
...
Avoids reference to global LightDataSize. Need to move writing the lit
file above the call to WriteBSPFile, since that will do the byte swapping.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 15:23:04 +09:30
Kevin Shanahan
51419621ec
common: add the bsp2/bsp29 data types
...
Rename the default bsp29 data types and add the bsp2 data types to
the common bspfile.h. Propogate the bsp29 names into the other tools as
simple renames for now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 13:25:16 +09:30
Kevin Shanahan
1612d60a5f
light: keep debug helper for dumping face info
...
Used this to help with debugging, but may as well keep it around for
future debugging rather than implement it all over again next time.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:52:19 +09:30
Kevin Shanahan
23591535b4
light: show face area for bad texture axis error
...
Often these errors are caused by super small faces on brushes, show the
area of the offending face to make it more obvious if that is the case.
Kind of lost in the diff, but moved the TriArea, etc. functions up and
added FaceArea() and then augmented the error message.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-03 16:47:15 +09:30
Kevin Shanahan
c94414f288
light: allocate one extra lightmap to simplify handling overflow
...
Rather than allocating the overflow map within each function and
having to handle it as a special case in each, we always allocate the
extra lightmap in the base LightFace function and use common helper
functions to handle allocation and warning on overflow.
We lose a tiny bit of debugging info here about the specific light
that made the surface overflow MAXLIGHTSTYLES, but that never gave us
all the sources, only the last one encountered.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-10 13:47:58 +09:30
Kevin Shanahan
35bf3f4232
light: factor out adding and clamping of light samples
...
Simple functions, but just helps to tidy up the bodies of the other
LightFace functions and makes sure we're handling light & colours
consistently across each (we weren't in the case of coloured local
minlights, previously).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-08 15:42:50 +09:30
Kevin Shanahan
e09c1f8e2a
light: rename FixMinLight -> LightFace_Min
...
Move away from the "Fix" naming ~ it's not a fix, we're applying the
minimum lighting values as requested.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-08 13:30:38 +09:30
Kevin Shanahan
23f8f1a35e
light: unify allocation of new face light styles
...
Factor out the allocation of new light styles - slightly increases the
code size, but we get two benefits; first is that we now don't
allocate the style 0 lightmap unless we actually need it; second, we
get warnings if sunlight or minlight is unable to be applied due to
lack of a style 0 lightmap.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-04 14:29:47 +09:30
Kevin Shanahan
f498ed5ec3
light: pass the sun direction vector into LightFace_Sky
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-03 16:32:03 +09:30
Kevin Shanahan
ca78568cae
light: rename SkyLightFace -> LightFace_Sky
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-03 14:55:56 +09:30
Kevin Shanahan
7abfeb35da
light: rename SingleLightFace -> LightFace_Entity
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-03 14:54:21 +09:30
Kevin Shanahan
12e24085c1
light: always calculate color values for light samples
...
Simplify the code by removing the if (colored) conditionals from the
code path. CPU cost is insignificant compared to tracing the rays.
As before, only write the lit file if colored lights are detected or
the use explicity requests it.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-07-03 13:03:27 +09:30
Kevin Shanahan
c3bf54e494
common: add printf attribute to Error() declaration in cmdlib.h
...
Fix a number of warnings now generated as a result.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-23 14:39:44 +09:30
Kevin Shanahan
5082e3ffaa
light: reduce "no model has face" to a warning
...
Since the newskip.exe tool leaves the faces in the bsp but removes
references, we will just skip over lighting such faces.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 13:11:22 +09:30