Class PrePassRenderer
Properties
default RT
The render target where the scene is directly rendered
disable Gamma Transform
Set to true to disable gamma transform in PrePass. Can be useful in case you already proceed to gamma transform on a material level and your post processes don't need to be in linear color space.
do Not Use Geometry Renderer Fallback
Prevents the PrePassRenderer from using the GeometryBufferRenderer as a fallback
excluded Materials
Force material to be excluded from the prepass
Can be useful when useGeometryBufferFallback is set to true
and you don't want a material to show in the effect.
excluded Skinned Mesh
To save performance, we can excluded skinned meshes from the prepass
mrt Count
Number of textures in the multi render target texture where the scene is directly rendered
render Targets
All the render targets generated by prepass
StaticTexture Formats
Describes the types and formats of the textures used by the pre-pass renderer
Accessors
current R Tis Scene RT
-
get currentRTisSceneRT(): boolean
Returns true if the currently rendered prePassRenderTarget is the one associated with the scene.
Returns boolean
enabled
-
get enabled(): boolean
Indicates if the prepass is enabled
Returns boolean
generate Normals In World Space
-
get generateNormalsInWorldSpace(): boolean
Indicates if the prepass renderer is generating normals in world space or camera space (default: camera space)
Returns boolean
-
set generateNormalsInWorldSpace(value: boolean): void
Parameters
- value: boolean
Returns void
is Supported
-
get isSupported(): boolean
Indicates if rendering a prepass is supported
Returns boolean
samples
-
get samples(): number
How many samples are used for MSAA of the scene render target
Returns number
-
set samples(n: number): void
Parameters
- n: number
Returns void
use Specific Clear For Depth Texture
-
get useSpecificClearForDepthTexture(): boolean
If set to true (default: false), the depth texture will be cleared with the depth value corresponding to the far plane (1 in normal mode, 0 in reverse depth buffer mode) If set to false, the depth texture is always cleared with 0.
Returns boolean
-
set useSpecificClearForDepthTexture(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
add Effect Configuration
-
Adds an effect configuration to the prepass render target. If an effect has already been added, it won't add it twice and will return the configuration already present.
Parameters
- cfg: PrePassEffectConfiguration
the effect configuration
Returns PrePassEffectConfiguration
the effect configuration now used by the prepass
- cfg: PrePassEffectConfiguration
bind Attachments For Effect
dispose
-
Disposes the prepass renderer.
Returns void
get Effect Configuration
-
Retrieves an effect configuration by name
Parameters
- name: string
the name of the effect configuration
Returns Nullable<PrePassEffectConfiguration>
the effect configuration, or null if not present
- name: string
get Index
-
Returns the index of a texture in the multi render target texture array.
Parameters
- type: number
Texture type
Returns number
The index
- type: number
get Render Target
-
Returns PrePassRenderTarget
the prepass render target for the rendering pass. If we are currently rendering a render target, it returns the PrePassRenderTarget associated with that render target. Otherwise, it returns the scene default PrePassRenderTarget
mark As Dirty
-
Marks the prepass renderer as dirty, triggering a check if the prepass is necessary for the next rendering.
Returns void
restore Attachments
-
Restores attachments for single texture draw.
Returns void
set Custom Output
-
Sets an intermediary texture between prepass and postprocesses. This texture will be used as input for post processes
Parameters
- rt: RenderTargetTexture
The render target texture to use
Returns boolean
true if there are postprocesses that will use this texture, false if there is no postprocesses - and the function has no effect
- rt: RenderTargetTexture
update
-
Makes sure that the prepass renderer is up to date if it has been dirtified.
Returns void
Renders a pre pass of the scene This means every mesh in the scene will be rendered to a render target texture And then this texture will be composited to the rendering canvas with post processes It is necessary for effects like subsurface scattering or deferred shading