Eric Wasylishen
6bd8864ff4
light: refactor LightFace_Sky
2016-11-03 01:44:17 -06:00
Eric Wasylishen
ee89d41b6d
light: light passing through glass lights up the back side, scaled by (1-alpha)
2016-11-02 21:35:11 -06:00
Eric Wasylishen
e5901dfee6
light: ensure modelinfo settings override .texinfo file if they have been set, for _dirt and _minlight
2016-11-02 18:10:59 -06:00
Eric Wasylishen
731e46d005
light: fix extended texinfo array type
2016-11-02 17:29:18 -06:00
Eric Wasylishen
fbeba25bd1
light: read _mincolor from .texinfo file
2016-11-02 17:23:25 -06:00
Eric Wasylishen
a6468984bf
all: finish c++ification
2016-10-17 19:52:17 -06:00
Eric Wasylishen
fab8d87416
light: ensure sky textures are detected case-insensitive
2016-10-17 17:47:08 -06:00
Eric Wasylishen
d9bb0be32e
light: move Face_Contents to common
2016-10-17 17:37:28 -06:00
Eric Wasylishen
299e68e7e5
build: support Ubuntu 14.04
2016-09-23 15:13:58 -06:00
Eric Wasylishen
ec37b52807
light: disable "denormals are zero", causing build issues on gcc4.8/linux
2016-09-23 00:43:28 -06:00
Eric Wasylishen
048e19fbf2
build: make building on linux with embree easier
2016-09-23 00:06:21 -06:00
Eric Wasylishen
57834c438b
light: add "_lightignore" model key
2016-09-20 16:15:12 -06:00
Eric Wasylishen
c615839abb
light: don't save lightmaps where the maximum brightness is < 1
2016-09-20 00:17:12 -06:00
Eric Wasylishen
46a56df19f
light: add -bouncelightsdebug switch to render bounce lights
2016-09-20 00:04:02 -06:00
Eric Wasylishen
1d7fea8486
light: simplify debug mode condition
2016-09-19 22:14:40 -06:00
Eric Wasylishen
9500fd8ebb
light: apply minlight after adding bounce lights
2016-09-19 19:47:53 -06:00
Eric Wasylishen
722f753d8d
light: remove some unused vis-testing stuff
2016-09-19 19:21:04 -06:00
Eric Wasylishen
f7091c27f8
light: add some tests for the EntDict_Check* functions
2016-09-19 19:16:45 -06:00
Eric Wasylishen
26dcb4f10f
light: refactor warnings code. warn if an entity targets itself
2016-09-19 18:28:16 -06:00
Eric Wasylishen
12f55292f7
light: CheckTargetsMatched: for "targetname with no targetter" warning, allow any key to be the targetter
2016-09-19 16:08:08 -06:00
Eric Wasylishen
05251d9e1a
light: fix "options summary" log header
2016-09-19 14:46:16 -06:00
Eric Wasylishen
4ec0a62ce8
light: CheckEmptyValues: print entity classname and origin
2016-09-19 14:42:04 -06:00
Eric Wasylishen
d4395bc660
light: improved CheckTargets
2016-09-19 14:34:36 -06:00
Eric Wasylishen
63d2bcf91c
light: move empty values check to its own function
2016-09-19 14:28:50 -06:00
Eric Wasylishen
fdb5394cc5
light: remove hack requiring a light to add 1 unit of light to a lightmap, as it can cause artifacts, and it's redundant with -gate
2016-09-19 12:34:32 -06:00
Eric Wasylishen
28bec79830
light: add more fuzz (25%) to the bbox size for vis approximation.
...
Not sure if this is necessary, but fixes a tricky case in lightstest1.map (infinite reach light casting a sharp shadow across a large room)
2016-09-19 12:27:02 -06:00
Eric Wasylishen
1045505670
light: avoid bouncing negative lights
2016-09-19 12:15:26 -06:00
Eric Wasylishen
b4e30032a3
light: MakeBounceLightsThread: avoid zero-area or small patches, which were getting NaN colors
2016-09-19 12:11:41 -06:00
Eric Wasylishen
8dab875adc
light: CheckTargets: also check for unmatched targetnames
2016-09-18 17:30:21 -06:00
Eric Wasylishen
18f0b89ee6
light: build fix for MSVC
2016-09-18 15:50:31 -06:00
Eric Wasylishen
0786b513a2
light: fix build of 073ede98c7
2016-09-18 15:46:42 -06:00
Eric Wasylishen
857b4402ad
light: change assertions to Q_assert (so they are all enabled in release builds)
2016-09-18 15:41:56 -06:00
Eric Wasylishen
073ede98c7
light: when there are too many lightstyles on a face, sort them by descending average brightness and take the top 4
...
previous behaviour was random, which made needlessly ugly artifacts.
2016-09-18 15:12:57 -06:00
Eric Wasylishen
a2dc35a91f
light: fix debug logging
2016-09-18 03:03:29 -06:00
Eric Wasylishen
8bff999601
light: move lightmaps array to lightsurf_t
2016-09-18 02:22:26 -06:00
Eric Wasylishen
700e8d089f
light: add -verbose option
2016-09-17 23:49:41 -06:00
Eric Wasylishen
81c7b39fa7
light: tidy LightStyleForTargetname
2016-09-17 17:49:01 -06:00
Eric Wasylishen
f5d347a18d
light: always assign "style" if targetname is set on a light
2016-09-17 17:48:11 -06:00
Eric Wasylishen
1a74834221
light: never receive dirtmapping on lit liquids
2016-09-16 11:37:04 -06:00
Eric Wasylishen
c7d210dc3a
light: special case support for skip-textured bmodels in the embree backend.
...
It only supports bmodels where all the faces are skipped
2016-09-10 18:32:22 -06:00
Eric Wasylishen
d7ba0330a6
light: restore "unmatched target" warning
2016-09-10 10:10:06 -06:00
Eric Wasylishen
bcddaf10dd
docs: update
2016-09-09 13:30:36 -06:00
Eric Wasylishen
687b1b20f6
light: bsp backend: fix and simplify Face_Contents to only look at texture names. it was broken when -splitspecial was used.
2016-09-09 13:04:53 -06:00
Eric Wasylishen
2bab853ca4
light: don't add styled lights to bounce calculation
2016-09-08 23:53:15 -06:00
Eric Wasylishen
eaec325ab4
light: bounce: area-weight the patches when averaging them to get the light to emit for a face
2016-09-08 21:39:37 -06:00
Eric Wasylishen
ce812f5570
light: apply AO when calculating how much light a surface reflects (wrong? but matches 0.15.5)
2016-09-08 21:07:29 -06:00
Eric Wasylishen
08e1c1ce69
light: apply dirt to regular lights
2016-09-08 17:24:28 -06:00
Eric Wasylishen
18797f81c0
light: fix for -dirt not implying -minlight_dirt, -sunlight_dirt, -sunlight2_dirt
2016-09-08 15:21:18 -06:00
Eric Wasylishen
272995765b
light: warn about empty key/values
2016-09-07 20:32:59 -06:00
Eric Wasylishen
66184a3849
light: CalcualateVertexNormals: skip degenerate faces
2016-09-07 15:12:19 -06:00
Eric Wasylishen
9111d8df9f
light: log embree version
2016-09-02 14:59:43 -06:00
Eric Wasylishen
e06556edfd
build: run tests on CI servers
2016-08-15 23:28:36 -06:00
Eric Wasylishen
5e9b62dc8b
light: add "testlight" target
2016-08-15 21:18:14 -06:00
Eric Wasylishen
d7948c4bdd
light: move settings system to its own files
2016-08-12 19:15:25 -06:00
Eric Wasylishen
a0f3881698
light: refactor global settings into a class
2016-08-12 18:49:32 -06:00
Eric Wasylishen
e2f407a0e7
light: refactor GetDirectLighting
2016-08-12 12:00:33 -06:00
Eric Wasylishen
cc0d1f6b76
light: restore normalmap contribution in LightFace_Entity
2016-08-12 11:55:35 -06:00
Eric Wasylishen
ed43b29489
light: store normal contribution in ray stream
2016-08-12 11:51:27 -06:00
Eric Wasylishen
8ca5fafffc
light: some refactoring
2016-08-11 15:44:43 -06:00
Eric Wasylishen
4f58f61aad
light: GetLightDist: use entity->getFormula()
2016-08-11 14:37:26 -06:00
Eric Wasylishen
b849a79c3f
light: move GetDir to mathlib
2016-08-11 14:16:23 -06:00
Eric Wasylishen
9f607b858b
light: Add GetLightDist function
2016-08-10 12:22:41 -06:00
Eric Wasylishen
28b034a172
light: drop visdata support, no longer needed
2016-08-10 00:49:41 -06:00
Eric Wasylishen
3d19354514
light: EstimateVisibleBoundsAtPoint: increase to 1024 samples to fix lightstest1.map.
...
remove randomness. only expand AABB by 1% down from 10%, since using 1024 samples now, bbox will be closer to the actual one.
2016-08-09 23:31:48 -06:00
Eric Wasylishen
f3a1700d13
light: scale and clamp before smoothing, downscaling. fixes https://github.com/ericwa/tyrutils-ericw/issues/15
2016-08-09 22:19:11 -06:00
Eric Wasylishen
125f35e35f
light: coding style fixes
2016-08-09 21:47:20 -06:00
Eric Wasylishen
f857ab5820
light: remove redundant message
2016-08-09 21:19:24 -06:00
Eric Wasylishen
59f1ef9a1e
light: bounce: only save style 0 lightmap if some traces hit
2016-08-09 20:55:28 -06:00
Eric Wasylishen
af2f68c036
light: culling for local minlights
2016-08-09 19:37:52 -06:00
Eric Wasylishen
df8669a5fe
light: record stats for local minlight ents
2016-08-09 19:37:40 -06:00
Eric Wasylishen
677875a63e
light: cull lights based on estimated visible AABB of each light
2016-08-09 18:16:32 -06:00
Eric Wasylishen
1d4de5c17d
light: add more performance stats
2016-08-09 17:11:08 -06:00
Eric Wasylishen
9340ce223a
build: clean up request for C++11. require cmake 3.1 (which introduced CMAKE_CXX_STANDARD)
2016-08-09 16:00:09 -06:00
Eric Wasylishen
7d5067bddd
light: Add stats
2016-08-09 01:15:26 -06:00
Eric Wasylishen
3d5ab0db68
light: use LightSample_Brightness
2016-08-09 00:41:49 -06:00
Eric Wasylishen
3f573bd276
light: fix sign error in sunlight2 positioning
2016-08-08 20:36:31 -06:00
Eric Wasylishen
68e1736ad1
light: move more stuff to bsputils.cc
2016-08-07 23:07:20 -06:00
Eric Wasylishen
486606eb88
light: rename GetSurfaceVertex to Face_VertexAtIndex
2016-08-07 22:57:45 -06:00
Eric Wasylishen
1a0fb22e40
light: move some helper functions to common/bsputils.{h,cc}
2016-08-07 22:55:44 -06:00
Eric Wasylishen
9004bed24e
light: don't add 0 brightness suns
2016-08-07 16:33:13 -06:00
Eric Wasylishen
5e6f2220e8
light: quick hack fix of spotlights in bounce mode
2016-08-06 17:31:39 -06:00
Eric Wasylishen
939778bd23
build: add snprintf wrapper from QuakeSpasm (vs2013 compat)
2016-08-06 15:47:40 -07:00
Eric Wasylishen
a807204fe6
build: vs2013 compat changes
2016-08-06 15:37:00 -07:00
Eric Wasylishen
292d35879b
build: restore mingw support
2016-08-05 04:07:01 -04:00
Eric Wasylishen
7029ed5713
light: clean headers
2016-08-04 16:32:04 -06:00
Eric Wasylishen
fcc54c547f
light: change CalcPoints to only trace the model the face belongs to
2016-08-04 12:24:07 -06:00
Eric Wasylishen
2a3b87bf1f
light: rework bounce lighting for less memory use
2016-08-03 14:00:58 -06:00
Eric Wasylishen
9f0f2cdf83
light: add debug dump for lights
2016-08-01 21:38:14 -06:00
Eric Wasylishen
607706a684
light: fix dangling pointers when a light_t is copied
2016-08-01 21:38:03 -06:00
Eric Wasylishen
b4e0a7a5fa
light: GetLightValue: remove extra param
2016-07-31 18:53:41 -06:00
Eric Wasylishen
fee5669dbf
light: refactor checking if we need to write a litfile
2016-07-31 18:06:44 -06:00
Eric Wasylishen
cbd7290e3c
light: log when writing litfile
2016-07-31 17:54:00 -06:00
Eric Wasylishen
307d0efc28
light: minor cleanups
2016-07-31 17:00:35 -06:00
Eric Wasylishen
03f703d931
light: remove redundant light value from lightsample_t
2016-07-31 11:47:27 -06:00
Eric Wasylishen
707ae70fe1
light: don't use c99 designated initializers (msvc compat)
2016-07-30 00:47:43 -06:00
Eric Wasylishen
882348ac0a
light: use embree ray stream api
2016-07-30 00:40:45 -06:00
Eric Wasylishen
225a155efd
light: fix unwanted phong on everything
2016-07-29 19:48:28 -06:00
Eric Wasylishen
d7bb75ae97
light: modelinfo: change to storing pointers in std::vector rather than modelinfo_t
2016-07-29 16:01:34 -06:00
Eric Wasylishen
6bb842cd47
light: refactor tracelist and selfshadowlist to be std::vector
2016-07-29 15:56:48 -06:00
Eric Wasylishen
b669767fe0
light: add an assertion for model offsets
2016-07-29 15:51:26 -06:00
Eric Wasylishen
a0d3a90df9
light: fix uninitialized model offset causing messed up lighting on submodels (!)
2016-07-29 13:34:42 -06:00
Eric Wasylishen
c3de3eb99a
light: -dumpface: also print model number
2016-07-29 12:28:15 -06:00
Eric Wasylishen
3d85f49adb
light: entities: write null byte at the end of bsp->dentdata
2016-07-29 00:21:12 -06:00
Eric Wasylishen
7edf27de0c
build: fix escaping in light/CMakeLists.txt
2016-07-27 19:21:53 -06:00
Eric Wasylishen
f4a363b416
light: make DirtTrace return a hittype_t
2016-07-27 13:07:50 -06:00
Eric Wasylishen
197c898976
light: hack to allow "-dirt 0" to disable all dirmapping (todo: check -dirt 1 implies minlight, sunlight dirt properly?)
2016-07-27 12:37:57 -06:00
Eric Wasylishen
ceec496bfe
light: entities: add some debug logging
2016-07-27 12:15:28 -06:00
Eric Wasylishen
5b9405a93e
light: move suns to a std::vector
2016-07-27 11:05:54 -06:00
Eric Wasylishen
2651c79307
light: fixes to settings system
2016-07-27 02:20:25 -06:00
Eric Wasylishen
a68979a57b
light: add -nolights option
2016-07-27 02:00:11 -06:00
Eric Wasylishen
6da4ab87ae
light: reorganize settings
2016-07-27 00:49:34 -06:00
Eric Wasylishen
7757e834a3
light: clean up dirtmapping logic
2016-07-26 21:08:04 -06:00
Eric Wasylishen
da64f27015
light: add lockable_bool_t
2016-07-26 20:50:32 -06:00
Eric Wasylishen
2b12654c49
light: remove dead code
2016-07-26 18:08:58 -06:00
Eric Wasylishen
fb1288a5c0
light: rename entity_t to light_t
2016-07-26 18:03:43 -06:00
Eric Wasylishen
f729171a44
light: entities: clean out some dead code
2016-07-26 18:01:28 -06:00
Eric Wasylishen
8b1e1e0164
light: entities: delete some dead code
2016-07-26 16:41:27 -06:00
Eric Wasylishen
9279c86fb5
light: fix -addmin switch (temporary hack)
2016-07-26 16:09:16 -06:00
Eric Wasylishen
5b68158736
light: fix _project_mangle to be consistent with "mangle" (yaw pitch roll)
2016-07-26 16:09:04 -06:00
Eric Wasylishen
9fc8f0d6c1
light: entities: tidy surface light code a bit
2016-07-26 13:59:39 -06:00
Eric Wasylishen
6b51bad817
light: fix surface lights
2016-07-26 13:48:36 -06:00
Eric Wasylishen
dc8525dfd2
light: entities: refactor EntDict_VectorForKey
2016-07-26 13:12:57 -06:00
Eric Wasylishen
f716e14c89
light: minor cleanups
2016-07-26 13:04:17 -06:00
Eric Wasylishen
0b8ef0778d
light: entity_t: keep a pointer to the entdict_t rather than a copy
2016-07-26 12:43:58 -06:00
Eric Wasylishen
b71ae5a200
light: fix MatchTargets
2016-07-26 12:31:45 -06:00
Eric Wasylishen
02a2cee6a7
light: store lights in a vector (untested)
2016-07-26 02:13:58 -06:00
Eric Wasylishen
0501f07673
light: clean WorldValueForKey/SetWorldKeyValue
2016-07-24 16:56:40 -06:00
Eric Wasylishen
ca507336ca
light: use entdicts array for FIndModelInfo
2016-07-24 16:08:38 -06:00
Eric Wasylishen
d8094c83e5
light: EntDict_FloatForKey: avoid throwing exceptions excessively
2016-07-24 16:00:00 -06:00
Eric Wasylishen
7fdd5f2da4
light: entities: clean up parsing and writing entdata
2016-07-24 15:09:57 -06:00
Eric Wasylishen
203c32a613
light: misc fixes. lights not casting on world?
2016-07-24 12:55:07 -06:00
Eric Wasylishen
dc856a329d
light: use settings system for lights
2016-07-24 12:23:46 -06:00
Eric Wasylishen
2c350b1f21
light: finish porting modelinfo reading to settings system
2016-07-24 00:31:58 -06:00
Eric Wasylishen
5566e1f85d
light: convert modelinfo_t to use settings system
2016-07-24 00:26:42 -06:00
Eric Wasylishen
8851a3d8c3
light: remove some dead code
2016-07-23 23:27:19 -06:00
Eric Wasylishen
cc2bb5158a
light: add class for a dictionary of settings
2016-07-23 22:54:32 -06:00
Eric Wasylishen
0cd0778860
light: fix typo, min_color should have been mincolor
2016-07-23 22:54:17 -06:00
Eric Wasylishen
2e9c58fb46
light: move command-line parsing to use settings system
2016-07-23 21:43:54 -06:00
Eric Wasylishen
df62b9fa16
light: handle worldspawn keys through new settings system
2016-07-23 20:26:09 -06:00
Eric Wasylishen
8b8cc4a37a
light: add transformers for color and mangle
2016-07-22 14:02:43 -06:00
Eric Wasylishen
191949e569
Merge branch 'stable'
...
* stable:
light: trace: fix MakeTnodes_r blowing up with ijed's rift1.map
# Conflicts:
# light/trace.cc
2016-07-21 01:51:23 -06:00
Eric Wasylishen
f05faf9614
light: trace: fix MakeTnodes_r blowing up with ijed's rift1.map
2016-07-21 00:29:58 -06:00
Eric Wasylishen
f7d3bfbeb3
Merge branch 'stable'
2016-07-20 19:12:23 -06:00
Eric Wasylishen
2c0f39ea38
light: make TriArea non-static
2016-07-20 19:06:12 -06:00
Eric Wasylishen
4c59a00d2b
light: add -debugvert command
2016-07-20 19:05:55 -06:00
Eric Wasylishen
42c4195ad6
light: make -debugface print more debug info
2016-07-20 16:16:00 -06:00
Eric Wasylishen
26fbffa2bf
light: add GetSurfaceVertex and GetSurfaceVertexPoint to header
2016-07-20 16:15:42 -06:00
Eric Wasylishen
b15e0052bf
light: fix phong shading on models with an offset
2016-07-20 16:06:48 -06:00
Eric Wasylishen
7f939b8146
light: hack to workaround https://github.com/ericwa/tyrutils-ericw/issues/67 . worldspawn was being inserted into the list of lights when it had a minlight value set (!?!)
2016-07-20 16:04:35 -06:00
Eric Wasylishen
5bf59a469d
light: option parser: allow negative numbers as option args
2016-07-20 16:04:26 -06:00
Eric Wasylishen
d86e6acec6
light: add SetString
2016-07-16 13:11:59 -06:00
Eric Wasylishen
ee50412f65
light: add FindSetting function
2016-07-15 10:44:35 -06:00
Eric Wasylishen
60d96df31c
light: set min/max values for some settings
2016-07-14 00:02:44 -06:00
Eric Wasylishen
08a6733204
light: refactor settings system
2016-07-13 22:55:55 -06:00
Eric Wasylishen
d467888d89
light: register settings in a map
2016-07-13 22:11:21 -06:00
Eric Wasylishen
cd013405e7
light: convert more settings to lockable_*_t
2016-07-13 21:51:04 -06:00
Eric Wasylishen
42657f9607
light: record setting names
2016-07-13 21:33:38 -06:00
Eric Wasylishen
c694bacc2f
light: fix entity_t to be zero-initialized
2016-07-12 00:39:44 -06:00
Eric Wasylishen
7646175048
Merge branch 'stable'
...
* stable:
light: trace: raise stack depth 128->256 to handle lavabloom_bad.bsp from Pritchard
light: use Face_TextureName() everywhere we need texture names. Handle negative miplump->dataofs[texnum].
build: appveyor: use v140_xp toolset for xp compatibility
# Conflicts:
# appveyor.yml
2016-07-12 00:25:50 -06:00
Eric Wasylishen
e82f67eb34
light: trace: raise stack depth 128->256 to handle lavabloom_bad.bsp from Pritchard
2016-07-12 00:21:14 -06:00
Eric Wasylishen
992b2e51bc
light: use Face_TextureName() everywhere we need texture names. Handle negative miplump->dataofs[texnum].
2016-07-12 00:20:00 -06:00
Eric Wasylishen
1f4d20ee04
light: workaround weird syntax error
2016-07-07 00:07:01 -06:00
Eric Wasylishen
5b26bc4709
light: add EntData_Write and EntData_Parse (unused)
2016-07-06 17:46:17 -06:00
Eric Wasylishen
78810fa765
common: fix COM_Parse const-ness
2016-07-06 17:06:28 -06:00
Eric Wasylishen
37324f9245
light: entities: remove stored classname
2016-07-06 16:29:25 -06:00
Eric Wasylishen
1f723c94e6
light: entities: remove entity_t.target and entity_t.targetname
2016-07-06 14:26:14 -06:00
Eric Wasylishen
431a2077d5
light: entities: replace lighttargets array with a std::vector
2016-07-06 14:08:01 -06:00
Eric Wasylishen
47c0c7ccc9
light: entities: replace epairs with std::map
2016-07-06 13:42:32 -06:00
Eric Wasylishen
e012a2c93e
light: finish c++ifying
2016-07-06 13:14:06 -06:00
Eric Wasylishen
1c8e7e6585
light: remove use of c99 designated initializers since they're not in c++11
2016-07-06 00:13:30 -06:00
Eric Wasylishen
d225891ef5
light: c++ify remaining files
2016-07-05 22:27:41 -06:00
Eric Wasylishen
34bc864616
light: print elapsed time to 3 decimal places
2016-07-04 21:06:34 -06:00
Eric Wasylishen
50a677408b
light: hack to workaround https://github.com/ericwa/tyrutils-ericw/issues/67 . worldspawn was being inserted into the list of lights when it had a minlight value set (!?!)
2016-06-30 14:49:55 -06:00
Eric Wasylishen
ec6352a5fe
light: option parser: allow negative numbers as option args
2016-06-30 14:14:59 -06:00
Eric Wasylishen
a7e9d9bba4
light: embree: fix for liquid faces casting shadows!
2016-06-30 14:14:28 -06:00
Eric Wasylishen
bdca751361
build: hack for install_name_tool causing Xcode build to fail when returning nonzero exit status
2016-06-30 14:14:06 -06:00
Eric Wasylishen
886f033748
build: fix up OS X embree packaging
2016-06-28 18:09:58 -06:00
Eric Wasylishen
cc6ca58c8d
build: add OS X packaging script
2016-06-28 16:16:43 -06:00
Eric Wasylishen
3e6018a95a
build: switch back to dynamic linking embree, static was a pain, slow builds, etc.
2016-06-28 15:04:50 -06:00
Eric Wasylishen
913d6f068c
light: DirtTrace: return hitdist instead of hitpoint
2016-06-19 16:39:59 -06:00
Eric Wasylishen
1d3774a9e0
light: make DirtTrace take dir / dist instead of endpoint to reduce VectorNormalize calls
2016-06-19 15:38:09 -06:00
Eric Wasylishen
b652f00fdd
build: copy gplv3 and embree license into cpack archive
2016-06-18 17:55:09 -06:00
Eric Wasylishen
f515671c51
build: fix EMBREE_STATIC_LIB define
2016-06-18 16:09:23 -07:00
Eric Wasylishen
b983686972
build: use -msse3 if building with embree. make light target depend on embree target
2016-06-18 15:08:34 -06:00
Eric Wasylishen
d9cf97f582
build local copy of embree and static link it
2016-06-18 14:50:14 -06:00
Eric Wasylishen
cfe3553ac6
light: embree: disable robust flags
2016-06-17 21:21:30 -06:00
Eric Wasylishen
1458f097da
light: build: rename embree license
2016-06-17 21:21:30 -06:00
Eric Wasylishen
57f4dd0ee9
light: build: fix cpack config
2016-06-17 21:21:30 -06:00
Eric Wasylishen
c87a57165c
light: build: edit "embree found" message, seems to cause build error on appveyor
2016-06-17 21:21:30 -06:00
Eric Wasylishen
5054ced22d
light: fix embree support
2016-06-17 21:21:30 -06:00
Eric Wasylishen
7729e90d99
light: fix crash when no textures present
2016-06-10 21:29:23 -06:00
Eric Wasylishen
3b07fb3879
Revert "light: add cull_backfaces hack used by CalcPoints, to handle the case when a shadow-casting bmodel is obstructing the midpoint of a face."
...
This reverts commit 412e169ef6 .
2016-06-10 13:16:15 -06:00
Eric Wasylishen
412e169ef6
light: add cull_backfaces hack used by CalcPoints, to handle the case when a shadow-casting bmodel is obstructing the midpoint of a face.
...
probably should be removed and CalcPoints made more robust.
2016-06-10 12:23:22 -06:00
Eric Wasylishen
470dac14d7
light: handle fence textures
2016-06-10 11:47:59 -06:00
Eric Wasylishen
a57393a3c4
light: test fence textures in TraceFaces
2016-06-10 00:07:30 -06:00
Eric Wasylishen
e0a4b8c113
light: add todos about -fence
2016-06-09 01:48:47 -06:00
Eric Wasylishen
7c3aa545bb
light: sunlight refactoring
2016-06-09 00:47:59 -06:00
Eric Wasylishen
aa998d7b7a
light: support sunlight options on command-line
2016-06-09 00:31:52 -06:00
Eric Wasylishen
4e5a7a79b1
light: refactor and make option parsing safer
2016-06-08 23:39:38 -06:00
Eric Wasylishen
f29c8fa0f6
light: clamp bouncecolorscale to [0,1]
2016-06-08 22:57:52 -06:00
Eric Wasylishen
dbae785404
light: refactor sunlight handling so command-line options can be adde
2016-06-08 22:08:00 -06:00
Eric Wasylishen
0e5438ab14
light: fix saving bogus lightmaps for non-lightmapped faces when -bounce is in use
2016-06-07 20:26:19 -06:00
Eric Wasylishen
b33cd040f7
light: add a sanity check for writing lightmaps for skip/trigger/sky faces. still needs to be fixed.
2016-06-07 17:42:53 -06:00
Eric Wasylishen
d1c4470fc1
light: add "-novis" to help listing
2016-06-04 22:22:22 -06:00
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