ImageFadeFx

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting
Jump to navigation Jump to search

This page describes SOMA’s ImageFadeFx effect.

ImageFadeFX is a post effect with separate fade, color and offset textures. SetTextures loads those three texture slots; FadeAmount computes a change speed from the target amount and fade duration, or sets the amount immediately when the duration is nonpositive.

Typed interface

The methods are declared in script/effects/Effects.hps on iScrEffect_ImageFadeFX:

void SetTextures(const tString& in asFadeTexture, const tString& in asColorTexture, const tString& in asOffsetTexture);
void SetAmount(float afAmount);
void FadeAmount(float afAmount, float afTime);

Read the texture and fade controls

  1. Trace SetTextures in script/effects/Effect_ImageFadeFX.hps: the arguments fill slots 0, 1 and 2 in fade, color and offset order. Each nonempty filename is loaded as a 2D texture. A failed load produces an error and clears that slot’s filename.
  2. Follow SetAmount: it creates or retrieves the post effect, applies the amount and texture slots, and makes the script effect active when the amount is greater than zero.
  3. Follow FadeAmount: for a positive afTime, the change speed is abs(target - current) / afTime; otherwise it calls SetAmount immediately.

Still to expand

The texture-loading and amount controls are verified, but no shipped campaign caller was found. A complete texture set and a verified visual example are still needed.

See also