Header menu logo Mibo

PostProcessContext2D Type

Context handed to a PostProcess action each frame. The renderer has already rendered the scene to Source and set the destination render target (a pooled ping-pong RT, or the back-buffer for the last pass). The action binds its own effect, sets model-derived parameters, binds Source to the effect's sampler, and calls Quad.Draw(effect).

Record fields

Record Field Description

Camera

Full Usage: Camera

Field type: Camera2D voption

The last active camera 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 compiled effect lazily (defers resolution to first frame, where the device/assets exist).

Field type: GameContext

Device

Full Usage: Device

Field type: GraphicsDevice

The graphics device — needed to apply an Effect and bind textures.

Field type: GraphicsDevice

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

Quad

Full Usage: Quad

Field type: FullScreenQuad

Fullscreen quad primitive; call Draw(effect) once the effect is applied.

Field type: FullScreenQuad

Source

Full Usage: Source

Field type: RenderTarget2D

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

Field type: RenderTarget2D

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.