diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 6c734558706..800cdbf9f16 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed shadowmask UI now correctly showing shadowmask disable - Fixed the indirect diffuse texture not being ignored when it should (ray tracing disabled). +- Fixed a performance issue with stochastic ray traced area shadows. ### Changed - Shadowmask and realtime reflection probe property are hide in Quality settings diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/SphericalQuad.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/SphericalQuad.hlsl index a2edee5e38f..48f5b932b71 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/SphericalQuad.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/SphericalQuad.hlsl @@ -1,7 +1,11 @@ +// I am not sure why exactly, by a lower epsilon generates ray that even if they give a valid result with ray tracing +// nuke the performance. Changing the epsilon from 1e-6 to 1e-5 seems to solve the issue. +#define PLANE_INTERSECTION_EPSILON 1e-5 + bool IntersectPlane(float3 ray_origin, float3 ray_dir, float3 pos, float3 normal, out float t) { float denom = dot(normal, ray_dir); - if (abs(denom) > 1e-6) + if (abs(denom) > PLANE_INTERSECTION_EPSILON) { float3 d = pos - ray_origin; t = dot(d, normal) / denom;