Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ImageEffect Class

    Namespace: Stride.Rendering.Images
    Assembly: Stride.Rendering.dll

    Post effect base class.

    System.Object → DisposeBase → ComponentBase → RendererCoreBase → RendererBase → DrawEffect → ImageEffect
    Derived from ImageEffect: MSAAResolver LambertianPrefilteringSHNoCompute Afterimage AmbientOcclusion Bloom BokehBlur BrightFilter CoCMapBlur ColorTransformGroup DepthMinMax DepthOfField Fog GaussianBlur ImageEffectShader ImageMultiScaler ImageReadback<T> LensFlare LightShafts LightStreak LocalReflections LuminanceEffect Outline PostProcessingEffects SubsurfaceScatteringBlur

    [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 true.

    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 .

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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 true


    HasDepthStencilOutput

    Gets a value indicating whether this effect has depth stencil output texture binded.

    protected bool HasDepthStencilOutput { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance has depth stencil output; otherwise, false.


    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.

    | Improve this Doc View Source

    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
    RendererCoreBase.PostDrawCore(RenderDrawContext)

    PreDrawCore(RenderDrawContext)

    protected override void PreDrawCore(RenderDrawContext context)
    Parameters
    Type Name Description
    RenderDrawContext context
    Overrides
    RendererCoreBase.PreDrawCore(RenderDrawContext)

    Reset()

    Resets the state of this effect.

    public override void Reset()
    Overrides
    DrawEffect.Reset()

    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.


    Inherited Members

    DrawEffect.SamplingPattern
    DrawEffect.Parameters
    DrawEffect.Scaler
    DrawEffect.SetDefaultParameters()
    DrawEffect.Draw(RenderDrawContext, String)
    DrawEffect.Draw(RenderDrawContext, String, Object[])
    DrawEffect.ToString()
    RendererBase.DrawCore(RenderDrawContext)
    RendererBase.Draw(RenderDrawContext)
    RendererCoreBase.Enabled
    RendererCoreBase.Profiling
    RendererCoreBase.ProfilingKey
    RendererCoreBase.Context
    RendererCoreBase.Services
    RendererCoreBase.Content
    RendererCoreBase.GraphicsDevice
    RendererCoreBase.EffectSystem
    RendererCoreBase.Initialized
    RendererCoreBase.Initialize(RenderContext)
    RendererCoreBase.InitializeCore()
    RendererCoreBase.Unload()
    RendererCoreBase.NewScopedBuffer(BufferDescription, PixelFormat)
    RendererCoreBase.NewScopedTypedBuffer(Int32, PixelFormat, Boolean, GraphicsResourceUsage)
    RendererCoreBase.PushScopedResource<T>(T)
    RendererCoreBase.CheckIsInDrawCore()
    RendererCoreBase.Destroy()
    RendererCoreBase.ToLoadAndUnload<T>(T)
    RendererCoreBase.PreDrawCoreInternal(RenderDrawContext)
    RendererCoreBase.EnsureContext(RenderContext)
    RendererCoreBase.PostDrawCoreInternal(RenderDrawContext)
    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    ImageEffectExtensions.SetInput(IImageEffect, Texture)
    ImageEffectExtensions.SetInput(IImageEffect, Texture, Texture)
    ImageEffectExtensions.SetInput(IImageEffect, Texture, Texture, Texture)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation