Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    LocalReflections Class

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

    Compute screen space reflections as a post effect.

    System.Object → DisposeBase → ComponentBase → RendererCoreBase → RendererBase → DrawEffect → ImageEffect → LocalReflections
    Derived from LocalReflections:

    [DataContract("LocalReflections")]
    public sealed class LocalReflections : ImageEffect, IComponent, IReferencable, ICollectorHolder, IImageEffect, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
    Name Description
    Properties
    BRDFBias

    Gets or sets the BRDF bias. This value controlls source roughness effect on reflections blur. Smaller values produce wider reflections spread but also introduce more noise. Higher values provide more mirror-like reflections. Default value is 0.8.

    DepthResolution

    Gets or sets the input depth resolution mode.

    EdgeFadeFactor

    Gets or sets the edge fade factor. It's used to fade off effect on screen edges to provide smoother image.

    GlossinessThreshold

    Minimum allowed surface glossiness value to use local reflections. Pixels with lower values won't be affected by the effect.

    MaxSteps

    Maximum allowed amount of dynamic iterations in the ray trace pass. Higher value provides better ray tracing quality but decreases the performance. Default value is 60.

    RayTracePassResolution

    Gets or sets the ray trace pass resolution mode.

    ReduceHighlights

    Gets or sets a value indicating whether reduce reflection highlights during resolve pass. Performs filtering on sampled pixels to smooth luminance bursts. It helps to provide softer image with reduced amount of highlights.

    ResolvePassResolution

    Gets or sets the resolve pass resolution mode.

    ResolveSamples

    Gets or sets the resolve pass samples amount. Higher values provide better quality but reduce effect performance. Default value is 4. Use 1 for the highest speed.

    TemporalEffect

    Gets or sets a value indicating whether use temporal effect to smooth reflections.

    TemporalResponse

    Gets or sets the temporal response. Default is 0.9.

    TemporalScale

    Gets or sets the temporal effect scale. Default is 2.

    UseColorBufferMips

    Gets or sets a value indicating whether use color buffer mipsmaps chain; otherwise will use raw input color buffer to sample reflections color. Using mipmaps improves resolve pass performance and reduces GPU cache misses.

    WorldAntiSelfOcclusionBias

    Ray tracing starting position is offseted by a percent of the normal in world space to avoid self occlusions.

    Methods
    Destroy()
    DrawCore(RenderDrawContext)
    InitializeCore()
    SetInputSurfaces(Texture, Texture, Texture, Texture)

    Provides a color buffer and a depth buffer to apply the depth-of-field to.

    | Improve this Doc View Source

    Properties


    BRDFBias

    Gets or sets the BRDF bias. This value controlls source roughness effect on reflections blur. Smaller values produce wider reflections spread but also introduce more noise. Higher values provide more mirror-like reflections. Default value is 0.8.

    [Display("BRDF bias", "Raycast")]
    [DataMemberRange(0, 1, 0.05, 0.2, 4)]
    public float BRDFBias { get; set; }
    Property Value
    Type Description
    System.Single

    The BRDF bias.


    DepthResolution

    Gets or sets the input depth resolution mode.

    [Display("Depth resolution", "Raycast")]
    public LocalReflections.ResolutionMode DepthResolution { get; set; }
    Property Value
    Type Description
    LocalReflections.ResolutionMode

    EdgeFadeFactor

    Gets or sets the edge fade factor. It's used to fade off effect on screen edges to provide smoother image.

    [Display("Edge fade factor", "Resolve")]
    [DataMember(30)]
    [DataMemberRange(0, 1, 0.05, 0.2, 4)]
    public float EdgeFadeFactor { get; set; }
    Property Value
    Type Description
    System.Single

    The edge fade factor.


    GlossinessThreshold

    Minimum allowed surface glossiness value to use local reflections. Pixels with lower values won't be affected by the effect.

    [Display("Gloss threshold", "Raycast")]
    [DataMemberRange(0, 1, 0.05, 0.2, 4)]
    public float GlossinessThreshold { get; set; }
    Property Value
    Type Description
    System.Single

    MaxSteps

    Maximum allowed amount of dynamic iterations in the ray trace pass. Higher value provides better ray tracing quality but decreases the performance. Default value is 60.

    [Display("Max steps", "Raycast")]
    [DataMemberRange(1, 128, 1, 10, 0)]
    public int MaxSteps { get; set; }
    Property Value
    Type Description
    System.Int32

    RayTracePassResolution

    Gets or sets the ray trace pass resolution mode.

    [Display("Resolution", "Raycast")]
    public LocalReflections.ResolutionMode RayTracePassResolution { get; set; }
    Property Value
    Type Description
    LocalReflections.ResolutionMode

    ReduceHighlights

    Gets or sets a value indicating whether reduce reflection highlights during resolve pass. Performs filtering on sampled pixels to smooth luminance bursts. It helps to provide softer image with reduced amount of highlights.

    [Display("Reduce highlights", "Resolve")]
    [DataMember(20)]
    public bool ReduceHighlights { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if reduce fireflies; otherwise, false.


    ResolvePassResolution

    Gets or sets the resolve pass resolution mode.

    [Display("Resolution", "Resolve")]
    [DataMember(0)]
    public LocalReflections.ResolutionMode ResolvePassResolution { get; set; }
    Property Value
    Type Description
    LocalReflections.ResolutionMode

    ResolveSamples

    Gets or sets the resolve pass samples amount. Higher values provide better quality but reduce effect performance. Default value is 4. Use 1 for the highest speed.

    [Display("Samples", "Resolve")]
    [DataMember(10)]
    [DataMemberRange(1, 8, 1, 1, 0)]
    public int ResolveSamples { get; set; }
    Property Value
    Type Description
    System.Int32

    The resolve samples amount.


    TemporalEffect

    Gets or sets a value indicating whether use temporal effect to smooth reflections.

    [Display("Temporal effect", "Temporal")]
    public bool TemporalEffect { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if use temporal effect to smooth reflections; otherwise, false.


    TemporalResponse

    Gets or sets the temporal response. Default is 0.9.

    [Display("Response", "Temporal")]
    [DataMemberRange(0.5, 1, 0.01, 0.1, 2)]
    public float TemporalResponse { get; set; }
    Property Value
    Type Description
    System.Single

    The temporal response.


    TemporalScale

    Gets or sets the temporal effect scale. Default is 2.

    [Display("Scale", "Temporal")]
    [DataMemberRange(0, 20, 0.5, 0.5, 2)]
    public float TemporalScale { get; set; }
    Property Value
    Type Description
    System.Single

    The temporal effect scale.


    UseColorBufferMips

    Gets or sets a value indicating whether use color buffer mipsmaps chain; otherwise will use raw input color buffer to sample reflections color. Using mipmaps improves resolve pass performance and reduces GPU cache misses.

    [Display("Use color buffer mips", "Resolve")]
    [DataMember(40)]
    public bool UseColorBufferMips { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if use color buffer mips; otherwise, false.


    WorldAntiSelfOcclusionBias

    Ray tracing starting position is offseted by a percent of the normal in world space to avoid self occlusions.

    [Display("Ray start bias", "Raycast")]
    [DataMemberRange(0, 0.1, 0.005, 0.01, 6)]
    public float WorldAntiSelfOcclusionBias { get; set; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    Methods


    Destroy()

    protected override void Destroy()
    Overrides
    RendererCoreBase.Destroy()

    DrawCore(RenderDrawContext)

    protected override void DrawCore(RenderDrawContext context)
    Parameters
    Type Name Description
    RenderDrawContext context
    Overrides
    RendererBase.DrawCore(RenderDrawContext)

    InitializeCore()

    protected override void InitializeCore()
    Overrides
    RendererCoreBase.InitializeCore()

    SetInputSurfaces(Texture, Texture, Texture, Texture)

    Provides a color buffer and a depth buffer to apply the depth-of-field to.

    public void SetInputSurfaces(Texture colorBuffer, Texture depthBuffer, Texture normalsBuffer, Texture specularRoughnessBuffer)
    Parameters
    Type Name Description
    Texture colorBuffer

    Single view of the scene

    Texture depthBuffer

    The depth buffer corresponding to the color buffer provided.

    Texture normalsBuffer

    The buffer which contains surface packed world space normal vectors.

    Texture specularRoughnessBuffer

    The buffer which contains surface specular color and roughness.


    Inherited Members

    ImageEffect.EnableSetRenderTargets
    ImageEffect.SetInput(Int32, Texture)
    ImageEffect.Reset()
    ImageEffect.SetOutput(Texture)
    ImageEffect.SetOutput(Texture[])
    ImageEffect.SetDepthOutput(Texture, Texture)
    ImageEffect.SetDepthOutput(Texture, Texture[])
    ImageEffect.SetViewport(Nullable<Viewport>)
    ImageEffect.PreDrawCore(RenderDrawContext)
    ImageEffect.SetRenderTargets(RenderDrawContext)
    ImageEffect.PostDrawCore(RenderDrawContext)
    ImageEffect.DisposeCreatedRenderTargetViews(RenderDrawContext)
    ImageEffect.InputCount
    ImageEffect.GetInput(Int32)
    ImageEffect.GetSafeInput(Int32)
    ImageEffect.DepthStencil
    ImageEffect.HasDepthStencilOutput
    ImageEffect.OutputCount
    ImageEffect.GetOutput(Int32)
    ImageEffect.GetSafeOutput(Int32)
    ImageEffect.NewScopedRenderTarget2D(TextureDescription)
    ImageEffect.NewScopedRenderTarget2D(Int32, Int32, PixelFormat, TextureFlags, Int32)
    ImageEffect.NewScopedRenderTarget2D(Int32, Int32, PixelFormat, MipMapCount, TextureFlags, Int32)
    DrawEffect.SamplingPattern
    DrawEffect.Parameters
    DrawEffect.Scaler
    DrawEffect.SetDefaultParameters()
    DrawEffect.Draw(RenderDrawContext, String)
    DrawEffect.Draw(RenderDrawContext, String, Object[])
    DrawEffect.ToString()
    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.Unload()
    RendererCoreBase.NewScopedBuffer(BufferDescription, PixelFormat)
    RendererCoreBase.NewScopedTypedBuffer(Int32, PixelFormat, Boolean, GraphicsResourceUsage)
    RendererCoreBase.PushScopedResource<T>(T)
    RendererCoreBase.CheckIsInDrawCore()
    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