Reference · The <chikyu-earth-realistic> element
setSharedRendererfunction
Hands the elements a renderer the page made, so a page that draws other things with kazoku-ui's shared renderer keeps one WebGL context for all of them. Call it before the first element connects, or while none is in the page. The page owns the renderer: the elements never dispose it, and its own maxRatio and onContext apply. Pass undefined to go back to the package's own.
Import it
import { setSharedRenderer } from "@johnmorrisdotca/chikyu-earth/realistic/element";
Definition
function setSharedRenderer(renderer: SharedRenderer<Three> | undefined): void
Parameters
| Name | Type | Description |
|---|---|---|
renderer | SharedRenderer<ThreeParts> | undefined | A renderer made with |
Examples
import { createSharedRenderer } from "@johnmorrisdotca/kazoku-ui/renderer";
import { setSharedRenderer } from "@johnmorrisdotca/chikyu-earth/realistic/element";
setSharedRenderer(createSharedRenderer({ load: () => import("three"), maxRatio: 1.5 }));