Class ImageEffect
Post effect base class.
[DataContract]
public abstract class ImageEffect : DrawEffect, IComponent, IReferencable, ICollectorHolder, IImageEffect, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
- Inheritance
-
objectImageEffect
- Implements
- Derived
- Inherited Members
- Extension Methods
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
contextRenderContextThe context.
namestringThe name.
Exceptions
- ArgumentNullException
context
ImageEffect(string, bool)
Initializes a new instance of the ImageEffect class.
protected ImageEffect(string name, bool supersample = false)
Parameters
Exceptions
- ArgumentNullException
context
Properties
DepthStencil
Gets the output depth stencil texture.
protected Texture DepthStencil { get; }
Property Value
- 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
- bool
A boolean to enable GraphicsDevice.SetDepthAndRenderTargets from output. Default is
true
HasDepthStencilOutput
Gets a value indicating whether this effect has depth stencil output texture binded.
protected bool HasDepthStencilOutput { get; }
Property Value
- bool
trueif this instance has depth stencil output; otherwise,false.
InputCount
Gets the number of input textures.
public int InputCount { get; }
Property Value
- int
The input count.
OutputCount
Gets the number of output render target.
public int OutputCount { get; }
Property Value
- int
The output count.
Methods
DisposeCreatedRenderTargetViews(RenderDrawContext)
Dispose the render target views that have been created.
protected virtual void DisposeCreatedRenderTargetViews(RenderDrawContext context)
Parameters
contextRenderDrawContext
GetInput(int)
Gets an input texture by the specified index.
public Texture GetInput(int index)
Parameters
indexintThe index.
Returns
- Texture
Texture.
Exceptions
GetOutput(int)
Gets an output render target for the specified index.
public Texture GetOutput(int index)
Parameters
indexintThe index.
Returns
- Texture
RenderTarget.
Exceptions
GetSafeInput(int)
Gets a non-null input texture by the specified index.
protected Texture GetSafeInput(int index)
Parameters
indexintThe index.
Returns
- Texture
Texture.
Exceptions
GetSafeOutput(int)
Gets an non-null output render target for the specified index.
protected Texture GetSafeOutput(int index)
Parameters
indexintThe index.
Returns
- Texture
RenderTarget.
Exceptions
NewScopedRenderTarget2D(TextureDescription)
Gets a render target with the specified description, scoped for the duration of the DrawCore(RenderDrawContext).
protected Texture NewScopedRenderTarget2D(TextureDescription description)
Parameters
descriptionTextureDescription
Returns
- Texture
A new instance of texture.
NewScopedRenderTarget2D(int, int, PixelFormat, MipMapCount, TextureFlags, int)
Gets a render target output for the specified description, scoped for the duration of the DrawCore(RenderDrawContext).
protected Texture NewScopedRenderTarget2D(int width, int height, PixelFormat format, MipMapCount mipCount, TextureFlags flags = TextureFlags.ShaderResource | TextureFlags.RenderTarget, int arraySize = 1)
Parameters
widthintThe width.
heightintThe height.
formatPixelFormatDescribes the format to use.
mipCountMipMapCountNumber of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.
flagsTextureFlagsSets the texture flags (for unordered access...etc.)
arraySizeintSize of the texture 2D array, default to 1.
Returns
- Texture
A new instance of texture class.
NewScopedRenderTarget2D(int, int, PixelFormat, TextureFlags, int)
Gets a render target output for the specified description with a single mipmap, scoped for the duration of the DrawCore(RenderDrawContext).
protected Texture NewScopedRenderTarget2D(int width, int height, PixelFormat format, TextureFlags flags = TextureFlags.ShaderResource | TextureFlags.RenderTarget, int arraySize = 1)
Parameters
widthintThe width.
heightintThe height.
formatPixelFormatDescribes the format to use.
flagsTextureFlagsSets the texture flags (for unordered access...etc.)
arraySizeintSize of the texture 2D array, default to 1.
Returns
- Texture
A new instance of texture class.
PostDrawCore(RenderDrawContext)
protected override void PostDrawCore(RenderDrawContext context)
Parameters
contextRenderDrawContext
PreDrawCore(RenderDrawContext)
protected override void PreDrawCore(RenderDrawContext context)
Parameters
contextRenderDrawContext
Reset()
Resets the state of this effect.
public override void Reset()
SetDepthOutput(Texture, Texture)
Sets the render target output.
public void SetDepthOutput(Texture depthStencilView, Texture renderTargetView)
Parameters
depthStencilViewTextureThe depth stencil output view.
renderTargetViewTextureThe render target output view.
SetDepthOutput(Texture, params Texture[])
Sets the render target outputs.
public void SetDepthOutput(Texture depthStencilView, params Texture[] renderTargetViews)
Parameters
depthStencilViewTextureThe depth stencil output view.
renderTargetViewsTexture[]The render target output views.
SetInput(int, Texture)
Sets an input texture
public void SetInput(int slot, Texture texture)
Parameters
SetOutput(Texture)
Sets the render target output.
public void SetOutput(Texture view)
Parameters
viewTextureThe render target output view.
Exceptions
SetOutput(params Texture[])
Sets the render target outputs.
public void SetOutput(params Texture[] views)
Parameters
viewsTexture[]The render target output views.
SetRenderTargets(RenderDrawContext)
Set the render targets for the image effect.
protected virtual void SetRenderTargets(RenderDrawContext context)
Parameters
contextRenderDrawContext
SetScissorRectangle(Rectangle?)
Binds a single scissor rectangle to the rasterizer stage.
public void SetScissorRectangle(Rectangle? value)
Parameters
valueRectangle?The scissor rectangle.
SetScissorRectangles(ReadOnlySpan<Rectangle>)
Binds a set of scissor rectangles to the rasterizer stage.
public void SetScissorRectangles(ReadOnlySpan<Rectangle> values)
Parameters
valuesReadOnlySpan<Rectangle>The set of scissor rectangles to bind.
Remarks
Only CommandList's MaxViewportAndScissorRectangleCount viewports can be used simultaneously
SetViewport(Viewport?)
Binds a single viewport to the rasterizer stage.
public void SetViewport(Viewport? value)
Parameters
valueViewport?The viewport.
SetViewports(ReadOnlySpan<Viewport>)
Binds a set of viewports to the rasterizer stage.
public void SetViewports(ReadOnlySpan<Viewport> values)
Parameters
valuesReadOnlySpan<Viewport>The set of viewports to bind.
Remarks
Only CommandList's MaxViewportAndScissorRectangleCount scissors can be used simultaneously