Skip to content

RenderOpts

Defined in: packages/threeplay/src/plugins/render/types.ts:37

Options added to threeplay() by the render plugin.

optional antialias?: boolean

Defined in: packages/threeplay/src/plugins/render/types.ts:58

Antialiasing (default true).


optional background?: ColorLike | null

Defined in: packages/threeplay/src/plugins/render/types.ts:52

Clear color (default a soft sky blue). null keeps the canvas transparent.


optional canvas?: HTMLCanvasElement

Defined in: packages/threeplay/src/plugins/render/types.ts:48

Draw into this canvas instead of creating one.


optional height?: number

Defined in: packages/threeplay/src/plugins/render/types.ts:44


optional letterbox?: boolean

Defined in: packages/threeplay/src/plugins/render/types.ts:46

Keep the aspect ratio with bars when scaling (default true with width/height).


optional lighting?: "none" | "default"

Defined in: packages/threeplay/src/plugins/render/types.ts:62

"default" adds a hemisphere light and a sun with shadows; "none" adds nothing.


optional pixelRatio?: number

Defined in: packages/threeplay/src/plugins/render/types.ts:56

Device pixel ratio cap (default Math.min(devicePixelRatio, 2)).


optional renderer?: "auto" | RendererKind

Defined in: packages/threeplay/src/plugins/render/types.ts:54

"auto" (WebGPU with WebGL2 fallback, default), "webgpu", "webgl" or "none" (headless).


optional root?: HTMLElement

Defined in: packages/threeplay/src/plugins/render/types.ts:50

Element that receives the canvas and overlays (default document.body).


optional shadows?: boolean

Defined in: packages/threeplay/src/plugins/render/types.ts:60

Shadow maps (default true).


optional width?: number

Defined in: packages/threeplay/src/plugins/render/types.ts:43

Logical width. With width and height the game thinks in a fixed size (HUD coordinates, aspect) and the canvas is scaled to the container. Without them the canvas fills the container and the logical size follows it.