RenderingManager

Description

class RenderingManager

Constructor

new RenderingManager(scene)

Parameters

Name Type Description
scene Scene

Members

static MAX_RENDERINGGROUPS : number

The max id used for rendering groups (not included)

static MIN_RENDERINGGROUPS : number

The min id used for rendering groups (included)

static AUTOCLEAR : boolean

Used to globally prevent autoclearing scenes.

Methods

render(customRenderFunction, activeMeshes, renderParticles, renderSprites) void

Parameters

Name Type Description
customRenderFunction Nullable<(opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>, depthOnlySubMeshes: SmartArray<SubMesh>) => void>
activeMeshes Nullable<AbstractMesh[]>
renderParticles boolean

reset() void

dispose() void

dispatchSprites(spriteManager) void

Parameters

Name Type Description
spriteManager SpriteManager

dispatchParticles(particleSystem) void

Parameters

Name Type Description
particleSystem IParticleSystem

dispatch(subMesh) void

Parameters

Name Type Description
subMesh SubMesh

setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) void

Overrides the default sort function applied in the renderging group to prepare the meshes.

This allowed control for front to back rendering or reversly depending of the special needs.

     * @param renderingGroupId The rendering group id corresponding to its index

Parameters

Name Type Description
renderingGroupId number The rendering group id corresponding to its index
optional opaqueSortCompareFn Nullable<(a: SubMesh, b: SubMesh) => number> The opaque queue comparison function use to sort.
optional alphaTestSortCompareFn Nullable<(a: SubMesh, b: SubMesh) => number> The alpha test queue comparison function use to sort.

setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth, stencil) void

Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.

     * @param renderingGroupId The rendering group id corresponding to its index

Parameters

Name Type Description
renderingGroupId number The rendering group id corresponding to its index
autoClearDepthStencil boolean Automatically clears depth and stencil between groups if true.
optional depth boolean Automatically clears depth between groups if true and autoClear is true.