Skip to content

Commit 64faf1f

Browse files
Adrian1066Evergreen
authored andcommitted
[content automatically redacted] touching PlatformDependent folder
1 parent 9e9c9bf commit 64faf1f

File tree

3 files changed

+191
-47
lines changed

3 files changed

+191
-47
lines changed

Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,27 @@ float4 EvaluateCookie_Punctual(LightLoopContext lightLoopContext, LightData ligh
408408
float z = positionLS.z;
409409
float r = light.range;
410410

411+
cookie.a = 1.0;
411412
// Box lights have no range attenuation, so we must clip manually.
412-
bool isInBounds = Max3(abs(positionCS.x), abs(positionCS.y), abs(z - 0.5 * r) - 0.5 * r + 1) <= light.boxLightSafeExtent;
413-
if (lightType != GPULIGHTTYPE_PROJECTOR_PYRAMID && lightType != GPULIGHTTYPE_PROJECTOR_BOX)
413+
if ( Max3(abs(positionCS.x), abs(positionCS.y), abs(z - 0.5 * r) - 0.5 * r + 1) > light.boxLightSafeExtent )
414414
{
415-
isInBounds = isInBounds && (dot(positionCS, positionCS) <= light.iesCut * light.iesCut);
415+
cookie.a = 0.0;
416+
}
417+
else
418+
{
419+
if (lightType != GPULIGHTTYPE_PROJECTOR_PYRAMID && lightType != GPULIGHTTYPE_PROJECTOR_BOX)
420+
{
421+
float iesCut = light.iesCut;
422+
if (dot(positionCS, positionCS) > (iesCut * iesCut))
423+
{
424+
cookie.a = 0;
425+
}
426+
}
416427
}
417-
418428
float2 positionNDC = positionCS * 0.5 + 0.5;
419429

420430
// Manually clamp to border (black).
421431
cookie.rgb = SampleCookie2D(positionNDC, light.cookieScaleOffset, lod);
422-
cookie.a = isInBounds ? 1.0 : 0.0;
423432
}
424433

425434
#else

Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/HDRP_Runtime_Graphics_Tests.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class HDRP_Runtime_Graphics_Tests
2525
)]
2626
[IgnoreGraphicsTest(
2727
"001-HDTemplate$",
28-
"Huge divergence: missing textures, wrong tonemapping, wrong reflections, etc. Needs further investigation.",
28+
"Small issue with incorrect rendering on bubble. Some half overflow issue and flickering artifacts. Will need image update when fixed",
2929
runtimePlatforms: new RuntimePlatform[] { RuntimePlatform.Switch }
3030
)]
3131
[IgnoreGraphicsTest(
@@ -44,22 +44,12 @@ public class HDRP_Runtime_Graphics_Tests
4444
"",
4545
graphicsDeviceTypes: new GraphicsDeviceType[] { GraphicsDeviceType.Metal }
4646
)]
47-
[IgnoreGraphicsTest(
48-
"002-HDMaterials$",
49-
"Multiple materials are fully black or completely missing.",
50-
runtimePlatforms: new RuntimePlatform[] { RuntimePlatform.Switch }
51-
)]
5247
[IgnoreGraphicsTest(
5348
"004-CloudsFlaresDecals$",
5449
"Area with cloud-coverage is blue on Intel-based MacOS (CI).",
5550
graphicsDeviceTypes: new[] { GraphicsDeviceType.Metal },
5651
architectures: new [] { Architecture.X64 }
5752
)]
58-
[IgnoreGraphicsTest(
59-
"006-Compositor$",
60-
"Quite different compositing results from the reference (strong shadows on the BG + character not-so blue).",
61-
runtimePlatforms: new RuntimePlatform[] { RuntimePlatform.Switch }
62-
)]
6353
[IgnoreGraphicsTest(
6454
"007-BasicAPV$",
6555
"https://jira.unity3d.com/browse/UUM-54029",
@@ -69,12 +59,12 @@ public class HDRP_Runtime_Graphics_Tests
6959
[IgnoreGraphicsTest(
7060
"011-HighQualityLines$",
7161
"Getting NVN_QUEUE_GET_ERROR_RESULT_GPU_ERROR_MMU_FAULT GPU Error. Needs further investigation.",
72-
runtimePlatforms: new RuntimePlatform[] { RuntimePlatform.Switch }
62+
runtimePlatforms: new RuntimePlatform[] { RuntimePlatform.Switch, RuntimePlatform.Switch2 }
7363
)]
7464
[IgnoreGraphicsTest(
7565
"012-SVL_Check$",
7666
"https://jira.unity3d.com/browse/UUM-70791",
77-
runtimePlatforms: new RuntimePlatform[] { RuntimePlatform.PS4, RuntimePlatform.PS5, RuntimePlatform.Switch }
67+
runtimePlatforms: new RuntimePlatform[] { RuntimePlatform.PS4, RuntimePlatform.PS5, RuntimePlatform.Switch, RuntimePlatform.Switch2 }
7868
)]
7969
public IEnumerator Run(SceneGraphicsTestCase testCase)
8070
{

0 commit comments

Comments
 (0)