CLASSES
TagsA - Z

RenderingGroup

Description

class RenderingGroup

Constructor

new RenderingGroup(index, scene, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn)

Creates a new rendering group.

Parameters

Name Type Description
index number The rendering group index The rendering group index @param index
scene Scene @param scene
optional opaqueSortCompareFn (a: SubMesh, b: SubMesh) => number The opaque sort comparison function. If null no order is applied The opaque sort comparison function. If null no order is applied
optional alphaTestSortCompareFn (a: SubMesh, b: SubMesh) => number The alpha test sort comparison function. If null no order is applied The alpha test sort comparison function. If null no order is applied

Members

index : number

onBeforeTransparentRendering : () => void

opaqueSortCompareFn : (a: SubMesh, b: SubMesh) => number

Set the opaque sort comparison function.

If null the sub meshes will be render in the order they were created

alphaTestSortCompareFn : (a: SubMesh, b: SubMesh) => number

Set the alpha test sort comparison function.

If null the sub meshes will be render in the order they were created

transparentSortCompareFn : (a: SubMesh, b: SubMesh) => number

Set the transparent sort comparison function.

If null the sub meshes will be render in the order they were created

Methods

render(customRenderFunction, renderSprites, renderParticles, activeMeshes) void

Render all the sub meshes contained in the group.

@returns true if rendered some submeshes.

Parameters

Name Type Description
customRenderFunction (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void Used to override the default render behaviour of the group. Used to override the default render behaviour of the group.
renderSprites boolean
renderParticles boolean

static defaultTransparentSortCompare(a, b) number

Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)

are rendered back to front if in the same alpha index.

     * @param a The first submesh

@returns The result of the comparison

Parameters

Name Type Description
a SubMesh The first submesh The first submesh
b SubMesh The second submesh The second submesh

static backToFrontSortCompare(a, b) number

Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)

are rendered back to front.

     * @param a The first submesh

@returns The result of the comparison

Parameters

Name Type Description
a SubMesh The first submesh The first submesh
b SubMesh The second submesh The second submesh

static frontToBackSortCompare(a, b) number

Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)

are rendered front to back (prevent overdraw).

     * @param a The first submesh

@returns The result of the comparison

Parameters

Name Type Description
a SubMesh The first submesh The first submesh
b SubMesh The second submesh The second submesh

prepare() void

Resets the different lists of submeshes to prepare a new frame.

dispose() void

dispatch(subMesh) void

Inserts the submesh in its correct queue depending on its material.

Parameters

Name Type Description
subMesh SubMesh The submesh to dispatch The submesh to dispatch @param subMesh

dispatchSprites(spriteManager) void

Parameters

Name Type Description
spriteManager SpriteManager

dispatchParticles(particleSystem) void

Parameters

Name Type Description
particleSystem ParticleSystem