Skip to content

Fixed a performance issue with stochastic ray traced area shadows. #300

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
May 5, 2020
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 @@ -570,6 +570,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Made more explicit the warning about raytracing and asynchronous compute. Also fixed the condition in which it appears.
- Fixed a null ref exception in static sky when the default volume profile is invalid.
- Fixed issue with screen-space shadows not enabled properly when RT is disabled (case 1235821)
- Fixed a performance issue with stochastic ray traced area shadows.

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
float denom = dot(normal, ray_dir);
if (abs(denom) > PLANE_INTERSECTION_EPSILON)
{
float3 d = pos - ray_origin;
t = dot(d, normal) / denom;
Expand Down