@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / RenderBackend
Interface: RenderBackend ​
Defined in: render/RenderBackend.ts:64
Everything renderer-specific the engine does, behind one small interface so a World can run on WebGL or WebGPU.
The default is webglBackend (exported from the package root). For a WebGPURenderer, pass webgpuBackend from @relu-interactives/spatial-ecs/webgpu.
Properties ​
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
kind | readonly | RendererKind | Renderer family this backend drives. | render/RenderBackend.ts:66 |
Methods ​
install()? ​
optional install(world): void;Defined in: render/RenderBackend.ts:68
One-time renderer setup, called once from the World constructor.
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void
prepareAreaLights()? ​
optional prepareAreaLights(world): void;Defined in: render/RenderBackend.ts:73
Called the first time an area light (RectAreaLight) is created, so the backend can load the lookup tables those lights need. Optional.
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void
createPostprocessing() ​
createPostprocessing(context): PostprocessingPipeline | null;Defined in: render/RenderBackend.ts:78
Build the post-processing chain for context.values. Return null to render the scene directly (no chain).
Parameters ​
| Parameter | Type |
|---|---|
context | PostprocessingBuildContext |
Returns ​
PostprocessingPipeline | null
updatePostprocessing()? ​
optional updatePostprocessing(
pipeline,
previous,
next): boolean;Defined in: render/RenderBackend.ts:87
Apply a values change to an existing chain without rebuilding it. Return true when the chain was updated in place, false when the change is structural (an effect switched on or off) and the caller must rebuild. When omitted, every change rebuilds.
Parameters ​
| Parameter | Type |
|---|---|
pipeline | PostprocessingPipeline |
previous | PostprocessingState |
next | PostprocessingState |
Returns ​
boolean
createChromaKeyMaterial() ​
createChromaKeyMaterial(texture, options): Material;Defined in: render/RenderBackend.ts:93
Material that renders texture with options.keyColor keyed out.
Parameters ​
| Parameter | Type |
|---|---|
texture | Texture |
options | ChromaKeyOptions |
Returns ​
Material
updateChromaKeyMaterial() ​
updateChromaKeyMaterial(material, options): boolean;Defined in: render/RenderBackend.ts:102
Push new options into a material made by createChromaKeyMaterial. Returns false when material is not one of this backend's chroma-key materials.
Parameters ​
| Parameter | Type |
|---|---|
material | Material |
options | ChromaKeyOptions |
Returns ​
boolean
createFoliageMaterial()? ​
optional createFoliageMaterial(options): Material;Defined in: render/RenderBackend.ts:107
Material for swaying grass (GrassComponent). Without one, grass is drawn still.
Parameters ​
| Parameter | Type |
|---|---|
options | FoliageMaterialOptions |
Returns ​
Material
updateFoliageMaterial()? ​
optional updateFoliageMaterial(material, wind): boolean;Defined in: render/RenderBackend.ts:109
Push the wind into a material made by createFoliageMaterial.
Parameters ​
| Parameter | Type |
|---|---|
material | Material |
wind | FoliageWind |
Returns ​
boolean

