Skip to main content

Module screen_fx

Module screen_fx 

Source
Expand description

Transient full-screen effects a game fires at moments: shockwaves, flashes, and a light-shaft source.

crate::config::RenderConfig is the standing look of the picture, the grade and the bloom and the lens. This is what happens to the picture when something happens in the game. A blow lands and a ring of refraction runs out from the point of impact. A spell goes off and the frame flashes its colour and falls back. A brazier or a boss’s eye becomes the source that light shafts stream from.

All of it is stateful and decays on its own, so a game fires and forgets. Coordinates are the same screen pixels the UI layer uses: (0, 0) at the top left, y down.

Structs§

Reflection
A glossy floor: the picture mirrored about a horizontal line and laid back over itself below it, fading with distance from the line.
ScreenFx
Transient screen effects. Lives on the engine as engine.fx.
ScreenLight
A light in screen space, for the light map.
Shockwave
One expanding ring of refraction.

Constants§

MAX_LIGHTS
The most lights the light map takes in one frame.
MAX_SHOCKWAVES
Hard cap on simultaneous shockwaves; the composite shader has a fixed uniform array of this size.