LocalReflections Class
Namespace: Stride.Rendering.ImagesAssembly: 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
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. |
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 |
|
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 |
|
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 |
|
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 |
Methods
Destroy()
protected override void Destroy()
Overrides
DrawCore(RenderDrawContext)
protected override void DrawCore(RenderDrawContext context)
Parameters
Type | Name | Description |
---|---|---|
RenderDrawContext | context |
Overrides
InitializeCore()
protected override void InitializeCore()
Overrides
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. |