Currently, there is a single default fog environment used for all rendering in all Ages, and its values are reset when loading an Age via console commands in the .fni files. There is also a Python API that can be used to change the values.
Support exists (but is not exposed or ever used) for per-object fog environments via plFogEnvironment
objects and references in the DrawableSpans.
However, there is currently no way to animate fog changes or transitions between fog values without resorting to Python hacks.
-
Wrap the 4 attributes (start, end, density, colour) of
plFogEnvironment
withhsTimedValue<T>
. This effectively allows tweening between two values over a duration. -
Add an
Eval
method toplFogEnvironment
to evaluate the current value of those attributes (if animating and the timestamp does not match the last calculation). -
In
plPipeline
, when getting the fog environment for an object, call itsEval
before rendering. -
Add a new message type that can be sent to a
plFogEnvironment
specifying new values for the attributes, and a transition duration. This message should be triggerable via responders, and maybe should replace the implementation of the current console commands? (Would need a way to address the global fog object)