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.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public abstract class PostProcessEffect : Script, ISerializable
Remarks
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.
Constructors
PostProcessEffect()
Properties
Location
Effect rendering location within rendering pipeline.
Declaration
[EditorDisplay("Post Process Effect", null)]
[ExpandGroups]
[Unmanaged]
public PostProcessEffectLocation Location { get; set; }
Property Value
PostProcessEffectLocation
|
Order
Effect rendering order. Post effects are sorted before rendering (from the lowest order to the highest order).
Declaration
[EditorDisplay("Post Process Effect", null)]
[Unmanaged]
public int Order { get; set; }
Property Value
System.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
[EditorDisplay("Post Process Effect", null)]
[Unmanaged]
public bool UseSingleTarget { get; set; }
Property Value
System.Boolean
|
Methods
CanRender()
Gets a value indicating whether this effect can be rendered.
Declaration
[Unmanaged]
public virtual bool CanRender()
Returns
System.Boolean
|
CanRender(RenderContext)
Gets a value indicating whether this effect can be rendered.
Declaration
[Unmanaged]
public virtual bool CanRender(RenderContext renderContext)
Parameters
RenderContext
renderContext
The target render context. |
Returns
System.Boolean
|
Render(GPUContext, ref RenderContext, GPUTexture, GPUTexture)
Performs custom postFx rendering.
Declaration
[Unmanaged]
public virtual void Render(GPUContext context, ref 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. |