Skip to main content

@novorender/api / RenderState

Interface: RenderState

Defined in: @novorender/src/core3d/state/index.ts:36

An object describing the what to be rendered and how by RenderContext.render.

Remarks

The render state is immutable by design. You should not attempt to mutate existing objects. The correct way to change render state is to use the modifyRenderState function. This function will create a new copy of objects with new/modified properties, while retaining all objects that hasn't changed. It will also perform basic validation. The engine uses strict equality to determine if some portion of the state has changed. Hence, it's important that unchanged sub objects are not copied.

The render state is serializable via JSON or structuredClone(). This can be useful for test/diagnostics purposes, since the render state should define how the output image eventually is rendered. It may take a while for downloads of streamed resources to complete, however, so the output image will not be fully resolved until all pending downloads are complete. There are also other runtime factors, such as device specific limitations or variations, that may contribute to small deviations in the output image. A direct pixel to pixel comparison between two output images generated by identical render state is thus likely to fail unless it's rendered on the same device and same version of our API, browser, OS and drivers.

Extended by

Properties

background

readonly background: RenderStateBackground;

Defined in: @novorender/src/core3d/state/index.ts:41

background/environment related state.


camera

readonly camera: RenderStateCamera;

Defined in: @novorender/src/core3d/state/index.ts:44

camera related state.


clipping

readonly clipping: RenderStateClipping;

Defined in: @novorender/src/core3d/state/index.ts:68

Clipping planes related state.


cube

readonly cube: RenderStateCube;

Defined in: @novorender/src/core3d/state/index.ts:56

@internal.


dynamic

readonly dynamic: RenderStateDynamicObjects;

Defined in: @novorender/src/core3d/state/index.ts:65

Dynamic objects related state.


grid

readonly grid: RenderStateGrid;

Defined in: @novorender/src/core3d/state/index.ts:50

Grid helper related state.


highlights

readonly highlights: RenderStateHighlightGroups;

Defined in: @novorender/src/core3d/state/index.ts:71

Highlights related state.


outlines

readonly outlines: RenderStateOutlines;

Defined in: @novorender/src/core3d/state/index.ts:74

Outlines related state.


output

readonly output: RenderStateOutput;

Defined in: @novorender/src/core3d/state/index.ts:38

Output image related state.


pick

readonly pick: RenderStatePick;

Defined in: @novorender/src/core3d/state/index.ts:86

Pick info rendering related state.


points

readonly points: RenderStatePointCloud;

Defined in: @novorender/src/core3d/state/index.ts:80

Point cloud rendering related state.


quality

readonly quality: RenderStateQuality;

Defined in: @novorender/src/core3d/state/index.ts:47

Render quality related state.


scene

readonly scene: undefined | RenderStateScene;

Defined in: @novorender/src/core3d/state/index.ts:59

Static, streamable scene related state.


terrain

readonly terrain: RenderStateTerrain;

Defined in: @novorender/src/core3d/state/index.ts:62

Terrain rendering related state.


tonemapping

readonly tonemapping: RenderStateTonemapping;

Defined in: @novorender/src/core3d/state/index.ts:77

Tonemapping related state.


toonOutline

readonly toonOutline: RenderStateToonOutline;

Defined in: @novorender/src/core3d/state/index.ts:83

Toon outline rendering related state.