diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 3d491d4abcc..996b1d5d1fc 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -886,6 +886,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - PBR Sky now doesn't go black when going below sea level, but it instead freezes calculation as if on the horizon. - Fixed an issue with quality setting foldouts not opening when clicking on them (1253088). - Shutter speed can now be changed by dragging the mouse over the UI label (case 1245007). +- Remove the 'Point Cube Size' for cookie, use the Cubemap size directly. ## [7.1.1] - 2019-09-05 diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs index 50418520794..5cbdefb0ea0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs @@ -138,7 +138,10 @@ public class GeneralSection public static readonly GUIContent cookieSizeContent = EditorGUIUtility.TrTextContent("Cookie Size", "Specifies the maximum size for the individual 2D cookies that HDRP uses for Directional and Spot Lights."); public static readonly GUIContent cookieTextureArraySizeContent = EditorGUIUtility.TrTextContent("Texture Array Size", "Sets the maximum Texture Array size for the 2D cookies HDRP uses for Directional and Spot Lights. Higher values allow HDRP to use more cookies concurrently on screen."); +#if UNITY_2020_1_OR_NEWER +#else public static readonly GUIContent pointCoockieSizeContent = EditorGUIUtility.TrTextContent("Point Cookie Size", "Specifies the maximum size for the Cube cookies HDRP uses for Point Lights."); +#endif public static readonly GUIContent pointCookieTextureArraySizeContent = EditorGUIUtility.TrTextContent("Cubemap Array Size", "Sets the maximum Texture Array size for the Cube cookies HDRP uses for Directional and Spot Lights. Higher values allow HDRP to use more cookies concurrently on screen."); public static readonly GUIContent maxPlanarReflectionOnScreen = EditorGUIUtility.TrTextContent("Max Planar Reflection On Screen", "Sets the maximum number of the Planar Reflection HDRP can handle on screen at once."); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs index d6cc7c9766b..f5f7250977e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -242,7 +242,10 @@ static void Drawer_SectionCookies(SerializedHDRenderPipelineAsset serialized, Ed if (EditorGUI.EndChangeCheck()) serialized.renderPipelineSettings.lightLoopSettings.cookieAtlasLastValidMip.intValue = Mathf.Clamp(serialized.renderPipelineSettings.lightLoopSettings.cookieAtlasLastValidMip.intValue, 0, Texture2DAtlas.maxMipLevelPadding); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.lightLoopSettings.cookieFormat, Styles.cookieAtlasFormatContent); +#if UNITY_2020_1_OR_NEWER +#else EditorGUILayout.PropertyField(serialized.renderPipelineSettings.lightLoopSettings.pointCookieSize, Styles.pointCoockieSizeContent); +#endif EditorGUI.BeginChangeCheck(); } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedGlobalLightLoopSettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedGlobalLightLoopSettings.cs index 344000baf94..28ac5734030 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedGlobalLightLoopSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedGlobalLightLoopSettings.cs @@ -10,7 +10,10 @@ class SerializedGlobalLightLoopSettings public SerializedProperty cookieAtlasSize; public SerializedProperty cookieFormat; public SerializedProperty cookieAtlasLastValidMip; +#if UNITY_2020_1_OR_NEWER +#else public SerializedProperty pointCookieSize; +#endif public SerializedProperty reflectionProbeCacheSize; public SerializedProperty reflectionCubemapSize; public SerializedProperty reflectionCacheCompressed; @@ -32,7 +35,10 @@ public SerializedGlobalLightLoopSettings(SerializedProperty root) cookieAtlasSize = root.Find((GlobalLightLoopSettings s) => s.cookieAtlasSize); cookieFormat = root.Find((GlobalLightLoopSettings s) => s.cookieFormat); cookieAtlasLastValidMip = root.Find((GlobalLightLoopSettings s) => s.cookieAtlasLastValidMip); +#if UNITY_2020_1_OR_NEWER +#else pointCookieSize = root.Find((GlobalLightLoopSettings s) => s.pointCookieSize); +#endif reflectionProbeCacheSize = root.Find((GlobalLightLoopSettings s) => s.reflectionProbeCacheSize); reflectionCubemapSize = root.Find((GlobalLightLoopSettings s) => s.reflectionCubemapSize); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs index 5832815bcf2..6ec4c4c7bb4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs @@ -36,7 +36,10 @@ class LightCookieManager // Structure for cookies used by directional and spotlights PowerOfTwoTextureAtlas m_CookieAtlas; +#if UNITY_2020_1_OR_NEWER +#else int m_CookieCubeResolution; +#endif // During the light loop, when reserving space for the cookies (first part of the light loop) the atlas // can run out of space, in this case, we set to true this flag which will trigger a re-layouting of the @@ -64,7 +67,10 @@ public LightCookieManager(HDRenderPipelineAsset hdAsset, int maxCacheSize) m_CookieAtlas = new PowerOfTwoTextureAtlas(cookieAtlasSize, gLightLoopSettings.cookieAtlasLastValidMip, cookieFormat, name: "Cookie Atlas (Punctual Lights)", useMipMap: true); +#if UNITY_2020_1_OR_NEWER +#else m_CookieCubeResolution = (int)gLightLoopSettings.pointCookieSize; +#endif } public void NewFrame() @@ -303,7 +309,11 @@ public Vector4 FetchAreaCookie(CommandBuffer cmd, Texture cookie, Texture ies) if (width < k_MinCookieSize || height < k_MinCookieSize) return Vector4.zero; - int projectionSize = 2*(int)Mathf.Max((float)m_CookieCubeResolution, Mathf.Max((float)cookie.width, (float)ies.width)); +#if UNITY_2020_1_OR_NEWER + int projectionSize = 2 * (int)Mathf.Max((float)cookie.width, (float)ies.width); +#else + int projectionSize = 2 * (int)Mathf.Max((float)m_CookieCubeResolution, Mathf.Max((float)cookie.width, (float)ies.width)); +#endif if (!m_CookieAtlas.IsCached(out var scaleBias, cookie, ies) && !m_NoMoreSpace) Debug.LogError($"Area Light cookie texture {cookie} & {ies} can't be fetched without having reserved. You can try to increase the cookie atlas resolution in the HDRP settings."); @@ -386,7 +396,11 @@ public Vector4 FetchCubeCookie(CommandBuffer cmd, Texture cookie) Debug.Assert(cookie != null); Debug.Assert(cookie.dimension == TextureDimension.Cube); - int projectionSize = 2*(int)Mathf.Max((float)m_CookieCubeResolution, (float)cookie.width); +#if UNITY_2020_1_OR_NEWER + int projectionSize = 2 * cookie.width; +#else + int projectionSize = 2 * (int)Mathf.Max((float)m_CookieCubeResolution, (float)cookie.width); +#endif if (projectionSize < k_MinCookieSize) return Vector4.zero; @@ -411,7 +425,11 @@ public Vector4 FetchCubeCookie(CommandBuffer cmd, Texture cookie, Texture ies) Debug.Assert(cookie.dimension == TextureDimension.Cube); Debug.Assert(ies.dimension == TextureDimension.Cube); - int projectionSize = 2*(int)Mathf.Max((float)m_CookieCubeResolution, (float)cookie.width); +#if UNITY_2020_1_OR_NEWER + int projectionSize = 2 * cookie.width; +#else + int projectionSize = 2 * (int)Mathf.Max((float)m_CookieCubeResolution, (float)cookie.width); +#endif if (projectionSize < k_MinCookieSize) return Vector4.zero; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs index 39522c8fa87..a644fae0248 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs @@ -141,8 +141,11 @@ public struct GlobalLightLoopSettings public CookieAtlasResolution cookieAtlasSize; /// Cookie atlas graphics format. public CookieAtlasGraphicsFormat cookieFormat; +#if UNITY_2020_1_OR_NEWER +#else /// Cookie atlas resolution for point lights. public CubeCookieResolution pointCookieSize; +#endif /// Last valid mip for cookie atlas. public int cookieAtlasLastValidMip; // We keep this property for the migration code (we need to know how many cookies we could have before).