Skip to content

Avoid issues causing faulty transitions in shadows (resulting in no shadows with unconventional aspect ratio) #2776

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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e54311f
Fixed volume component tooltips using the same parameter name (#2754)
adrien-de-tocqueville Nov 26, 2020
0cace46
Use the proper history info for Bicubic resampling in TAA (#2759)
FrancescoC-unity Nov 26, 2020
0120a0f
Fixed lookdev movement (#2757)
adrien-de-tocqueville Nov 26, 2020
0dcb948
[HDRP] Fix issue with saving some quality settings in volume override…
pmavridis Nov 26, 2020
68eb5b1
[HDRP] Fixed NullReferenceException in HDRenderPipeline.UpgradeResour…
sebastienlagarde Nov 27, 2020
29a3d43
fix issue with confusing text (#2766)
sebastienlagarde Nov 27, 2020
4ce4727
Fix
FrancescoC-unity Nov 27, 2020
654929b
Fix white dots
FrancescoC-unity Nov 27, 2020
afa910b
Changelog
FrancescoC-unity Nov 27, 2020
de7b620
Rename the sunrise icon to fix typo, causing issue with 2x resolution…
johnpars Dec 1, 2020
5aec67f
Merge branch 'master' into hd/bugfix
sebastienlagarde Dec 2, 2020
12e69b1
[HDRP] Rename HDRP to HD Render Pipeline in menu item (#2819)
sebastienlagarde Dec 2, 2020
e2271c4
HDRP/Fix package version showing package after the last "verified" pa…
RSlysz Dec 2, 2020
630656c
Merge branch 'hd/bugfix' into HDRP/avoid-issues-with-wrong-transition…
FrancescoC-unity Dec 2, 2020
e3faa92
Revert bad changelog merge
FrancescoC-unity Dec 2, 2020
9ebeec2
Merge branch 'master' into HDRP/avoid-issues-with-wrong-transition-sh…
sebastienlagarde Dec 15, 2020
0e214a2
Update CHANGELOG.md
sebastienlagarde Dec 15, 2020
db856cf
Update CHANGELOG.md
sebastienlagarde Dec 15, 2020
d17656a
Merge branch 'hd/bugfix' into HDRP/avoid-issues-with-wrong-transition…
sebastienlagarde Dec 15, 2020
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 @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed probe volumes debug views.
- Fixed ShaderGraph Decal material not showing exposed properties.
- Fixed wrong coat normal space in shader graph
- Fixed issue with faulty shadow transition when view is close to an object under some aspect ratio conditions

### Changed
- Removed the material pass probe volumes evaluation mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,15 @@ int EvalShadow_GetSplitIndex(HDShadowContext shadowContext, int index, float3 po

// The above code will generate transitions on the whole cascade sphere boundary.
// It means that depending on the light and camera direction, sometimes the transition appears on the wrong side of the cascade
// To avoid that we attenuate the effect (lerp to 0.0) when view direction and cascade center to pixel vector face opposite directions.
// To avoid that we attenuate the effect (lerp very sharply to 0.0) when view direction and cascade center to pixel vector face opposite directions.
// This way you only get fade out on the right side of the cascade.
float3 viewDir = GetWorldSpaceViewDir(positionWS);
float cascDot = dot(viewDir, wposDir);
alpha = lerp(alpha, 0.0, saturate(cascDot * 4.0));

float cascDot = dot(viewDir, wposDir);
// At high border sizes the sharp lerp is noticeable, hence we need to lerp how sharpenss factor
// if we are below 80% we keep the very sharp transition.
float lerpSharpness = 8.0f + 512.0f * smoothstep(1.0f, 0.7f, border);// lerp(1024.0f, 8.0f, saturate(border - 0.8) / 0.2f);
alpha = lerp(alpha, 0.0, saturate(cascDot * lerpSharpness));
return shadowSplitIndex;
}

Expand Down Expand Up @@ -298,7 +301,7 @@ float EvalShadow_CascadedDepth_Dither_SplitIndex(HDShadowContext shadowContext,

/* We select what split we need to sample from */
float nextSplit = min(shadowSplitIndex + 1, cascadeCount - 1);
bool evalNextCascade = nextSplit != shadowSplitIndex && step(InterleavedGradientNoise(positionSS.xy, _TaaFrameInfo.z), alpha);
bool evalNextCascade = nextSplit != shadowSplitIndex && alpha > 0 && step(InterleavedGradientNoise(positionSS.xy, _TaaFrameInfo.z), alpha);

if (evalNextCascade)
{
Expand Down