RenderOpts
Defined in: packages/threeplay/src/plugins/render/types.ts:37
Options added to threeplay() by the render plugin.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”antialias?
Section titled “antialias?”
optionalantialias?:boolean
Defined in: packages/threeplay/src/plugins/render/types.ts:58
Antialiasing (default true).
background?
Section titled “background?”
optionalbackground?:ColorLike|null
Defined in: packages/threeplay/src/plugins/render/types.ts:52
Clear color (default a soft sky blue). null keeps the canvas transparent.
canvas?
Section titled “canvas?”
optionalcanvas?:HTMLCanvasElement
Defined in: packages/threeplay/src/plugins/render/types.ts:48
Draw into this canvas instead of creating one.
height?
Section titled “height?”
optionalheight?:number
Defined in: packages/threeplay/src/plugins/render/types.ts:44
letterbox?
Section titled “letterbox?”
optionalletterbox?:boolean
Defined in: packages/threeplay/src/plugins/render/types.ts:46
Keep the aspect ratio with bars when scaling (default true with width/height).
lighting?
Section titled “lighting?”
optionallighting?:"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.
pixelRatio?
Section titled “pixelRatio?”
optionalpixelRatio?:number
Defined in: packages/threeplay/src/plugins/render/types.ts:56
Device pixel ratio cap (default Math.min(devicePixelRatio, 2)).
renderer?
Section titled “renderer?”
optionalrenderer?:"auto"|RendererKind
Defined in: packages/threeplay/src/plugins/render/types.ts:54
"auto" (WebGPU with WebGL2 fallback, default), "webgpu", "webgl" or "none" (headless).
optionalroot?:HTMLElement
Defined in: packages/threeplay/src/plugins/render/types.ts:50
Element that receives the canvas and overlays (default document.body).
shadows?
Section titled “shadows?”
optionalshadows?:boolean
Defined in: packages/threeplay/src/plugins/render/types.ts:60
Shadow maps (default true).
width?
Section titled “width?”
optionalwidth?: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.