Rendering effects

The following scripts dynamically update the fog, precipitation, and environment map settings used by the Dark Engine's renderer.


ParameterTypeDescriptionDefault value
transitiontimelength of transition between states0 (instantaneous)
curvestringshape of curve to interpolate values alonglinear

The fog and weather scripts can provide smooth transitions between the old and new values. The transition parameter specifies the length of the transition. If that parameter is undefined or set to 0, the transition will be instantaneous. The curve parameter specifies the shape of the interpolated curve, from among the values below. (t is the progress of the transition in the range [0.0, 1.0], while α is the multiplier used to interpolate between the starting and ending values at that time.)

Straight line: α = t (solid black line)
Parabolic curve: α = t2 (solid red curve)
Radical curve: α = √t (solid blue curve)
Logarithmic curve (base 10):
α = log10(0.9t + 0.1) + 1 (solid green curve)
Power curve (base 10): α = (10t - 1) / 9 (solid orange curve)
Logarithmic curve (base e):
α = loge((1 - 1/e)t + 1/e) + 1 (dashed green curve)
Power curve (base e): α = (et - 1) / (e - 1) (dashed orange curve)

The usual trap control flags, locking, and timing (before the start of the transition, not its length) are also respected by these scripts.

This documentation is part of the KDScript module. Copyright © 2012–2014 Kevin Daughtridge. See introduction for details.