From 9bdadcded757cce100e1b053155a5850fac0a072 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Mon, 20 Apr 2020 20:08:32 +0200 Subject: [PATCH 1/3] Fix unneeded cookie texture allocation for cone stop lights --- .../Runtime/Lighting/LightLoop/LightLoop.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs index a81ef06827e..5149e87da21 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs @@ -2720,7 +2720,8 @@ internal void ReserveCookieAtlasTexture(HDAdditionalLightData hdLightData, Light break; case HDLightType.Spot: // Projectors lights must always have a cookie texture. - m_TextureCaches.lightCookieManager.ReserveSpace(light?.cookie ?? Texture2D.whiteTexture); + if (hdLightData.spotLightShape != SpotLightShape.Cone) + m_TextureCaches.lightCookieManager.ReserveSpace(light?.cookie ?? Texture2D.whiteTexture); break; case HDLightType.Area: // Only rectnagles can have cookies From fb8e6cbfa2582c7c6f19044fb9757f0ebe9b988c Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Mon, 20 Apr 2020 20:09:36 +0200 Subject: [PATCH 2/3] Updated changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7f493cbbd3d..7199a81536c 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -550,6 +550,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed PBR shader ZTest rendering in deferred. - Replaced commands incompatible with async compute in light list build process. - Diffusion Profile and Material references in HDRP materials are now correctly exported to unity packages. Note that the diffusion profile or the material references need to be edited once before this can work properly. +- Fixed unneeded cookie texture allocation for cone stop lights. ### Changed - Improve MIP selection for decals on Transparents From ef23c0a36e94f455b2c3b3adb1e44b77196d2b83 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Mon, 20 Apr 2020 20:13:31 +0200 Subject: [PATCH 3/3] Fix cone spot light cookie --- .../Runtime/Lighting/LightLoop/LightLoop.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs index 5149e87da21..d8fc4cd3d03 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs @@ -2720,7 +2720,7 @@ internal void ReserveCookieAtlasTexture(HDAdditionalLightData hdLightData, Light break; case HDLightType.Spot: // Projectors lights must always have a cookie texture. - if (hdLightData.spotLightShape != SpotLightShape.Cone) + if (hdLightData.spotLightShape != SpotLightShape.Cone || light?.cookie != null) m_TextureCaches.lightCookieManager.ReserveSpace(light?.cookie ?? Texture2D.whiteTexture); break; case HDLightType.Area: