Skip to content

Commit 1f82f6d

Browse files
YvainRaeymaekersEvergreen
authored andcommitted
[UUM-119276] Fixed sky contribution missing in fog when sky occlusion is enabled
1 parent f084a93 commit 1f82f6d

23 files changed

+2648
-3
lines changed

Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,18 +911,24 @@ void EvaluateAdaptiveProbeVolume(in float3 posWS, in float3 normalWS, in float3
911911
void EvaluateAdaptiveProbeVolume(in float3 posWS, in float2 positionSS, out float3 bakeDiffuseLighting)
912912
{
913913
APVResources apvRes = FillAPVResources();
914-
915914
posWS = AddNoiseToSamplingPosition(posWS, positionSS, 1);
916915
posWS -= _APVWorldOffset;
917916

917+
float3 ambientProbe = EvaluateAmbientProbe(0);
918+
918919
float3 uvw;
919920
if (TryToGetPoolUVW(apvRes, posWS, 0, 0, uvw))
920921
{
921922
bakeDiffuseLighting = SAMPLE_TEXTURE3D_LOD(apvRes.L0_L1Rx, s_linear_clamp_sampler, uvw, 0).rgb;
923+
if (_APVSkyOcclusionWeight > 0)
924+
{
925+
float skyOcclusionL0 = kSHBasis0 * SAMPLE_TEXTURE3D_LOD(apvRes.SkyOcclusionL0L1, s_linear_clamp_sampler, uvw, 0).x;
926+
bakeDiffuseLighting += ambientProbe * skyOcclusionL0;
927+
}
922928
}
923929
else
924930
{
925-
bakeDiffuseLighting = EvaluateAmbientProbe(0);
931+
bakeDiffuseLighting = ambientProbe;
926932
}
927933
}
928934

Tests/SRPTests/Projects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2125_APV_Fog_SkyOcclusion.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)