pex-renderer

August 22, 2025 · View on GitHub

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Physically Based Renderer (PBR) and scene graph designed as ECS for PEX: define entities to be rendered as collections of components with their update orchestrated by systems.

Installation

npm install pex-renderer

Usage

import {
  renderEngine as createRenderEngine,
  world as createWorld,
  entity as createEntity,
  components,
} from "pex-renderer";

import createContext from "pex-context";
import { sphere } from "primitive-geometry";

const ctx = createContext({ pixelRatio: devicePixelRatio });
const renderEngine = createRenderEngine({ ctx });

const world = createWorld();

const cameraEntity = createEntity({
  transform: components.transform({ position: [0, 0, 3] }),
  camera: components.camera(),
  orbiter: components.orbiter(),
});
world.add(cameraEntity);

const skyEntity = createEntity({
  skybox: components.skybox({ sunPosition: [1, 0.5, 1] }),
  reflectionProbe: components.reflectionProbe(),
});
world.add(skyEntity);

const geometryEntity = createEntity({
  transform: components.transform({ position: [0, 0, 0] }),
  geometry: components.geometry(sphere()),
  material: components.material({
    baseColor: [1, 0, 0, 1],
    metallic: 0,
    roughness: 0.5,
  }),
});
world.add(geometryEntity);

ctx.frame(() => {
  renderEngine.update(world.entities);
  renderEngine.render(world.entities, cameraEntity);
});

Architecture

  • components are plain old data objects
  • data lives in components or system caches
  • systems are functions
  • systems communicate through components
  • system order is maintained by the user

API

Modules

pex-renderer
components
systems
renderer

Typedefs

Entity : object
AmbientLightComponentOptions : object
AnimationComponentOptions : object
AreaLightComponentOptions : object
AxesHelperComponentOptions : object
BoundingBoxHelperComponentOptions : object
CameraHelperComponentOptions : object
CameraView : object
CameraComponentOptions : object
DirectionalLightComponentOptions : object
GeometryComponentOptions : object
GridHelperComponentOptions : object
LightHelperComponentOptions : object
TextureTransform : object
MaterialComponentOptions : object
LineMaterialComponentOptions : object
MorphComponentOptions : object
OrbiterComponentOptions : object
PointLightComponentOptions : object
SSAOComponentOptions : object
DoFComponentOptions : object
MSAAComponentOptions : object
AAComponentOptions : object
FogComponentOptions : object
BloomComponentOptions : object
LutComponentOptions : object
ColorCorrectionComponentOptions : object
VignetteComponentOptions : object
FilmGrainComponentOptions : object
PostProcessingComponentOptions : object
ReflectionProbeComponentOptions : object
SkinComponentOptions : object
SkyboxComponentOptions : object
SpotLightComponentOptions : object
TransformComponentOptions : object
VertexHelperComponentOptions : object
SystemOptions : object
SystemUpdate : function
SystemDispose : function
System : object
RenderEngineOptions
RenderEngineRender : function
RenderEngineDebug : function
RenderEngine : System
RendererSystemRender : function
RendererSystemStageOptions : object
RendererSystemStage : function
RendererSystem : object
WorldAdd : function
WorldAddSystem : function
WorldUpdate : function
World : object
RenderGraph : object
ResourceCacheUsage : "Transient" | "Retained"
ResourceCache : object
RenderView : object

pex-renderer

pex-renderer.components : components

All components as a function returning a component with default values.

Kind: static property of pex-renderer

pex-renderer.systems : systems

All systems as a function returning a system with a type property and an update function.

Kind: static property of pex-renderer

pex-renderer.world() ⇒ World

Create a world object to store entities and systems

Kind: static method of pex-renderer

pex-renderer.entity([components]) ⇒ Entity

Create an entity from an object of plain data components

Kind: static method of pex-renderer

ParamTypeDefault
[components]object{}

pex-renderer.renderEngine() ⇒ RenderEngine

Create a render engine eg. a collection of systems for default rendering

Kind: static method of pex-renderer

pex-renderer.renderGraph(ctx) ⇒ RenderGraph

Create a render graph for rendering passes

Kind: static method of pex-renderer

ParamType
ctxmodule:pex-context/types/index.js

pex-renderer.resourceCache(ctx) ⇒ ResourceCache

Create a resource cache for pex-context caching.

Kind: static method of pex-renderer

ParamType
ctxmodule:pex-context/types/index.js

components

components.ambientLight([options]) ⇒ object

Ambient light component

Kind: static method of components

ParamType
[options]AmbientLightComponentOptions

components.animation([options]) ⇒ object

Animation component

Kind: static method of components

ParamType
[options]AnimationComponentOptions

components.areaLight([options]) ⇒ object

Area light component

Kind: static method of components

ParamType
[options]AreaLightComponentOptions

components.axesHelper([options]) ⇒ object

Axes helper component

Kind: static method of components

ParamType
[options]AxesHelperComponentOptions

components.boundingBoxHelper([options]) ⇒ object

Bounding box helper component

Kind: static method of components

ParamType
[options]BoundingBoxHelperComponentOptions

components.cameraHelper([options]) ⇒ object

Camera helper component

Kind: static method of components

ParamType
[options]CameraHelperComponentOptions

components.camera([options]) ⇒ object

Camera component

Kind: static method of components

ParamType
[options]CameraComponentOptions

components.directionalLight([options]) ⇒ object

Directional light component

Kind: static method of components

ParamType
[options]DirectionalLightComponentOptions

components.geometry([options]) ⇒ object

Geometry component

Kind: static method of components

ParamType
[options]GeometryComponentOptions

components.gridHelper([options]) ⇒ object

Grid helper component

Kind: static method of components

ParamType
[options]GridHelperComponentOptions

components.lightHelper([options]) ⇒ object

Light helper component

Kind: static method of components

ParamType
[options]LightHelperComponentOptions

components.material([options]) ⇒ object

Material component

Kind: static method of components

ParamType
[options]MaterialComponentOptions | LineMaterialComponentOptions

components.morph(options) ⇒ object

Morph component

Kind: static method of components

ParamType
optionsMorphComponentOptions

components.orbiter(options) ⇒ object

Orbiter component

Kind: static method of components

ParamType
optionsOrbiterComponentOptions

components.pointLight([options]) ⇒ object

Point light component

Kind: static method of components

ParamType
[options]PointLightComponentOptions

components.postProcessing([options]) ⇒ object

Post Processing component

Kind: static method of components

ParamType
[options]PostProcessingComponentOptions

postProcessing.ssao([options]) ⇒ object

Post Processing SSAO subcomponent

Kind: static method of postProcessing

ParamType
[options]SSAOComponentOptions

postProcessing.dof([options]) ⇒ object

Post Processing DoF subcomponent

Kind: static method of postProcessing

ParamType
[options]DoFComponentOptions

postProcessing.msaa([options]) ⇒ object

Post Processing MSAA subcomponent

Kind: static method of postProcessing

ParamType
[options]MSAAComponentOptions

postProcessing.aa([options]) ⇒ object

Post Processing AA subcomponent

Kind: static method of postProcessing

ParamType
[options]AAComponentOptions

postProcessing.fog([options]) ⇒ object

Post Processing Fog subcomponent

Kind: static method of postProcessing

ParamType
[options]FogComponentOptions

postProcessing.bloom([options]) ⇒ object

Post Processing Bloom subcomponent

Kind: static method of postProcessing

ParamType
[options]BloomComponentOptions

postProcessing.lut([options]) ⇒ object

Post Processing LUT subcomponent

Kind: static method of postProcessing

ParamType
[options]LutComponentOptions

postProcessing.colorCorrection([options]) ⇒ object

Post Processing Color Correction subcomponent

Kind: static method of postProcessing

ParamType
[options]ColorCorrectionComponentOptions

postProcessing.vignette([options]) ⇒ object

Post Processing Vignette subcomponent

Kind: static method of postProcessing

ParamType
[options]VignetteComponentOptions

postProcessing.filmGrain([options]) ⇒ object

Post Processing Film Grain subcomponent

Kind: static method of postProcessing

ParamType
[options]FilmGrainComponentOptions

components.reflectionProbe([options]) ⇒ object

Reflection probe component

Kind: static method of components

ParamType
[options]ReflectionProbeComponentOptions

components.skin([options]) ⇒ object

Skin component

Kind: static method of components

ParamType
[options]SkinComponentOptions

components.skybox([options]) ⇒ object

Skybox component

Kind: static method of components

ParamType
[options]SkyboxComponentOptions

components.spotLight([options]) ⇒ object

Spot light component

Kind: static method of components

ParamType
[options]SpotLightComponentOptions

components.transform([options]) ⇒ object

Transform component

Kind: static method of components

ParamType
[options]TransformComponentOptions

components.vertexHelper([options]) ⇒ object

Vertex helper component

Kind: static method of components

ParamType
[options]VertexHelperComponentOptions

systems

systems.renderer : renderer

All renderer systems

Kind: static property of systems

systems.animation() ⇒ System

Animation system

Kind: static method of systems

systems.camera() ⇒ System

Camera system

Adds:

  • "_orbiter" to orbiter components

Kind: static method of systems

systems.geometry(options) ⇒ System

Geometry system

Adds:

  • "bounds" to geometry components
  • "dirty" to geometry components properties
  • "_geometry" to entities as reference to internal cache

Kind: static method of systems

ParamType
optionsSystemOptions

systems.layer() ⇒ System

Layer system

Kind: static method of systems

systems.light() ⇒ System

Light system

Adds:

  • "_projectionMatrix" and "_viewMatrix" to light components
  • "_direction" to directional and spot light components

Kind: static method of systems

systems.morph() ⇒ System

Morph system

Kind: static method of systems

systems.reflectionProbe(options) ⇒ System

Reflection Probe system

Adds:

  • "_reflectionProbe" to reflectionProbe components

Kind: static method of systems

ParamType
optionsSystemOptions

systems.skin() ⇒ System

Skin system

Kind: static method of systems

systems.skybox(options) ⇒ System

Skybox system

Adds:

  • "_skyTexture" to skybox components with no envMap for skybox-renderer to render
  • "_skyTextureChanged" to skybox components for reflection-probe system

Kind: static method of systems

ParamType
optionsSystemOptions

systems.transform() ⇒ System

Transform system

Adds:

  • "worldBounds", "dirty" and "aabbDirty" to transform components
  • "_transform" to entities as reference to internal cache

Kind: static method of systems

systems.renderPipeline(options) ⇒ System

Render pipeline system

Adds:

  • "_near", "_far", "_radiusUV" and "_sceneBboxInLightSpace" to light components that cast shadows
  • "_shadowCubemap" to pointLight components and "_shadowMap" to other light components
  • "_targets" to postProcessing components

Kind: static method of systems

ParamType
optionsSystemOptions

renderer

renderer.base() ⇒ RendererSystem

Base renderer

All renderers are composed with it.

Kind: static method of renderer

renderer.basic(options) ⇒ RendererSystem

Basic renderer

Kind: static method of renderer

ParamType
optionsSystemOptions

renderer.helper(options) ⇒ RendererSystem

Helper renderer

Kind: static method of renderer

ParamType
optionsSystemOptions

renderer.line(options) ⇒ RendererSystem

Line renderer

Kind: static method of renderer

ParamType
optionsSystemOptions

renderer.skybox(options) ⇒ RendererSystem

Skybox renderer

Renders a skybox (envMap or _skyTexture) to screen or to reflection probes.

Kind: static method of renderer

ParamType
optionsSystemOptions

renderer.standard(options) ⇒ RendererSystem

Standard renderer

Kind: static method of renderer

ParamType
optionsSystemOptions

Entity : object

Kind: global typedef Properties

NameType
idnumber
[ambientLight]AmbientLightComponentOptions
[animation]AnimationComponentOptions | Array.<AnimationComponentOptions>
[areaLight]AreaLightComponentOptions
[axesHelper]AxesHelperComponentOptions
[boundingBoxHelper]BoundingBoxHelperComponentOptions
[cameraHelper]CameraHelperComponentOptions
[camera]CameraComponentOptions
[directionalLight]DirectionalLightComponentOptions
[geometry]GeometryComponentOptions
[gridHelper]GridHelperComponentOptions
[lightHelper]LightHelperComponentOptions
[material]MaterialComponentOptions
[morph]MorphComponentOptions
[orbiter]OrbiterComponentOptions
[pointLight]PointLightComponentOptions
[postProcessing]PostProcessingComponentOptions
[reflectionProbe]ReflectionProbeComponentOptions
[skin]SkinComponentOptions
[skybox]SkyboxComponentOptions
[spotLight]SpotLightComponentOptions
[transform]TransformComponentOptions
[vertexHelper]VertexHelperComponentOptions

AmbientLightComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 1, 1, 1]
[intensity]number1

AnimationComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[playing]booleanfalse
[loop]booleanfalse
[time]number0
[channels]Array[]

AreaLightComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 1, 1, 1]
[intensity]number1
[disk]booleanfalse
[doubleSided]booleanfalse
[bias]number0.1
[bulbRadius]number1
[castShadows]booleantrue
[shadowMapSize]number2048

AxesHelperComponentOptions : object

Kind: global typedef

BoundingBoxHelperComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 0, 0, 1]

CameraHelperComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 1, 1, 1]

CameraView : object

Kind: global typedef Properties

NameType
[totalSize]Array.<number>
[size]Array.<number>
[offset]Array.<number>

CameraComponentOptions : object

Kind: global typedef Properties

NameTypeDefaultDescription
[projection]"perspective" | "orthographic""perspective"
[near]number0.5
[far]number1000
[aspect]number1
[clearColor]module:pex-color~color
[viewMatrix]mat4
[invViewMatrix]mat4
[culling]booleanfalse
[exposure]number1
[toneMap]"aces" | "agx" | "filmic" | "lottes" | "neutral" | "reinhard" | "reinhard2" | "uchimura" | "uncharted2" | "unreal""aces"
[outputEncoding]numberctx.Encoding.Gamma
[focalLength]number50Focal length of the camera lens [10mm - 200mm] in mm
[fStop]number2.8Ratio of camera lens opening, f-number, f/N, aperture [1.2 - 32] in mm
[sensorSize]number[36, 24]Physical camera sensor or film size [sensorWidth, sensorHeight] in mm
sensorFit"vertical" | "horizontal" | "fit" | "overscan" | "vertical"Matching of camera frame to sensor frame
[view]CameraView
[fov]numberMath.PI / 4
[left]number-1
[right]number1
[bottom]number-1
[top]number1
[zoom]number1

DirectionalLightComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 1, 1, 1]
[intensity]number1
[bias]number0.1
[bulbRadius]number1
[castShadows]booleantrue
[shadowMapSize]number2048

GeometryComponentOptions : object

Kind: global typedef Properties

NameTypeDefaultDescription
[positions]Float32Array
[normals]Float32Array
[uvs]Float32ArrayAlias: texCoords/texCoords0
[uvs1]Float32ArrayAlias: texCoords1
[vertexColors]Float32Array
[cells]Uint16Array | Uint32Array
[weights]Float32Array
[joints]Float32Array
[offsets]Float32ArrayInstanced
[rotations]Float32ArrayInstanced
[scales]Float32ArrayInstanced
[colors]Float32ArrayInstanced
[count]number
[multiDraw]object
[culled]boolean
[primitive]ctx.Primitivectx.Primitive.Triangles

GridHelperComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 1, 1, 1]
[size]Array.<number>10

LightHelperComponentOptions : object

Kind: global typedef

TextureTransform : object

Kind: global typedef Properties

NameTypeDescription
[offset]Array.<number>[x, y]
[rotation]numberangle in radians
[scales]Array.<number>[x, y]

MaterialComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[unlit]boolean
[type]undefined | "line""undefined"
[baseColor]Array.<number>[1, 1, 1, 1]
[emissiveColor]Array.<number>"undefined"
[emissiveIntensity]number1
[metallic]number1
[roughness]number1
[ior]number
[specular]number
[specularTexture]ctx.texture2D | TextureTransform
[specularColor]Array.<number>[1, 1, 1]
[specularColorTexture]ctx.texture2D | TextureTransform
[baseColorTexture]ctx.texture2D | TextureTransform
[emissiveColorTexture]ctx.texture2D | TextureTransform
[normalTexture]ctx.texture2D | TextureTransform
[normalTextureScale]number1
[roughnessTexture]ctx.texture2D | TextureTransform
[metallicTexture]ctx.texture2D | TextureTransform
[metallicRoughnessTexture]ctx.texture2D | TextureTransform
[occlusionTexture]ctx.texture2D | TextureTransform
[clearCoat]number
[clearCoatRoughness]number
[clearCoatTexture]ctx.texture2D | TextureTransform
[clearCoatRoughnessTexture]ctx.texture2D | TextureTransform
[clearCoatNormalTexture]ctx.texture2D | TextureTransform
[clearCoatNormalTextureScale]number
[sheenColor]Array.<number>
[sheenRoughness]number
[transmission]number
[transmissionTexture]ctx.texture2D | TextureTransform
[dispersion]number
[diffuseTransmission]number
[diffuseTransmissionTexture]ctx.texture2D | TextureTransform
[diffuseTransmissionColor]number[1, 1, 1]
[diffuseTransmissionColorTexture]ctx.texture2D | TextureTransform
[thickness]number
[thicknessTexture]ctx.texture2D | TextureTransform
[attenuationDistance]number
[attenuationColor]Array.<number>
[alphaTest]number"undefined"
[alphaTexture]ctx.texture2D | TextureTransform
[depthTest]booleantrue
[depthWrite]booleantrue
[depthFunc]ctx.DepthFuncctx.DepthFunc.Less
[blend]booleanfalse
[blendSrcRGBFactor]ctx.BlendFactor"undefined"
[blendSrcAlphaFactor]ctx.BlendFactor"undefined"
[blendDstRGBFactor]ctx.BlendFactor"undefined"
[blendDstAlphaFactor]ctx.BlendFactor"undefined"
[cullFace]booleantrue
[cullFaceMode]ctx.Facectx.Face.Back
[pointSize]number1
[castShadows]booleanfalse
[receiveShadows]booleanfalse

LineMaterialComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[type]"line""line"
[baseColor]Array.<number>[1, 1, 1, 1]
[lineWidth]number1
[lineResolution]number16

MorphComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
sourcesobject
targetsobject
[current]object
[weights]Array[]

OrbiterComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[element]HTMLElementdocument.body
[target]Array.<number>[0, 0, 0]
[lat]number0
[lon]number0
[distance]number0

PointLightComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 1, 1, 1]
[intensity]number1
[range]number10
[bulbRadius]number1
[castShadows]booleantrue
[shadowMapSize]number2048

SSAOComponentOptions : object

Kind: global typedef Properties

NameTypeDefaultDescription
[type]"sao" | "gtao""sao"
[noiseTexture]booleantrue
[mix]number1
[samples]number"gtao" ? 6 : 11
[intensity]number2.2
[radius]number0.5meters
[blurRadius]number0.5
[blurSharpness]number10
[brightness]number0
[contrast]number1// SSAO
[bias]number0.001centimeters
[spiralTurns]number7// GTAO
[slices]number3
[colorBounce]numbertrue
[colorBounceIntensity]number1.0

DoFComponentOptions : object

Kind: global typedef Properties

NameTypeDefaultDescription
[type]"gustafsson" | "upitis""gustafsson"Gustafsson uses a spiral pattern while Upitis uses a circular one.
[physical]booleantrueUse camera f-stop and focal length
[focusDistance]number7The point to focus on in meters.
[focusScale]number1Non physically based value for artistic control when physical is false, otherwise act as an fStop divider. Larger aperture (ie, smaller f-stop) or larger focal length (smaller fov) = smaller depth of field = more blur.
[focusOnScreenPoint]booleanfalseRead the depth buffer to find the first intersecting object to focus on instead of a fixed focus distance.
[screenPoint]Array.<number>[0.5, 0.5]The normalized screen point to focus on when "focusOnScreenPoint" is true.
[chromaticAberration]number0.7Amount of RGB separation
[luminanceThreshold]number0.7Threshold for out of focus hightlights
[luminanceGain]number1Gain for out of focus hightlights
[samples]number6Iteration steps. More steps means better blur but also degraded performances.
[shape]"disk" | "pentagon""disk"The bokeh shape for type "upitis".
[debug]booleanfalse

MSAAComponentOptions : object

Kind: global typedef Properties

NameTypeDefaultDescription
[sampleCount]number4Multisample anti-aliasing samples: 1 or 4.

AAComponentOptions : object

Kind: global typedef Properties

NameTypeDefaultDescription
[subPixelQuality]number0.75Higher = softer. Helps mitigate fireflies but will blur small details.
[quality]number2For edge luma threshold: 0 to 4.

FogComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[0.5, 0.5, 0.5]
[start]number5
[density]number0.15
[sunPosition]Array.<number>[1, 1, 1]
[sunDispertion]number0.2
[sunIntensity]number0.1
[sunColor]Array.<number>[0.98, 0.98, 0.7]
[inscatteringCoeffs]Array.<number>[0.3, 0.3, 0.3]

BloomComponentOptions : object

Kind: global typedef Properties

NameTypeDefaultDescription
[quality]number1The bloom quality: 0 or 1 (0 is faster but flickers)
[colorFunction]"luma" | "luminance" | "average""luma"The function used to determine the brightness of a pixel for the threshold.
[threshold]number1The brightness value at which pixels are filtered out for the threshold.
[source]"color" | "emissive""color"The source texture for the threshold.
[intensity]number0.1The strength of the bloom effect.
[radius]number1The downsampling radius which controls how much glare gets blended in.

LutComponentOptions : object

Kind: global typedef Properties

NameType
texturectx.texture2D

ColorCorrectionComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[brightness]number0
[contrast]number1
[saturation]number1
[hue]number0

VignetteComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[radius]number0.8
[intensity]number0.2

FilmGrainComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[quality]number2
[size]number1.6
[intensity]number0.05
[colorIntensity]number0.6
[luminanceIntensity]number1
[speed]number0.5

PostProcessingComponentOptions : object

Kind: global typedef Properties

NameType
[ssao]SSAOComponentOptions
[dof]DoFComponentOptions
[aa]AAComponentOptions
[fog]FogComponentOptions
[bloom]BloomComponentOptions
[lut]LutComponentOptions
[colorCorrection]ColorCorrectionComponentOptions
[vignette]VignetteComponentOptions
[filmGrain]FilmGrainComponentOptions
opacitynumber

ReflectionProbeComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[size]number1024

SkinComponentOptions : object

Kind: global typedef

SkyboxComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[sunPosition]Array.<number>
[envMap]ctx.texture2D
[backgroundBlur]booleanfalse
[exposure]number1
[turbidity]number10
[rayleigh]number2
[mieCoefficient]number0.005
[mieDirectionalG]number0.8

SpotLightComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[1, 1, 1, 1]
[intensity]number1
[angle]numberMath.PI / 4
[innerAngle]number0
[range]number10
[bias]number0.1
[bulbRadius]number1
[castShadows]booleantrue
[shadowMapSize]number2048

TransformComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[position]Array.<number>[0, 0, 0]
[rotation]Array.<number>[0, 0, 0, 1]
[scale]Array.<number>[1, 1, 1]

VertexHelperComponentOptions : object

Kind: global typedef Properties

NameTypeDefault
[color]Array.<number>[0, 1, 0, 1]
[size]Array.<number>1
[attribute]string"&quot;normals&quot;"

SystemOptions : object

Kind: global typedef Properties

NameType
ctxmodule:pex-context/types/index.js
[resourceCache]ResourceCache
[renderGraph]RenderGraph

SystemUpdate : function

Kind: global typedef

ParamType
entitiesArray.<Entity>
[deltaTime]number

SystemDispose : function

Kind: global typedef

ParamType
entitiesArray.<Entity>

System : object

Kind: global typedef Properties

NameType
typestring
cacheobject
debugboolean
updateSystemUpdate
disposeSystemDispose

RenderEngineOptions

Kind: global typedef Properties

NameType
widthnumber
heightnumber
renderersArray.<System>
drawToScreenboolean

RenderEngineRender : function

Kind: global typedef

ParamTypeDefault
entitiesArray.<Entity>
cameraEntitiesArray.<Entity>
[options]RenderEngineOptions{}

RenderEngineDebug : function

Kind: global typedef

ParamType
enableboolean

RenderEngine : System

Kind: global typedef Properties

NameType
renderRenderEngineRender
debugRenderEngineDebug
systemsArray.<System>
renderersArray.<System>

RendererSystemRender : function

Kind: global typedef

ParamTypeDefault
renderViewRenderView
entitiesEntity | Array.<Entity>
[options]object{}

RendererSystemStageOptions : object

Kind: global typedef Properties

NameType
[attachmentsLocations]object
[shadowMappingLight]object
[backgroundColorTexture]ctx.texture2D
[renderingToReflectionProbe]boolean

RendererSystemStage : function

Kind: global typedef

ParamType
renderViewArray.<RenderView>
entitiesArray.<Entity>
optionsRendererSystemStageOptions

RendererSystem : object

Kind: global typedef Properties

NameType
typestring
cacheobject
debugboolean
flagDefinitionsArray.<Array>
updateSystemUpdate
disposeSystemDispose
renderRendererSystemRender
[renderBackground]RendererSystemStage
[renderShadow]RendererSystemStage
[renderOpaque]RendererSystemStage
[renderTransparent]RendererSystemStage
[renderPost]RendererSystemStage

WorldAdd : function

Kind: global typedef

ParamType
entityEntity

WorldAddSystem : function

Kind: global typedef

ParamType
systemSystem

WorldUpdate : function

Kind: global typedef

ParamType
[deltaTime]number

World : object

Kind: global typedef Properties

NameType
entitiesArray.<object>
systemsArray.<object>
addWorldAdd
addSystemWorldAddSystem
updateWorldUpdate

RenderGraph : object

Kind: global typedef Properties

NameType
renderPassesArray.<object>
beginFramefunction
renderPassfunction
endFramefunction

ResourceCacheUsage : "Transient" | "Retained"

Kind: global typedef

ResourceCache : object

Kind: global typedef Properties

NameType
beginFramefunction
endFramefunction
disposefunction
UsageResourceCacheUsage

RenderView : object

Kind: global typedef Properties

NameType
cameraobject
cameraEntityEntity
viewportmodule:pex-context/types/types~Viewport
[exposure]object
[outputEncoding]object

License

MIT. See license file.