Class GeometryBufferRenderer
Hierarchy
- GeometryBufferRenderer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Creates a new G Buffer for the scene
Parameters
scene: Scene
The scene the buffer belongs to
Optional ratio: number
How big is the buffer related to the main canvas (default: 1)
Optional depthFormat: number
Format of the depth texture (default: Constants.TEXTUREFORMAT_DEPTH16)
Returns GeometryBufferRenderer
Properties
excluded Skinned Meshes From VelocitySearch playground for excludedSkinnedMeshesFromVelocity
Array used to store the ignored skinned meshes while computing velocity map (typically used by the motion blur post-process). Avoids computing bones velocities and computes only mesh's velocity itself (position, rotation, scaling).
render Transparent MeshesSearch playground for renderTransparentMeshes
Gets or sets a boolean indicating if transparent meshes should be rendered
Static Readonly DEPTH_ TEXTURE_ TYPESearch playground for DEPTH_TEXTURE_TYPE
Constant used to retrieve the depth texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.DEPTH_TEXTURE_INDEX)
Static Readonly NORMAL_ TEXTURE_ TYPESearch playground for NORMAL_TEXTURE_TYPE
Constant used to retrieve the normal texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.NORMAL_TEXTURE_INDEX)
Static Readonly POSITION_ TEXTURE_ TYPESearch playground for POSITION_TEXTURE_TYPE
Constant used to retrieve the position texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.POSITION_TEXTURE_INDEX)
Static Readonly REFLECTIVITY_ TEXTURE_ TYPESearch playground for REFLECTIVITY_TEXTURE_TYPE
Constant used to retrieve the reflectivity texture index in the G-Buffer textures array using the getIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE)
Static Readonly VELOCITY_ TEXTURE_ TYPESearch playground for VELOCITY_TEXTURE_TYPE
Constant used to retrieve the velocity texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.VELOCITY_TEXTURE_INDEX)
Accessors
enable Position
Gets a boolean indicating if objects positions are enabled for the G buffer.
Returns boolean
Sets whether or not objects positions are enabled for the G buffer.
Parameters
enable: boolean
Returns void
enable Reflectivity
Gets a boolean indicating if objects reflectivity are enabled in the G buffer.
Returns boolean
Sets whether or not objects reflectivity are enabled for the G buffer. For Metallic-Roughness workflow with ORM texture, we assume that ORM texture is defined according to the default layout: pbr.useRoughnessFromMetallicTextureAlpha = false; pbr.useRoughnessFromMetallicTextureGreen = true; pbr.useMetallnessFromMetallicTextureBlue = true;
Parameters
enable: boolean
Returns void
enable Velocity
Gets a boolean indicating if objects velocities are enabled for the G buffer.
Returns boolean
Sets whether or not objects velocities are enabled for the G buffer.
Parameters
enable: boolean
Returns void
is Supported
Gets whether or not G buffer are supported by the running hardware. This requires draw buffer supports
Returns boolean
ratio
Gets the ratio used by the buffer during its creation. How big is the buffer related to the main canvas.
Returns number
render List
Gets the render list (meshes to be rendered) used in the G buffer.
Returns Nullable<AbstractMesh[]>
Set the render list (meshes to be rendered) used in the G buffer.
Parameters
meshes: Nullable<AbstractMesh[]>
Returns void
samples
Gets the number of samples used to render the buffer (anti aliasing).
Returns number
Sets the number of samples used to render the buffer (anti aliasing).
Parameters
value: number
Returns void
scene
Gets the scene associated with the buffer.
Returns Scene
Methods
disposeSearch playground for dispose
Disposes the renderer and frees up associated resources.
Returns void
getGBufferSearch playground for getGBuffer
Gets the current underlying G Buffer.
Returns MultiRenderTarget
the buffer
get Texture IndexSearch playground for getTextureIndex
Returns the index of the given texture type in the G-Buffer textures array
Parameters
textureType: number
The texture type constant. For example GeometryBufferRenderer.POSITION_TEXTURE_INDEX
Returns number
the index of the given texture type in the G-Buffer textures array
is ReadySearch playground for isReady
Checks whether everything is ready to render a submesh to the G buffer.
Parameters
subMesh: SubMesh
the submesh to check readiness for
useInstances: boolean
is the mesh drawn using instance or not
Returns boolean
true if ready otherwise false
This renderer is helpful to fill one of the render target with a geometry buffer.