Class PostProcessEffect
Custom PostFx which can modify final image by processing it with material based filters. The base class for all post process effects used by the graphics pipeline. Allows to extend frame rendering logic and apply custom effects such as outline, night vision, contrast etc.
Override this class and implement custom post fx logic. Use MainRenderTask.Instance.AddCustomPostFx(myPostFx) to attach your script to rendering or add script to camera actor.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Graphics/PostProcessEffect.h
Syntax
public class PostProcessEffect : public Script
Fields
Location
Effect rendering location within rendering pipeline.
Declaration
public PostProcessEffectLocation Location = PostProcessEffectLocation::Default
Field Value
PostProcessEffectLocation
|
Order
Effect rendering order. Post effects are sorted before rendering (from the lowest order to the highest order).
Declaration
public int32 Order = 0
Field Value
int32
|
UseSingleTarget
True whether use a single render target as both input and output. Use this if your effect doesn't need to copy the input buffer to the output but can render directly to the single texture. Can be used to optimize game performance.
Declaration
public bool UseSingleTarget = false
Field Value
bool
|
Methods
CanRender()
Gets a value indicating whether this effect can be rendered.
Declaration
public virtual bool CanRender() const
Returns
bool
|
CanRender(const RenderContext& renderContext)
Gets a value indicating whether this effect can be rendered.
Declaration
public virtual bool CanRender(const RenderContext& renderContext) const
Parameters
RenderContext
renderContext
The target render context. |
Returns
bool
|
PreRender(GPUContext* context, RenderContext& renderContext)
Pre-rendering event called before scene rendering begin. Can be used to perform custom rendering or customize render view/setup.
Declaration
public virtual void PreRender(GPUContext* context, RenderContext& renderContext)
Parameters
GPUContext
context
|
RenderContext
renderContext
|
Render(GPUContext* context, RenderContext& renderContext, GPUTexture* input, GPUTexture* output)
Performs custom postFx rendering.
Declaration
public virtual void Render(GPUContext* context, RenderContext& renderContext, GPUTexture* input, GPUTexture* output)
Parameters
GPUContext
context
The GPU commands context. |
RenderContext
renderContext
The rendering context. |
GPUTexture
input
The input texture. |
GPUTexture
output
The output texture. |