Table of Contents

Class LocalReflections

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

Compute screen space reflections as a post effect.

[DataContract("LocalReflections")]
public sealed class LocalReflections : ImageEffect, IComponent, IReferencable, ICollectorHolder, IImageEffect, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
Inheritance
LocalReflections
Implements
Inherited Members
Extension Methods

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

float

The BRDF bias.

DepthResolution

Gets or sets the input depth resolution mode.

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

Property Value

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

float

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

float

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

int

RayTracePassResolution

Gets or sets the ray trace pass resolution mode.

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

Property Value

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

bool

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

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

int

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

bool

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

float

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

float

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

bool

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

float

Methods

Destroy()

Disposes of object resources.

protected override void Destroy()

DrawCore(RenderDrawContext)

Main drawing method for this renderer that must be implemented.

protected override void DrawCore(RenderDrawContext context)

Parameters

context RenderDrawContext

The context.

InitializeCore()

protected override void 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

colorBuffer Texture

Single view of the scene

depthBuffer Texture

The depth buffer corresponding to the color buffer provided.

normalsBuffer Texture

The buffer which contains surface packed world space normal vectors.

specularRoughnessBuffer Texture

The buffer which contains surface specular color and roughness.