View

class View(nativeHandle: NativePointer)

A View encompasses all the state needed for rendering a Scene.

Renderer.render() operates on View objects. These View objects specify important parameters such as the Scene, Camera, Viewport, and various rendering parameters.

View instances are heavy objects that internally cache a lot of data needed for rendering. It is not advised for an application to use many View objects. For example, in a game, a View could be used for the main scene and another one for the game's user interface. More View instances could be used for creating special effects (a View is akin to a rendering pass).

See also

, Camera, RenderTarget

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard
class PickingQueryResult(val renderable: Int, val depth: Float, val fragCoords: FloatArray)

Result of a picking (color-picking) query.

Properties

Link copied to clipboard

Screen-space ambient occlusion (SSAO) configuration. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Post-process anti-aliasing operator (AntiAliasing.FXAA by default).

Link copied to clipboard

How this View's result blends over the render target's existing content.

Link copied to clipboard

Bloom post-processing configuration (requires post-processing enabled). The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

The Camera this View is rendered from. A Camera can be associated to several Views.

Link copied to clipboard

Color grading to apply, or null for the default. The View does not own it.

Link copied to clipboard

Depth-of-field post-processing configuration (needs a focused camera). The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Dithering applied to the final render to hide banding. Default: Dithering.TEMPORAL.

Link copied to clipboard

Dynamic-resolution (render scaling) configuration for this View. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

The effective grid size used for world-origin snapping: gridSize when positive, otherwise the automatically calculated size.

Link copied to clipboard

Entity representing the large-scale fog object; can be transformed via TransformManager.

Link copied to clipboard

Large-scale atmospheric fog configuration. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Grid size in world units used for grid-based world-origin snapping. 0 or negative means the size is calculated automatically from the camera frustum. Default: 0 (automatic).

Link copied to clipboard

Guard-band configuration, letting some effects sample outside the viewport. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Whether a Camera is currently associated with this View.

Link copied to clipboard

Inverts the winding order considered front-facing (counter-clockwise by default). Useful for mirror-like reflections rendered with a flipped camera.

Link copied to clipboard

Culls renderables outside the camera frustum. Default: true (disable only for debugging).

Link copied to clipboard

Enables or disables the post-processing stage (tone mapping, bloom, color grading, FXAA, dynamic scaling, …). Disabling it also disables features that depend on it. Default: enabled.

Link copied to clipboard

Enables screen-space refraction for refractive materials. Default: true.

Link copied to clipboard

Master switch for shadow mapping in this View. Default: true.

Link copied to clipboard

Allocates a stencil buffer for this View (required for stencil-based effects). Default: false.

Link copied to clipboard

Includes transparent renderables in pick results. Default: true.

Link copied to clipboard

Returns the [x, y] scale factors dynamic resolution used on the last frame.

Link copied to clipboard

Hardware MSAA configuration (independent of antiAliasing/TAA). The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard
var name: String?

Debug name of this View, shown in diagnostic tools.

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Link copied to clipboard

Global quality/performance trade-offs (e.g. color-buffer precision) for this View. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Off-screen RenderTarget to render into, or null to render into the SwapChain. The render target is not owned by the View.

Link copied to clipboard
var scene: Scene?

The Scene associated with this View. A Scene can be associated to several Views.

Link copied to clipboard

Screen-space reflections configuration. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Shadow mapping technique for the whole View (ShadowType.PCF, VSM, DPCF, PCSS).

Link copied to clipboard

Soft shadow options; only applies when shadowType is DPCF or PCSS. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Stereoscopic (VR) rendering configuration; must be set before the first frame. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Temporal anti-aliasing (TAA) configuration; effective when antiAliasing permits it. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

The rectangular region of the render target this View renders into.

Link copied to clipboard

Vignette post-processing configuration. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Returns the current visible-layer bitmask.

Link copied to clipboard

Returns the most recent number of visible renderables for the current Scene, as calculated the last time Renderer.render() was called with this View and Scene.

Link copied to clipboard

Variance shadow mapping options; only applies when shadowType is ShadowType.VSM. The getter returns a snapshot — mutate it and assign back to apply.

Functions

Link copied to clipboard

Discards accumulated frame history (TAA, SSR). Call after a camera cut to avoid ghosting.

Link copied to clipboard

Returns the float4 material-global value at index (0–3).

Link copied to clipboard

Whether the depth buffer is cleared before light channel renders.

Link copied to clipboard
fun pick(x: Int, y: Int, callback: (View.PickingQueryResult) -> Unit)

Asynchronously picks the renderable at viewport coordinates (x, y) — origin bottom-left — and invokes callback with the result a few frames later. Requires the picking feature (enabled by default) and a rendered frame.

Link copied to clipboard
fun setChannelDepthClearEnabled(channel: Int, enabled: Boolean)

Enables or disables clearing the depth buffer before each light channel (0–7) renders. Default: disabled.

Link copied to clipboard

Sets the near/far planes (in world units, > 0) used to compute the froxel grid for dynamic lighting. Only lights within this range are lit. Defaults: 5 / 100.

Link copied to clipboard
fun setLayerEnabled(layer: Int, enabled: Boolean)

Enables or disables a single visibility layer (0–7).

Link copied to clipboard
fun setMaterialGlobal(index: Int, value: FloatArray)

Sets the float4 material-global value at index (0–3), readable from all materials.

Link copied to clipboard
fun setVisibleLayers(select: Int, values: Int)

Sets which layers are visible: for each bit set in select, visibility is taken from the corresponding bit in values. Renderables are assigned layers via RenderableManager.setLayerMask. By default all layers are visible.