Renderer
new Renderer({ width?, height?, canvas?, pixelRatio?, sortObjects? })THREE equivalent: THREE.WebGLRenderer
Canvas2D software renderer. Runs the full pipeline each frame: clear background and CPU depth buffer, traverse, fog cull, order draw calls, light bake, rasterize, and upload the framebuffer.
Differs from THREE.js
Canvas2D software renderer, not WebGL. Constructor takes an options object. Depth testing is CPU-side and texture backgrounds belong on Scene.background.
Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
domElement |
HTMLCanvasElement|undefined |
The managed canvas element (read-only). |
width |
number |
Framebuffer width in pixels. Default 300. |
height |
number |
Framebuffer height in pixels. Default 150. |
pixelRatio |
number |
Device pixel ratio. Default 1. |
sortObjects |
boolean |
THREE-style draw-call sorting flag. Default true. Set false for opaque depth-buffered static scenes. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
render(scene: Scene, camera: Camera): void |
Runs the full rendering pipeline and uploads the result to the canvas. |
setSize(width: number, height: number): void |
Resizes the canvas framebuffer. |
setPixelRatio(ratio: number): void |
Updates the device pixel ratio. |
setClearColor(color: Color | number) | setClearColor(r: number, g: number, b: number): void |
Sets the background clear color. Accepts a Color instance, hex number, or three r/g/b integers. For texture backgrounds, assign scene.background directly. Fog color overrides both. |
dispose(): void |
Releases renderer resources. |