Skip to content

Commit 94b4d40

Browse files
eh-unityEvergreen
authored andcommitted
Fix overblown sky on some hw.
1 parent 820dc41 commit 94b4d40

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ class PrecomputationData
6868

6969
RTHandle m_AtmosphericScatteringLut;
7070

71+
// BUG: https://jira.unity3d.com/browse/UUM-86915 RwTex3D outputs red. Disable on some devices as a workaround.
72+
bool m_EnableAtmosphericScatteringBlur;
73+
7174
bool IsWorldSpace() => m_InScatteredRadianceTables != null;
7275

7376
RTHandle AllocateGroundIrradianceTable()
@@ -150,6 +153,13 @@ public void Allocate(BuiltinSkyParameters builtinParams)
150153
colorFormat: s_ColorFormat,
151154
enableRandomWrite: true,
152155
name: "AtmosphericScatteringLUT");
156+
157+
// BUG: https://jira.unity3d.com/browse/UUM-86915
158+
m_EnableAtmosphericScatteringBlur = !(s_ColorFormat == GraphicsFormat.B10G11R11_UFloatPack32 &&
159+
SystemInfo.graphicsDeviceName.Contains("Graphics") &&
160+
(SystemInfo.graphicsDeviceName.Contains("HD") || // and UHD
161+
SystemInfo.graphicsDeviceName.Contains("Iris") ||
162+
SystemInfo.graphicsDeviceName.Contains("Xe")));
153163
}
154164
}
155165

@@ -269,10 +279,14 @@ internal void RenderAtmosphericScatteringLut(BuiltinSkyParameters builtinParams)
269279
// Perform a blur pass on the buffer to reduce resolution artefacts
270280
cmd.SetComputeTextureParam(s_SkyLUTGenerator, s_AtmosphericScatteringBlurKernel, HDShaderIDs._AtmosphericScatteringLUT_RW, m_AtmosphericScatteringLut);
271281

272-
cmd.DispatchCompute(s_SkyLUTGenerator, s_AtmosphericScatteringBlurKernel,
273-
1,
274-
1,
275-
(int)PbrSkyConfig.AtmosphericScatteringLutDepth);
282+
if(m_EnableAtmosphericScatteringBlur)
283+
{
284+
cmd.DispatchCompute(s_SkyLUTGenerator, s_AtmosphericScatteringBlurKernel,
285+
1,
286+
1,
287+
(int)PbrSkyConfig.AtmosphericScatteringLutDepth);
288+
}
289+
276290
}
277291

278292
public void BindGlobalBuffers(CommandBuffer cmd)

0 commit comments

Comments
 (0)