Canvas object to use for rendering
createImageBitmap support for the runtime
This is used to determine if and which version of the createImageBitmap API is supported by the runtime. This is used to determine if the renderer can use createImageBitmap to load images.
Options supported
Note with auto detection, the renderer will attempt to use the most advanced version of the API available. If the API is not available, the renderer will fall back to the next available version.
This will affect startup performance as the renderer will need to determine the supported version of the API.
Include context call (i.e. WebGL) information in FPS updates
Font Engines
The font engines to use for text rendering. CanvasTextRenderer is supported
on all platforms. SdfTextRenderer is a more performant renderer.
When using renderEngine=CanvasCoreRenderer
you can only use CanvasTextRenderer
.
The renderEngine=WebGLCoreRenderer
supports both CanvasTextRenderer
and SdfTextRenderer
.
This setting is used to enable tree shaking of unused font engines. Please import your font engine(s) as follows:
import { CanvasTextRenderer } from '@lightning/renderer/canvas';
import { SdfTextRenderer } from '@lightning/renderer/webgl';
If both CanvasTextRenderer and SdfTextRenderer are provided, the first renderer provided will be asked first if it can render the font. If it cannot render the font, the next renderer will be asked. If no renderer can render the font, the text will not be rendered.
Note that if you have fonts available in both engines the second font engine will not be used. This is because the first font engine will always be asked first.
Force WebGL2
Number or Image Workers to use
Provide an alternative platform abstraction layer
Quad buffer size in bytes
Renderer Engine
The renderer engine to use. Spawns a WebGL or Canvas renderer. WebGL is more performant and supports more features. Canvas is supported on most platforms.
Note: When using CanvasCoreRenderer you can only use CanvasTextRenderer. The WebGLCoreRenderer supports both CanvasTextRenderer and SdfTextRenderer for Text Rendering.
Enable strictBounds
Configuration settings for RendererMain