Commit Graph

42 Commits

Author SHA1 Message Date
Eric Wasylishen b345dccfe7 light: disable deviance if samples <= 1 or deviance <= 0. 2015-08-14 14:28:53 -06:00
Eric Wasylishen bc0e1778dc light: allow negative surface offsets for niche use 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 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 a219d3e0a0 light: WriteEntitiesToString: add explanation from Spike 2015-07-09 16:34:06 -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 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 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 a33c4b0136 light: surface light support via "_surface" "texturename" light key 2015-04-26 02:24:57 -06:00
Eric Wasylishen 6fe67cd2fb light: allow setting _dist and _range in worldspawn 2015-04-25 20:46:00 -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 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
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 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 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 f20033fdd7 light: dynamically allocate entities and entstring
Removes the MAX_MAP_ENTITIES and MAX_MAP_ENTSTRING limitations by
counting how much space we will need before parsing/writing.

Now that I look at it, I'm not sure why we should even be re-writing
the entity string in the new bsp file, but I'll leave that behaviour
alone... for now.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-18 09:45:52 +09:30
Kevin Shanahan c193c18d5b make -gate affect linear falloff lights as well
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-06 13:25:11 +10:30
Kevin Shanahan 636a94f260 light: implemented _anglescale key (AKA "_angelsense")
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-15 21:27:14 +10:30
Kevin Shanahan 4abc7d31b7 light: remove the old -compress option
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-15 20:43:12 +10:30
Kevin Shanahan e8d640f88f light: use lightsample_t for minlight and sunlight
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-10 18:42:35 +10:30
Kevin Shanahan f82562f9e4 light: use lightsample_t for entity light values
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-10 18:28:00 +10:30
Kevin Shanahan 4063d8aade light: implement the _softangle key for spotlights
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-03 21:37:21 +10:30
Kevin Shanahan a8d8150791 light: implement the -gate option
Precalculate the distance at which lights will fade to zero brightness.
For lights with inverse falloff, use the gate value to determine the
cut-off distance.  Use this value to cull samples and avoid the ray
tracing overhead.

Hopefully not too controversially, I am going to default this to "on" with
a gate value of 0.001. Unless you have > 1000 lights contributing
fractional light values across your map, this is not going to make any
visible difference.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-03 13:36:52 +10:30
Kevin Shanahan b746947595 light: use VecStr convenience function for log messages
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-02 11:27:10 +10:30
Kevin Shanahan ad129c59da light: rename sunmangle variable as sunvec
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 11:58:50 +10:30
Kevin Shanahan f07007f8ad light: setup spotlight paramters once at load time
We were calculating these values for every light and for every surface,
which seems a little excessive... Also made the variable names a bit more
sensible - we had stored a direction vector, not the actual mangle values.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 11:50:57 +10:30
Kevin Shanahan 8ce739fe3f light: remove bsp30 support and automatically generate .lit when needed
Check whether any of the entities have colored fields set and if so,
enable colored light output. Can still be overridden from the command line
if needed.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 10:07:53 +10:30
Kevin Shanahan 54a5890217 light: lift light entity field checks into separate function
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 21:13:53 +10:30
Kevin Shanahan 854c7b4bb9 light: trivial variable rename
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 21:13:12 +10:30
Kevin Shanahan 599742310b light: use an enum for light attenuation formulae
And warn if we are given a formula number we don't know about.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 17:13:53 +10:30
Kevin Shanahan 22ca3262f0 light: remove alloc argument to LightStyleForTargetname()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 15:59:03 +10:30
Kevin Shanahan ea836f6b0b light: constify light's version of ValueForKey()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-11 20:10:47 +10:30
Tyrann 2c2f3c8eb6 Import initial sources 2006-08-28 23:58:10 +09:30