Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Improvements done to the water system (Deferred, Decals, SSR, Foam, Caustics, etc.).
- Changed the behavior the max ray length for recursive rendering to match RTR and rasterization.
- Moved more internals of the sky manager to proper Render Graph passes.
- Disabled the "Reflect Sky" feature in the case of transparent screen space reflections for the water system.

## [13.1.2] - 2021-11-05

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ HDRP uses the [Volume](Volumes.md) framework to calculate SSR, so to enable and
| **Algorithm** | Specifies the algorithm to use for the screen-space reflection effect. The options are:<br/>&#8226; **Approximation**: Approximates screen-space reflection to quickly calculate a result. This solution is less precise than **PBR Accumulation**, particularly for rough surfaces, but is less resource intensive.<br/>&#8226; **PBR Accumulation**: Accumulates multiple frames to calculate a more accurate result. You can control the amount of accumulation using **Accumulation Factor**. This solution might produce more ghosting than **Approximation**, due to the accumulation, and is also more resources intensive. HDRP does not apply this algorithm to transparent material and instead always uses **Approximation**. |
| **Minimum Smoothness** | Use the slider to set the minimum amount of surface smoothness at which HDRP performs SSR tracing. Lower values result in HDRP performing SSR tracing for less smooth GameObjects. If the smoothness value of the pixel is lower than this value, HDRP falls back to the next available reflection method in the [reflection hierarchy](Reflection-in-HDRP.md#ReflectionHierarchy). |
| **Smoothness Fade Start** | Use the slider to set the smoothness value at which SSR reflections begin to fade out. Lower values result in HDRP fading out SSR reflections for less smooth GameObjects. The fade is in the range [Minimum Smoothness, Smoothness Fade Start]. |
| **Reflect Sky** | Indicates whether HDRP should use SSR to handle sky reflection. If you disable this property, pixels that reflect the sky use the next level of the [reflection hierarchy](Reflection-in-HDRP.md#ReflectionHierarchy).<br />**Note**: SSR uses the depth buffer to calculate reflection and HDRP does not add transparent GameObjects to the depth buffer. If you enable this property, transparent GameObject that appear over the sky in the color buffer can cause visual artifacts and incorrect looking reflection. This is a common limitation for SSR techniques. |
| **Reflect Sky** | Indicates whether HDRP should use SSR to handle sky reflection. If you disable this property, pixels that reflect the sky use the next level of the [reflection hierarchy](Reflection-in-HDRP.md#ReflectionHierarchy).<br />**Note**: SSR uses the depth buffer to calculate reflection and HDRP does not add transparent GameObjects to the depth buffer. If you enable this property, transparent GameObject that appear over the sky in the color buffer can cause visual artifacts and incorrect looking reflection. This is a common limitation for SSR techniques. This only affects SSR on opaque objects and is not supported for SSR on transparent.|
| **Screen Edge Fade Distance** | Use the slider to control the distance at which HDRP fades out screen space reflections when the destination of the ray is near the boundaries of the screen. Increase this value to increase the distance from the screen edge at which HDRP fades out screen space reflections for a ray destination. |
| **Object Thickness** | Use the slider to control the thickness of the GameObjects on screen. Because the SSR algorithm can not distinguish thin GameObjects from thick ones, this property helps trace rays behind GameObjects. The algorithm applies this property to every GameObject uniformly. |
| **Quality** | Specifies the quality level to use for this effect. Each quality level applies different preset values. Unity also stops you from editing the properties that the preset overrides. If you want to set your own values for every property, select **Custom**. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public override void OnEnable()
static public readonly GUIContent k_EnabledTransparent = EditorGUIUtility.TrTextContent("Enabled (Transparent)", "Enable Transparent Screen Space Reflections");
static public readonly GUIContent k_Algo = EditorGUIUtility.TrTextContent("Algorithm", "The screen space reflection algorithm used.");
static public readonly GUIContent k_TracingText = EditorGUIUtility.TrTextContent("Tracing", "Controls the technique used to compute the reflection.Controls the technique used to compute the reflections. Ray marching uses a ray-marched screen-space solution, Ray tracing uses a hardware accelerated world-space solution. Mixed uses first Ray marching, then Ray tracing if it fails to intersect on-screen geometry.");
static public readonly GUIContent k_ReflectSkyText = EditorGUIUtility.TrTextContent("Reflect Sky", "When enabled, SSR handles sky reflection.");
static public readonly GUIContent k_ReflectSkyText = EditorGUIUtility.TrTextContent("Reflect Sky", "When enabled, SSR handles sky reflection for opaque objects (not supported for SSR on transparent).");
static public readonly GUIContent k_LayerMaskText = EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for ray traced reflections.");
static public readonly GUIContent k_RayMissFallbackHierarchyText = EditorGUIUtility.TrTextContent("Ray Miss", "Controls the order in which fall backs are used when a ray misses.");
static public readonly GUIContent k_LastBounceFallbackHierarchyText = EditorGUIUtility.TrTextContent("Last Bounce", "Controls the fallback hierarchy for lighting the last bounce.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public float smoothnessFadeStart

#region Ray Marching
/// <summary>
/// When enabled, SSR handles sky reflection.
/// When enabled, SSR handles sky reflection for opaque objects (not supported for SSR on transparent).
/// </summary>
public BoolParameter reflectSky = new BoolParameter(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ class RenderSSRPassData
public bool motionVectorFromHit;
}

void UpdateSSRConstantBuffer(HDCamera hdCamera, ScreenSpaceReflection settings, ref ShaderVariablesScreenSpaceReflection cb)
void UpdateSSRConstantBuffer(HDCamera hdCamera, ScreenSpaceReflection settings, bool isTransparent, ref ShaderVariablesScreenSpaceReflection cb)
{
float n = hdCamera.camera.nearClipPlane;
float f = hdCamera.camera.farClipPlane;
Expand All @@ -1112,7 +1112,7 @@ void UpdateSSRConstantBuffer(HDCamera hdCamera, ScreenSpaceReflection settings,
cb._SsrThicknessScale = 1.0f / (1.0f + thickness);
cb._SsrThicknessBias = -n / (f - n) * (thickness * cb._SsrThicknessScale);
cb._SsrIterLimit = settings.rayMaxIterations;
cb._SsrReflectsSky = settings.reflectSky.value ? 1 : 0;
cb._SsrReflectsSky = isTransparent ? 0 : (settings.reflectSky.value ? 1 : 0);
cb._SsrStencilBit = (int)StencilUsage.TraceReflectionRay;
float roughnessFadeStart = 1 - settings.smoothnessFadeStart;
cb._SsrRoughnessFadeEnd = 1 - settings.minSmoothness;
Expand Down Expand Up @@ -1197,7 +1197,7 @@ TextureHandle RenderSSR(RenderGraph renderGraph,
var colorPyramid = renderGraph.ImportTexture(colorPyramidRT);
var volumeSettings = hdCamera.volumeStack.GetComponent<ScreenSpaceReflection>();

UpdateSSRConstantBuffer(hdCamera, volumeSettings, ref passData.cb);
UpdateSSRConstantBuffer(hdCamera, volumeSettings, transparent, ref passData.cb);

passData.hdCamera = hdCamera;
passData.blueNoise = GetBlueNoiseManager();
Expand Down