Skip to content

Changed the behavior the max ray length for recursive rendering to match RTR and rasterization. #6643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 18, 2021
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 @@ -101,6 +101,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Replaced the geometry distance offset in the Probe Volume component by a minimum renderer volume threshold to ignore small objects when placing probes.
- Small improvement changes in the UX for the Unlit Distortion field.
- 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.

## [13.1.2] - 2021-11-05

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Since recursive rendering uses an independent render pass, HDRP cannot render an
| -------------- | ------------------------------------------------------------ |
| **LayerMask** | Defines the layers that HDRP processes this ray-traced effect for. |
| **Max Depth** | Controls the maximum number of times a ray can reflect or refract before it stops and returns the final color. Increasing this value increases execution time exponentially. |
| **Max Ray Length** | Controls the length of the rays that HDRP uses for ray tracing. If a ray doesn't find an intersection, then the ray returns the color of the sky. |
| **Max Ray Length** | Controls the length of the rays that HDRP uses for ray tracing after the initial intersection. For the primary ray, HDRP uses the camera's near and far planes.|
| **Min Smoothness** | Defines the threshold at which reflection rays are not cast if the smoothness value of the target surface is inferior to the one defined by the parameter. |
| **Ray Miss** | Determines what HDRP does when recursive rendering doesn't find an intersection. Choose from one of the following options: <br/>&#8226;**Reflection probes**: HDRP uses reflection probes in your scene to calculate the last recursive rendering bounce.<br/>&#8226;**Sky**: HDRP uses the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.<br/>&#8226;**Both** : HDRP uses both reflection probes and the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.<br/>&#8226;**Nothing**: HDRP does not calculate indirect lighting when recursive rendering doesn't find an intersection.<br/><br/>This property is set to **Both** by default. |
| **Last Bounce** | Determines what HDRP does when recursive rendering lights the last bounce. Choose from one of the following options: <br/>&#8226;**Reflection probes**: HDRP uses reflection probes in your scene to calculate the last bounce.<br/>&#8226;**Sky**: HDRP uses the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.<br/>&#8226;**Both**: HDRP uses both reflection probes and the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.<br/>&#8226;**Nothing**: HDRP does not calculate indirect lighting when it evaluates the last bounce.<br/><br/>This property is set to **Both** by default. |
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ void RayGenRenderer()
RayDesc rayDescriptor;
rayDescriptor.Origin = originWS;
rayDescriptor.Direction = incidentWS;
rayDescriptor.TMin = _RaytracingCameraNearPlane;
rayDescriptor.TMax = _RaytracingRayMaxLength;

// For the initial ray, we don't want to have any disparity between the rasterization and ray tracing (which objects are rendered)
// thus we need to force the max distance to the far plane.
rayDescriptor.TMin = _ProjectionParams.y;
rayDescriptor.TMax = _ProjectionParams.z;

// Adjust world-space position to match the RAS setup with XR single-pass and camera relative
ApplyCameraRelativeXR(rayDescriptor.Origin);
Expand Down