Header menu logo Mibo

PostProcessContext2D Type

Context handed to a Command2D.PostProcess action each frame. The renderer has already rendered the scene to Source and entered the destination render target (a pooled ping-pong RT, or the back-buffer for the last pass). The action resolves its own shader, sets model-derived params, and draws a fullscreen quad of Source.

Record fields

Record Field Description

Camera

Full Usage: Camera

Field type: Camera2D voption

The last active Camera2D during the scene render (ValueNone when no BeginCamera block was used). Useful for anchoring post-process effects in world space (world-aligned fog, distortion). When multiple camera blocks exist in the same frame this is the last one — the scene RT contains all of them composited, so a single camera reference can't reconstruct per-camera regions. Commands within a layer are executed in insertion order (deterministic stable sort), so "last" is well-defined.

Field type: Camera2D voption

Context

Full Usage: Context

Field type: GameContext

Game services — e.g. tryGetService<IAssets> to resolve a shader lazily (defers resolution to first frame, where the device/assets exist).

Field type: GameContext

Height

Full Usage: Height

Field type: int
Field type: int

Lights

Full Usage: Lights

Field type: LightContext2D voption

The active 2D light context (ValueNone when no lit sprites were drawn this frame). Read Lights.Value.PointLights, Lights.Value.DirLights, Lights.Value.Ambient to drive light-aware effects (bloom on lit areas, light-tinted color grading).

Field type: LightContext2D voption

Source

Full Usage: Source

Field type: RenderTexture2D

Current ping-pong source (the scene RT on the first pass).

Field type: RenderTexture2D

Time

Full Usage: Time

Field type: float32

Accumulated frame time in seconds, for animated effects.

Field type: float32

Width

Full Usage: Width

Field type: int
Field type: int

Type something to start searching.