Class RenderingManager
Constructors
constructor
-
Instantiates a new rendering group for a particular scene
Parameters
- scene: Scene
Defines the scene the groups belongs to
Returns RenderingManager
- scene: Scene
Properties
StaticAUTOCLEAR
Used to globally prevent autoclearing scenes.
StaticMAX_ RENDERINGGROUPS
The max id used for rendering groups (not included)
StaticMIN_ RENDERINGGROUPS
The min id used for rendering groups (included)
Accessors
disable Depth Pre Pass
-
get disableDepthPrePass(): boolean
Specifies to disable depth pre-pass if true (default: false)
Returns boolean
-
set disableDepthPrePass(value: boolean): void
Parameters
- value: boolean
Returns void
maintain State Between Frames
-
get maintainStateBetweenFrames(): boolean
Gets or sets a boolean indicating that the manager will not reset between frames. This means that if a mesh becomes invisible or transparent it will not be visible until this boolean is set to false again. By default, the rendering manager will dispatch all active meshes per frame (moving them to the transparent, opaque or alpha testing lists). By turning this property on, you will accelerate the rendering by keeping all these lists unchanged between frames.
Returns boolean
-
set maintainStateBetweenFrames(value: boolean): void
Parameters
- value: boolean
Returns void
rendering Groups
-
get renderingGroups(): readonly RenderingGroup[]
Returns readonly RenderingGroup[]
the list of rendering groups managed by the manager.
Methods
dispatch
-
Add a submesh to the manager in order to render it this frame
Parameters
- subMesh: SubMesh
The submesh to dispatch
Optionalmesh: AbstractMeshOptional reference to the submeshes's mesh. Provide if you have an exiting reference to improve performance.
Optionalmaterial: Nullable<Material>Optional reference to the submeshes's material. Provide if you have an exiting reference to improve performance.
Returns void
- subMesh: SubMesh
dispatch Particles
-
Add a particle system to the rendering manager in order to render it this frame.
Parameters
- particleSystem: IParticleSystem
Define the particle system to render
Returns void
- particleSystem: IParticleSystem
dispatch Sprites
-
Add a sprite manager to the rendering manager in order to render it this frame.
Parameters
- spriteManager: ISpriteManager
Define the sprite manager to render
Returns void
- spriteManager: ISpriteManager
free Rendering Groups
-
Clear the info related to rendering groups preventing retention points during dispose.
Returns void
get Auto Clear Depth Stencil Setup
-
Gets the current auto clear configuration for one rendering group of the rendering manager.
Parameters
- index: number
the rendering group index to get the information for
Returns IRenderingManagerAutoClearSetup
The auto clear setup for the requested rendering group
- index: number
get Rendering Group
-
Parameters
- id: number
the id of the rendering group (0 by default)
Returns RenderingGroup
the rendering group with the specified id.
- id: number
restore Dispached Flags
-
Restore wasDispatched flags on the lists of elements to render.
Returns void
set Rendering Auto Clear Depth Stencil
-
setRenderingAutoClearDepthStencil(
renderingGroupId: number,
autoClearDepthStencil: boolean,
depth?: boolean,
stencil?: boolean,
): voidSpecifies whether or not the stencil and depth buffer are cleared between two rendering groups.
Parameters
- renderingGroupId: number
The rendering group id corresponding to its index
- autoClearDepthStencil: boolean
Automatically clears depth and stencil between groups if true.
- depth: boolean = true
Automatically clears depth between groups if true and autoClear is true.
- stencil: boolean = true
Automatically clears stencil between groups if true and autoClear is true.
Returns void
- renderingGroupId: number
set Rendering Order
-
setRenderingOrder(
renderingGroupId: number,
opaqueSortCompareFn?: Nullable<(a: SubMesh, b: SubMesh) => number>,
alphaTestSortCompareFn?: Nullable<(a: SubMesh, b: SubMesh) => number>,
transparentSortCompareFn?: Nullable<(a: SubMesh, b: SubMesh) => number>,
): voidOverrides the default sort function applied in the rendering group to prepare the meshes. This allowed control for front to back rendering or reversely depending of the special needs.
Parameters
- renderingGroupId: number
The rendering group id corresponding to its index
- opaqueSortCompareFn: Nullable<(a: SubMesh, b: SubMesh) => number> = null
The opaque queue comparison function use to sort.
- alphaTestSortCompareFn: Nullable<(a: SubMesh, b: SubMesh) => number> = null
The alpha test queue comparison function use to sort.
- transparentSortCompareFn: Nullable<(a: SubMesh, b: SubMesh) => number> = null
The transparent queue comparison function use to sort.
Returns void
- renderingGroupId: number
This is the manager responsible of all the rendering for meshes sprites and particles. It is enable to manage the different groups as well as the different necessary sort functions. This should not be used directly aside of the few static configurations