Add the -soft command line option which implements post-processing on
the lightmap surface to blend adjacent samples together to smooth out
hard shadow lines.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Substantial changes to TestLineOrSky which now becomes TraceLine to
more conveniently trace lines through the BSP and, terminate the trace
on specific contents and return information about the termination
point.
TraceLine also more correcly handles the cases where points are close
enough to the node planes to be considered "on-node" to ensure we get
a good intersection point back, when requested.
Finally, the algorithm for making the small adjustments to surface
points in CalcPoints has been changed so if the surface point can't
see the midpoint, we find the obscuring surface and move the surface
point just above that. Seems to work better and eliminates some (but
not quite all - midpoint is still not quite the ideal point to use)
random black spots.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
"nominlimit" is a more sensible default - people expect negative
lights to be able to subtract from minlight. The negative colors never
really worked properly and there's not really any worthwhile use for
the (that I know of).
Hopefully nobody will be too upset by these two changes to the old
behaviour.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Brush models can now self shadow without casting shadows on their
environment, using the "_shadowself" entity key.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Collect the appropriate keys from the models at load time and pass them
into the minlighting function (if > world minlight).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
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>
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>
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>
Implement the two extra light attenuation formulae that were added to
Benjt Jardrup's light util (http://user.tninet.se/~xir870k/readmevis.txt).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
First pass at detail support as implemented in tyr-qbsp, using the PRT2
file format (hopefully nobody else already decided to use that?)
Because the "leaf" terminology is pervasive across the source, I've left
it there for now (so "leaf" usually now means "cluster") and added a few
variables with the "_real" suffix when they actually mean the real leafs
and not the clusters which vis still calls leafs. A bit disgusting, but it
actually works so I'll go through and clean up naming, etc. later.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Inspired by the implementation of Benjt Jardrup, save the current state of
the vis job to disc at regular intervals so that we can resume from that
point in case the computer needs to be rebooted/shutdown or crash/power
issues occur.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Logprint will notify the threads code that the progress meter has been
interrupted and the progress meter will re-print the next time it needs to
be updated.
Unfortunately this makes all the utils depend on the thread code, but not
a big issue.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Importing parts of this from TyrQuake - means that the base type used for
managing the bit vectors is unsigned long. Not really a performance win or
anything here, just a bit nicer to not have to cast from (byte *) to
(long *) - just adds a little extra work before writing out the compressed
data.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Make the base portal vis thread safe and run on multiple threads. Use the
common thread progress indicator code.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>