ImageEffect Class
Namespace: Stride.Rendering.ImagesAssembly: Stride.Rendering.dll
Post effect base class.
[DataContract]
public abstract class ImageEffect : DrawEffect, IComponent, IReferencable, ICollectorHolder, IImageEffect, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
Name | Description | |
---|---|---|
Constructors | ||
ImageEffect() | Initializes a new instance of the ImageEffect class. |
|
ImageEffect(RenderContext, String) | Initializes a new instance of the ImageEffect class. |
|
ImageEffect(String, Boolean) | Initializes a new instance of the ImageEffect class. |
|
Properties | ||
DepthStencil | Gets the output depth stencil texture. |
|
EnableSetRenderTargets | Gets or sets a boolean to enable GraphicsDevice.SetDepthAndRenderTargets from output. Default is |
|
HasDepthStencilOutput | Gets a value indicating whether this effect has depth stencil output texture binded. |
|
InputCount | Gets the number of input textures. |
|
OutputCount | Gets the number of output render target. |
|
Methods | ||
DisposeCreatedRenderTargetViews(RenderDrawContext) | Dispose the render target views that have been created. |
|
GetInput(Int32) | Gets an input texture by the specified index. |
|
GetOutput(Int32) | Gets an output render target for the specified index. |
|
GetSafeInput(Int32) | Gets a non-null input texture by the specified index. |
|
GetSafeOutput(Int32) | Gets an non-null output render target for the specified index. |
|
NewScopedRenderTarget2D(TextureDescription) | Gets a render target with the specified description, scoped for the duration of the |
|
NewScopedRenderTarget2D(Int32, Int32, PixelFormat, MipMapCount, TextureFlags, Int32) | Gets a render target output for the specified description, scoped for the duration of the |
|
NewScopedRenderTarget2D(Int32, Int32, PixelFormat, TextureFlags, Int32) | Gets a render target output for the specified description with a single mipmap, scoped for the duration of the |
|
PostDrawCore(RenderDrawContext) | ||
PreDrawCore(RenderDrawContext) | ||
Reset() | Resets the state of this effect. |
|
SetDepthOutput(Texture, Texture) | Sets the render target output. |
|
SetDepthOutput(Texture, Texture[]) | Sets the render target outputs. |
|
SetInput(Int32, Texture) | Sets an input texture |
|
SetOutput(Texture) | Sets the render target output. |
|
SetOutput(Texture[]) | Sets the render target outputs. |
|
SetRenderTargets(RenderDrawContext) | Set the render targets for the image effect. |
|
SetViewport(Nullable<Viewport>) | Sets the viewport to use . |
Constructors
ImageEffect()
Initializes a new instance of the ImageEffect class.
protected ImageEffect()
ImageEffect(RenderContext, String)
Initializes a new instance of the ImageEffect class.
protected ImageEffect(RenderContext context, string name = null)
Parameters
Type | Name | Description |
---|---|---|
RenderContext | context | The context. |
System.String | name | The name. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | context |
ImageEffect(String, Boolean)
Initializes a new instance of the ImageEffect class.
protected ImageEffect(string name, bool supersample = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
System.Boolean | supersample |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | context |
Properties
DepthStencil
Gets the output depth stencil texture.
protected Texture DepthStencil { get; }
Property Value
Type | Description |
---|---|
Texture | The depth stencil output. |
EnableSetRenderTargets
Gets or sets a boolean to enable GraphicsDevice.SetDepthAndRenderTargets from output. Default is true
.
protected bool EnableSetRenderTargets { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A boolean to enable GraphicsDevice.SetDepthAndRenderTargets from output. Default is |
HasDepthStencilOutput
Gets a value indicating whether this effect has depth stencil output texture binded.
protected bool HasDepthStencilOutput { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
InputCount
Gets the number of input textures.
public int InputCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The input count. |
OutputCount
Gets the number of output render target.
public int OutputCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The output count. |
Methods
DisposeCreatedRenderTargetViews(RenderDrawContext)
Dispose the render target views that have been created.
protected virtual void DisposeCreatedRenderTargetViews(RenderDrawContext context)
Parameters
Type | Name | Description |
---|---|---|
RenderDrawContext | context |
GetInput(Int32)
Gets an input texture by the specified index.
public Texture GetInput(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Returns
Type | Description |
---|---|
Texture | Texture. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | index |
GetOutput(Int32)
Gets an output render target for the specified index.
public Texture GetOutput(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Returns
Type | Description |
---|---|
Texture | RenderTarget. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | index |
GetSafeInput(Int32)
Gets a non-null input texture by the specified index.
protected Texture GetSafeInput(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Returns
Type | Description |
---|---|
Texture | Texture. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException |
GetSafeOutput(Int32)
Gets an non-null output render target for the specified index.
protected Texture GetSafeOutput(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Returns
Type | Description |
---|---|
Texture | RenderTarget. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException |
NewScopedRenderTarget2D(TextureDescription)
Gets a render target with the specified description, scoped for the duration of the
protected Texture NewScopedRenderTarget2D(TextureDescription description)
Parameters
Type | Name | Description |
---|---|---|
TextureDescription | description |
Returns
Type | Description |
---|---|
Texture | A new instance of texture. |
NewScopedRenderTarget2D(Int32, Int32, PixelFormat, MipMapCount, TextureFlags, Int32)
Gets a render target output for the specified description, scoped for the duration of the
protected Texture NewScopedRenderTarget2D(int width, int height, PixelFormat format, MipMapCount mipCount, TextureFlags flags = TextureFlags.ShaderResource | TextureFlags.RenderTarget, int arraySize = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | The width. |
System.Int32 | height | The height. |
PixelFormat | format | Describes the format to use. |
MipMapCount | mipCount | Number of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count. |
TextureFlags | flags | Sets the texture flags (for unordered access...etc.) |
System.Int32 | arraySize | Size of the texture 2D array, default to 1. |
Returns
Type | Description |
---|---|
Texture | A new instance of texture class. |
NewScopedRenderTarget2D(Int32, Int32, PixelFormat, TextureFlags, Int32)
Gets a render target output for the specified description with a single mipmap, scoped for the duration of the
protected Texture NewScopedRenderTarget2D(int width, int height, PixelFormat format, TextureFlags flags = TextureFlags.ShaderResource | TextureFlags.RenderTarget, int arraySize = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | The width. |
System.Int32 | height | The height. |
PixelFormat | format | Describes the format to use. |
TextureFlags | flags | Sets the texture flags (for unordered access...etc.) |
System.Int32 | arraySize | Size of the texture 2D array, default to 1. |
Returns
Type | Description |
---|---|
Texture | A new instance of texture class. |
PostDrawCore(RenderDrawContext)
protected override void PostDrawCore(RenderDrawContext context)
Parameters
Type | Name | Description |
---|---|---|
RenderDrawContext | context |
Overrides
PreDrawCore(RenderDrawContext)
protected override void PreDrawCore(RenderDrawContext context)
Parameters
Type | Name | Description |
---|---|---|
RenderDrawContext | context |
Overrides
Reset()
Resets the state of this effect.
public override void Reset()
Overrides
SetDepthOutput(Texture, Texture)
Sets the render target output.
public void SetDepthOutput(Texture depthStencilView, Texture renderTargetView)
Parameters
Type | Name | Description |
---|---|---|
Texture | depthStencilView | The depth stencil output view. |
Texture | renderTargetView | The render target output view. |
SetDepthOutput(Texture, Texture[])
Sets the render target outputs.
public void SetDepthOutput(Texture depthStencilView, params Texture[] renderTargetViews)
Parameters
Type | Name | Description |
---|---|---|
Texture | depthStencilView | The depth stencil output view. |
Texture[] | renderTargetViews | The render target output views. |
SetInput(Int32, Texture)
Sets an input texture
public void SetInput(int slot, Texture texture)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | slot | The slot. |
Texture | texture | The texture. |
SetOutput(Texture)
Sets the render target output.
public void SetOutput(Texture view)
Parameters
Type | Name | Description |
---|---|---|
Texture | view | The render target output view. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | view |
SetOutput(Texture[])
Sets the render target outputs.
public void SetOutput(params Texture[] views)
Parameters
Type | Name | Description |
---|---|---|
Texture[] | views | The render target output views. |
SetRenderTargets(RenderDrawContext)
Set the render targets for the image effect.
protected virtual void SetRenderTargets(RenderDrawContext context)
Parameters
Type | Name | Description |
---|---|---|
RenderDrawContext | context |
SetViewport(Nullable<Viewport>)
Sets the viewport to use .
public void SetViewport(Viewport? viewport)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<Viewport> | viewport | The viewport. |