Class RenderTask
Allows to perform custom rendering using graphics pipeline.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Graphics/RenderTask.h
Syntax
public class RenderTask : public ScriptingObject
Constructors
~RenderTask()
Fields
Begin
Action fired on task rendering begin.
Declaration
public Delegate<RenderTask* , GPUContext* > Begin
Field Value
Delegate<RenderTask , GPUContext >
|
Enabled
Gets or sets a value indicating whether task is enabled.
Declaration
public bool Enabled = true
Field Value
bool
|
End
Action fired on task rendering end.
Declaration
public Delegate<RenderTask* , GPUContext* > End
Field Value
Delegate<RenderTask , GPUContext >
|
FrameCount
The amount of frames rendered by this task. It is auto incremented on task drawing.
Declaration
public int32 FrameCount = 0
Field Value
int32
|
LastUsedFrame
The index of the frame when this task was last time rendered.
Declaration
public uint64 LastUsedFrame = 0
Field Value
uint64
|
Order
The order of the task. Used for tasks rendering order. Lower first, higher later.
Declaration
public int32 Order = 0
Field Value
int32
|
Present
Action fired just after frame present.
Declaration
public Delegate<RenderTask* > Present
Field Value
Delegate<RenderTask >
|
Render
Action fired on task rendering.
Declaration
public Delegate<RenderTask* , GPUContext* > Render
Field Value
Delegate<RenderTask , GPUContext >
|
SwapChain
The output window swap chain. Optional, used only when rendering to native window backbuffer.
Declaration
public GPUSwapChain* SwapChain = nullptr
Field Value
GPUSwapChain
|
Methods
CanDraw()
Determines whether this task can be rendered.
Declaration
public virtual bool CanDraw() const
Returns
bool
|
OnBegin(GPUContext* context)
Called on task rendering begin.
Declaration
public virtual void OnBegin(GPUContext* context)
Parameters
GPUContext
context
The GPU context. |
OnDraw()
Called by graphics device to draw this task.
Declaration
public virtual void OnDraw()
OnEnd(GPUContext* context)
Called on task rendering end.
Declaration
public virtual void OnEnd(GPUContext* context)
Parameters
GPUContext
context
The GPU context. |
OnIdle()
Called by graphics device to idle task that has not been selected for drawing this frame (CanDraw returned false). Can be used to recycle cached memory if task is idle for many frames in a row.
Declaration
public virtual void OnIdle()
OnPresent(bool vsync)
Presents frame to the output.
Declaration
public virtual void OnPresent(bool vsync)
Parameters
bool
vsync
True if use vertical synchronization to lock frame rate. |
OnRender(GPUContext* context)
Called on task rendering.
Declaration
public virtual void OnRender(GPUContext* context)
Parameters
GPUContext
context
The GPU context. |
operator<(const RenderTask& other)
Declaration
public bool operator<(const RenderTask& other) const
Parameters
RenderTask
other
|
Returns
bool
|
Resize(int32 width, int32 height)
Changes the buffers and output size. Does nothing if size won't change. Called by window or user to resize rendering buffers.
Declaration
public virtual bool Resize(int32 width, int32 height)
Parameters
int32
width
The width. |
int32
height
The height. |
Returns
bool
True if cannot resize the buffers. |