Class SceneRenderTask
Render task which draws scene actors into the output buffer.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class SceneRenderTask : RenderTaskConstructors
SceneRenderTask()
Properties
ActorsSource
The actors source to use (configures what objects to render).
Declaration
[Unmanaged]
public ActorsSources ActorsSource { get; set; }Property Value
| ActorsSources 
 | 
AllowGlobalCustomPostFx
True if allow using global custom PostFx when rendering this task.
Declaration
[Unmanaged]
public bool AllowGlobalCustomPostFx { get; set; }Property Value
| System.Boolean 
 | 
Buffers
The scene rendering buffers. Created and managed by the task.
Declaration
[Unmanaged]
public RenderBuffers Buffers { get; }Property Value
| RenderBuffers 
 | 
Camera
The scene rendering camera. Can be used to override the rendering view properties based on the current camera setup.
Declaration
[Unmanaged]
public Camera Camera { get; set; }Property Value
| Camera 
 | 
CustomActors
The custom set of actors to render. Used when ActorsSources.CustomActors flag is active.
Declaration
[Unmanaged]
public Actor[] CustomActors { get; set; }Property Value
| Actor[] 
 | 
CustomScenes
The custom set of scenes to render. Used when ActorsSources.CustomScenes flag is active.
Declaration
[Unmanaged]
public Scene[] CustomScenes { get; set; }Property Value
| Scene[] 
 | 
IsCustomRendering
True if the task is used for custom scene rendering and default scene drawing into output should be skipped. Enable it if you use Render event and draw scene manually.
Declaration
[Unmanaged]
public bool IsCustomRendering { get; set; }Property Value
| System.Boolean 
 | 
Output
The output texture (can be null if using rendering to window swap chain). Can be used to redirect the default scene rendering output to a texture.
Declaration
[Unmanaged]
public GPUTexture Output { get; set; }Property Value
| GPUTexture 
 | 
OutputView
Gets the rendering output view.
Declaration
[Unmanaged]
public GPUTextureView OutputView { get; }Property Value
| GPUTextureView 
 | 
OutputViewport
Gets the rendering output viewport (after upsampling).
Declaration
[Unmanaged]
public Viewport OutputViewport { get; }Property Value
| Viewport 
 | 
RenderingPercentage
The scale of the rendering resolution relative to the output dimensions. If lower than 1 the scene and postprocessing will be rendered at a lower resolution and upscaled to the output backbuffer.
Declaration
[Unmanaged]
public float RenderingPercentage { get; set; }Property Value
| System.Single 
 | 
UpscaleLocation
The image resolution upscale location within rendering pipeline. Unused if RenderingPercentage is 1.
Declaration
[Unmanaged]
public RenderingUpscaleLocation UpscaleLocation { get; set; }Property Value
| RenderingUpscaleLocation 
 | 
View
The render view description.
Declaration
[Unmanaged]
public RenderView View { get; set; }Property Value
| RenderView 
 | 
ViewFlags
Gets or sets the view flags (via View property).
Declaration
public ViewFlags ViewFlags { get; set; }Property Value
| ViewFlags 
 | 
ViewLayersMask
The rendering mask for layers. Used to exclude objects from rendering (via View property).
Declaration
public LayersMask ViewLayersMask { get; set; }Property Value
| LayersMask 
 | 
ViewMode
Gets or sets the view mode (via View property).
Declaration
public ViewMode ViewMode { get; set; }Property Value
| ViewMode 
 | 
Viewport
Gets the rendering render task viewport (before upsampling).
Declaration
[Unmanaged]
public Viewport Viewport { get; }Property Value
| Viewport 
 | 
Methods
add_CollectDrawCalls(SceneRenderTask.CollectDrawCallsDelegate)
Declaration
public void add_CollectDrawCalls(SceneRenderTask.CollectDrawCallsDelegate value)Parameters
| SceneRenderTask.CollectDrawCallsDelegate
        value 
 | 
add_PostRender(SceneRenderTask.PostRenderDelegate)
Declaration
public void add_PostRender(SceneRenderTask.PostRenderDelegate value)Parameters
| SceneRenderTask.PostRenderDelegate
        value 
 | 
add_PreRender(SceneRenderTask.PreRenderDelegate)
Declaration
public void add_PreRender(SceneRenderTask.PreRenderDelegate value)Parameters
| SceneRenderTask.PreRenderDelegate
        value 
 | 
AddCustomActor(Actor)
Adds the custom actor to the rendering.
Declaration
[Unmanaged]
public void AddCustomActor(Actor actor)Parameters
| Actor
        actor The actor. | 
AddCustomPostFx(PostProcessEffect)
Adds the custom postfx to the rendering.
Declaration
[Unmanaged]
public void AddCustomPostFx(PostProcessEffect fx)Parameters
| PostProcessEffect
        fx The postfx script. | 
AddGlobalCustomPostFx(PostProcessEffect)
Adds the custom global postfx to the rendering.
Declaration
[Unmanaged]
public static void AddGlobalCustomPostFx(PostProcessEffect fx)Parameters
| PostProcessEffect
        fx The postfx script. | 
CameraCut()
Marks the next rendered frame as camera cut. Used to clear the temporal effects history and prevent visual artifacts blended from the previous frames.
Declaration
[Unmanaged]
public void CameraCut()ClearCustomActors()
Removes all the custom actors from the rendering.
Declaration
[Unmanaged]
public void ClearCustomActors()remove_CollectDrawCalls(SceneRenderTask.CollectDrawCallsDelegate)
Declaration
public void remove_CollectDrawCalls(SceneRenderTask.CollectDrawCallsDelegate value)Parameters
| SceneRenderTask.CollectDrawCallsDelegate
        value 
 | 
remove_PostRender(SceneRenderTask.PostRenderDelegate)
Declaration
public void remove_PostRender(SceneRenderTask.PostRenderDelegate value)Parameters
| SceneRenderTask.PostRenderDelegate
        value 
 | 
remove_PreRender(SceneRenderTask.PreRenderDelegate)
Declaration
public void remove_PreRender(SceneRenderTask.PreRenderDelegate value)Parameters
| SceneRenderTask.PreRenderDelegate
        value 
 | 
RemoveCustomActor(Actor)
Removes the custom actor from the rendering.
Declaration
[Unmanaged]
public void RemoveCustomActor(Actor actor)Parameters
| Actor
        actor The actor. | 
RemoveCustomPostFx(PostProcessEffect)
Removes the custom postfx from the rendering.
Declaration
[Unmanaged]
public void RemoveCustomPostFx(PostProcessEffect fx)Parameters
| PostProcessEffect
        fx The postfx script. | 
RemoveGlobalCustomPostFx(PostProcessEffect)
Removes the custom global postfx from the rendering.
Declaration
[Unmanaged]
public static void RemoveGlobalCustomPostFx(PostProcessEffect fx)Parameters
| PostProcessEffect
        fx The postfx script. | 
Events
CollectDrawCalls
The action called on view rendering to collect draw calls. It allows to extend rendering pipeline and draw custom geometry non-existing in the scene or custom actors set.
Declaration
[Unmanaged]
public event SceneRenderTask.CollectDrawCallsDelegate CollectDrawCallsEvent Type
| SceneRenderTask.CollectDrawCallsDelegate 
 | 
PostRender
The action called after scene rendering. Can be used to render additional visual elements to the output.
Declaration
[Unmanaged]
public event SceneRenderTask.PostRenderDelegate PostRenderEvent Type
| SceneRenderTask.PostRenderDelegate 
 | 
PreRender
The action called after scene rendering. Can be used to perform custom pre-rendering or to modify the render view.
Declaration
[Unmanaged]
public event SceneRenderTask.PreRenderDelegate PreRenderEvent Type
| SceneRenderTask.PreRenderDelegate 
 |