From 7bbf2b3f7302d872416086323f9c5c2ca3ed37ae Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Tue, 17 Mar 2020 12:14:15 +0100 Subject: [PATCH 01/84] [8.x.x Backport]Fixed the MaxLightCount being display when the light volume debug menu is on ColorAndEdge. (#6210) * Fixed the MaxLightCount being display when the light volume debug menu is on ColorAndEdge. * Update CHANGELOG.md Co-authored-by: sebastienlagarde --- .../CHANGELOG.md | 1 + .../Runtime/Debug/DebugDisplay.cs | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index fc3ec33f7b5..f46b8484614 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the HDRP asset migration code not being called after an upgrade of the package - Fixed draw renderers custom pass out of bound exception - Fixed an issue with emissive light meshes not being in the RAS. +- Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 8f34f033a72..16db54faa1b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -905,14 +905,11 @@ void RegisterLightingDebug() list.Add(new DebugUI.BoolField { displayName = "Display Light Volumes", getter = () => data.lightingDebugSettings.displayLightVolumes, setter = value => data.lightingDebugSettings.displayLightVolumes = value, onValueChanged = RefreshLightingDebug }); if (data.lightingDebugSettings.displayLightVolumes) { - list.Add(new DebugUI.Container + list.Add(new DebugUI.EnumField { displayName = "Light Volume Debug Type", getter = () => (int)data.lightingDebugSettings.lightVolumeDebugByCategory, setter = value => data.lightingDebugSettings.lightVolumeDebugByCategory = (LightVolumeDebug)value, autoEnum = typeof(LightVolumeDebug), getIndex = () => data.lightVolumeDebugTypeEnumIndex, setIndex = value => data.lightVolumeDebugTypeEnumIndex = value, onValueChanged = RefreshLightingDebug }); + if (data.lightingDebugSettings.lightVolumeDebugByCategory == LightVolumeDebug.Gradient) { - children = - { - new DebugUI.EnumField { displayName = "Light Volume Debug Type", getter = () => (int)data.lightingDebugSettings.lightVolumeDebugByCategory, setter = value => data.lightingDebugSettings.lightVolumeDebugByCategory = (LightVolumeDebug)value, autoEnum = typeof(LightVolumeDebug), getIndex = () => data.lightVolumeDebugTypeEnumIndex, setIndex = value => data.lightVolumeDebugTypeEnumIndex = value }, - new DebugUI.UIntField { displayName = "Max Debug Light Count", getter = () => (uint)data.lightingDebugSettings.maxDebugLightCount, setter = value => data.lightingDebugSettings.maxDebugLightCount = value, min = () => 0, max = () => 24, incStep = 1 } - } - }); + list.Add(new DebugUI.UIntField { displayName = "Max Debug Light Count", getter = () => (uint)data.lightingDebugSettings.maxDebugLightCount, setter = value => data.lightingDebugSettings.maxDebugLightCount = value, min = () => 0, max = () => 24, incStep = 1 }); + } } list.Add(new DebugUI.BoolField { displayName = "Display Cookie Atlas", getter = () => data.lightingDebugSettings.displayCookieAtlas, setter = value => data.lightingDebugSettings.displayCookieAtlas = value, onValueChanged = RefreshLightingDebug}); From b7d15299a7f70438b52bbe9cb5c67c8a7051e41e Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Tue, 17 Mar 2020 12:22:34 +0100 Subject: [PATCH 02/84] [8.x.x Backport] Update documentation to mention more explicitely the lack of support of vertex animation (#6204) * Update documentation to mention more explicitely the lack of support of vertex animation * Update Ray-Tracing-Getting-Started.md Co-authored-by: sebastienlagarde --- .../Documentation~/Ray-Tracing-Getting-Started.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md index 8b86928e41e..1a7c0d7e3ce 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md @@ -184,7 +184,10 @@ d3d12: generating mipmaps for array textures is not yet supported. There is no support for ray tracing on other platform than DX12 for now. HDRP ray tracing in Unity 2019.3 has the following limitations: -- Does not support deformers (skin, vertex animation). +- Does not support deformers (skinning, blend shape, alembic, vertex animation). +- Does not support tessellation +- Does not support per pixel displacement (parallax occlusion mapping, height map, depth offset) - Does not support VFX and Terrain. - Does not support several of HDRP's Materials. This includes Hair, StackLit, Eye, and AxF Materials. - Does not have correct culling for shadows. It uses frustum culling instead. +HDRP ray tracing in Unity 2020.1 and above add support for skinning, blend shapes and alembic. From 409f4dfb89388f094b9d3bdc2a5e0569385f8e90 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Tue, 17 Mar 2020 11:24:53 +0000 Subject: [PATCH 03/84] [8.x.x Backport] Make subsection in decal debug menu to specify "affect transparents" (#6202) * Make subsection in decal debug menu * changelog --- .../CHANGELOG.md | 1 + .../Runtime/Debug/DebugDisplay.cs | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f46b8484614..f6c93624f75 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -454,6 +454,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix Inf source in LTC for area lights. - Fixed alpha clipping test (comparison was '>', now '>=') - Fixed preview camera (eg. shader graph preview) when path tracing is on +- Fixed issue with unclear naming of debug menu for decals. ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 16db54faa1b..55f128b5413 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -88,7 +88,7 @@ public class DebugDisplaySettings : IDebugData DebugUI.Widget[] m_DebugMaterialItems; DebugUI.Widget[] m_DebugLightingItems; DebugUI.Widget[] m_DebugRenderingItems; - DebugUI.Widget[] m_DebugDecalsItems; + DebugUI.Widget[] m_DebugDecalsAffectingTransparentItems; static GUIContent[] s_LightingFullScreenDebugStrings = null; static int[] s_LightingFullScreenDebugValues = null; @@ -648,7 +648,7 @@ void RefreshLightingDebug(DebugUI.Field field, T value) void RefreshDecalsDebug(DebugUI.Field field, T value) { - UnregisterDebugItems(k_PanelDecals, m_DebugDecalsItems); + UnregisterDebugItems(k_PanelDecals, m_DebugDecalsAffectingTransparentItems); RegisterDecalsDebug(); } @@ -1049,14 +1049,17 @@ void RegisterRenderingDebug() void RegisterDecalsDebug() { - m_DebugDecalsItems = new DebugUI.Widget[] + m_DebugDecalsAffectingTransparentItems = new DebugUI.Widget[] { new DebugUI.BoolField { displayName = "Display Atlas", getter = () => data.decalsDebugSettings.displayAtlas, setter = value => data.decalsDebugSettings.displayAtlas = value}, new DebugUI.UIntField { displayName = "Mip Level", getter = () => data.decalsDebugSettings.mipLevel, setter = value => data.decalsDebugSettings.mipLevel = value, min = () => 0u, max = () => (uint)(RenderPipelineManager.currentPipeline as HDRenderPipeline).GetDecalAtlasMipCount() } }; var panel = DebugManager.instance.GetPanel(k_PanelDecals, true); - panel.children.Add(m_DebugDecalsItems); + var decalAffectingTransparent = new DebugUI.Container() { displayName = "Decals Affecting Transparent Objects" }; + decalAffectingTransparent.children.Add(m_DebugDecalsAffectingTransparentItems); + + panel.children.Add(decalAffectingTransparent); } internal void RegisterDebug() @@ -1071,7 +1074,7 @@ internal void RegisterDebug() internal void UnregisterDebug() { - UnregisterDebugItems(k_PanelDecals, m_DebugDecalsItems); + UnregisterDebugItems(k_PanelDecals, m_DebugDecalsAffectingTransparentItems); DisableProfilingRecorders(); UnregisterDebugItems(k_PanelDisplayStats, m_DebugDisplayStatsItems); From 22acc8c17097338b160185ffdf1c036ba173dd19 Mon Sep 17 00:00:00 2001 From: skhiat <55133890+skhiat@users.noreply.github.com> Date: Tue, 17 Mar 2020 12:36:56 +0100 Subject: [PATCH 04/84] Support cookie on light backing for Disc Area Light #6138 --- .../CHANGELOG.md | 1 + .../Editor/Lighting/HDLightUI.cs | 2 +- .../Lighting/GlobalIlluminationUtils.cs | 33 ++++++++++++------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f6c93624f75..2094eb85075 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added the exposure sliders to the planar reflection probe preview - Added a warning and workaround instructions that appear when you enable XR single-pass after the first frame with the XR SDK. - Added an "enable" toggle to the SSR volume component. +- Added support of cookie baking and add support on Disc light. ### Fixed - Fix Changelog diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index 715877c2ca0..9f427379e68 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -725,7 +725,7 @@ static void DrawEmissionContent(SerializedHDLight serialized, Editor owner) ShowCookieTextureWarnings(serialized.settings.cookie); } - else if (serialized.areaLightShape == AreaLightShape.Rectangle) + else if (serialized.areaLightShape == AreaLightShape.Rectangle || serialized.areaLightShape == AreaLightShape.Disc) { EditorGUILayout.ObjectField( serialized.areaLightCookie, s_Styles.areaLightCookie ); ShowCookieTextureWarnings(serialized.areaLightCookie.objectReferenceValue as Texture); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs index 2600a50aa02..97aa015afac 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs @@ -14,6 +14,11 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) add = HDUtils.s_DefaultHDAdditionalLightData; } + Cookie cookie; + LightmapperUtils.Extract(light, out cookie); + lightDataGI.cookieID = cookie.instanceID; + lightDataGI.cookieScale = cookie.scale; + // TODO: Currently color temperature is not handled at runtime, need to expose useColorTemperature publicly Color cct = new Color(1.0f, 1.0f, 1.0f); #if UNITY_EDITOR @@ -50,9 +55,9 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) #else lightDataGI.mode = LightmapperUtils.Extract(light.bakingOutput.lightmapBakeType); #endif - + lightDataGI.shadow = (byte)(light.shadows != LightShadows.None ? 1 : 0); - + HDLightType lightType = add.ComputeLightType(light); if (lightType != HDLightType.Area) { @@ -67,11 +72,11 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) switch (lightType) { case HDLightType.Directional: - lightDataGI.orientation.SetLookRotation(light.transform.forward, Vector3.up); - lightDataGI.position = Vector3.zero; + lightDataGI.orientation = light.transform.rotation; + lightDataGI.position = light.transform.position; lightDataGI.range = 0.0f; - lightDataGI.coneAngle = 0.0f; - lightDataGI.innerConeAngle = 0.0f; + lightDataGI.coneAngle = add.shapeWidth; + lightDataGI.innerConeAngle = add.shapeHeight; #if UNITY_EDITOR lightDataGI.shape0 = light.shadows != LightShadows.None ? (Mathf.Deg2Rad * light.shadowAngle) : 0.0f; #else @@ -80,6 +85,8 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) lightDataGI.shape1 = 0.0f; lightDataGI.type = UnityEngine.Experimental.GlobalIllumination.LightType.Directional; lightDataGI.falloff = FalloffType.Undefined; + lightDataGI.coneAngle = add.shapeWidth; + lightDataGI.innerConeAngle = add.shapeHeight; break; case HDLightType.Spot: @@ -105,7 +112,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) spot.innerConeAngle = light.spotAngle * Mathf.Deg2Rad * add.innerSpotPercent01; spot.falloff = add.applyRangeAttenuation ? FalloffType.InverseSquared : FalloffType.InverseSquaredNoRangeAttenuation; spot.angularFalloff = AngularFalloffType.AnalyticAndInnerAngle; - lightDataGI.Init(ref spot); + lightDataGI.Init(ref spot, ref cookie); lightDataGI.shape1 = (float)AngularFalloffType.AnalyticAndInnerAngle; } break; @@ -124,7 +131,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) pyramid.angle = light.spotAngle * Mathf.Deg2Rad; pyramid.aspectRatio = add.aspectRatio; pyramid.falloff = add.applyRangeAttenuation ? FalloffType.InverseSquared : FalloffType.InverseSquaredNoRangeAttenuation; - lightDataGI.Init(ref pyramid); + lightDataGI.Init(ref pyramid, ref cookie); } break; @@ -141,7 +148,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) box.range = light.range; box.width = add.shapeWidth; box.height = add.shapeHeight; - lightDataGI.Init(ref box); + lightDataGI.Init(ref box, ref cookie); } break; @@ -152,7 +159,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) break; case HDLightType.Point: - lightDataGI.orientation = Quaternion.identity; + lightDataGI.orientation = light.transform.rotation; lightDataGI.position = light.transform.position; lightDataGI.range = light.range; lightDataGI.coneAngle = 0.0f; @@ -167,7 +174,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) lightDataGI.type = UnityEngine.Experimental.GlobalIllumination.LightType.Point; lightDataGI.falloff = add.applyRangeAttenuation ? FalloffType.InverseSquared : FalloffType.InverseSquaredNoRangeAttenuation; break; - + case HDLightType.Area: switch (add.areaLightShape) { @@ -187,12 +194,13 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) // TEMP: for now, if we bake a rectangle type this will disable the light for runtime, need to speak with GI team about it! lightDataGI.type = UnityEngine.Experimental.GlobalIllumination.LightType.Rectangle; lightDataGI.falloff = add.applyRangeAttenuation ? FalloffType.InverseSquared : FalloffType.InverseSquaredNoRangeAttenuation; + lightDataGI.cookieID = add.areaLightCookie ? add.areaLightCookie.GetInstanceID() : 0; break; case AreaLightShape.Tube: lightDataGI.InitNoBake(lightDataGI.instanceID); break; - + case AreaLightShape.Disc: lightDataGI.orientation = light.transform.rotation; lightDataGI.position = light.transform.position; @@ -209,6 +217,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) // TEMP: for now, if we bake a rectangle type this will disable the light for runtime, need to speak with GI team about it! lightDataGI.type = UnityEngine.Experimental.GlobalIllumination.LightType.Disc; lightDataGI.falloff = add.applyRangeAttenuation ? FalloffType.InverseSquared : FalloffType.InverseSquaredNoRangeAttenuation; + lightDataGI.cookieID = add.areaLightCookie ? add.areaLightCookie.GetInstanceID() : 0; break; default: From bef451effb3b7d316ed872938a9976778b32d694 Mon Sep 17 00:00:00 2001 From: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Date: Tue, 17 Mar 2020 12:39:32 +0100 Subject: [PATCH 05/84] Hdrp /lookdev/fix crash on adding volume as viewed game object #6129 --- .../Editor/LookDev/Stage.cs | 4 ++++ .../Runtime/Volume/Volume.cs | 19 ++++++++++++------- .../CHANGELOG.md | 1 + 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs b/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs index 5c05703393c..0d96a34a421 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs @@ -196,6 +196,10 @@ static void InitAddedObjectsRecursively(GameObject go) var lineRenderer = go.GetComponent(); if (lineRenderer != null) lineRenderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; + + var volumes = go.GetComponents(); + foreach (var volume in volumes) + volume.UpdateLayer(); //force update of layer now as the Update can be called after we unregister volume from manager foreach (Transform child in go.transform) InitAddedObjectsRecursively(child.gameObject); diff --git a/com.unity.render-pipelines.core/Runtime/Volume/Volume.cs b/com.unity.render-pipelines.core/Runtime/Volume/Volume.cs index 09b01f8e33e..8d6c6283802 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/Volume.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/Volume.cs @@ -114,12 +114,7 @@ void Update() // real-time as the user could change it at any time in the editor or at runtime. // Because no event is raised when the layer changes, we have to track it on every // frame :/ - int layer = gameObject.layer; - if (layer != m_PreviousLayer) - { - VolumeManager.instance.UpdateVolumeLayer(this, m_PreviousLayer, layer); - m_PreviousLayer = layer; - } + UpdateLayer(); // Same for priority. We could use a property instead, but it doesn't play nice with the // serialization system. Using a custom Attribute/PropertyDrawer for a property is @@ -127,11 +122,21 @@ void Update() // our case. if (priority != m_PreviousPriority) { - VolumeManager.instance.SetLayerDirty(layer); + VolumeManager.instance.SetLayerDirty(gameObject.layer); m_PreviousPriority = priority; } } + internal void UpdateLayer() + { + int layer = gameObject.layer; + if (layer != m_PreviousLayer) + { + VolumeManager.instance.UpdateVolumeLayer(this, m_PreviousLayer, layer); + m_PreviousLayer = layer; + } + } + #if UNITY_EDITOR // TODO: Look into a better volume previsualization system List m_TempColliders; diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 2094eb85075..b350bcfd80d 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed draw renderers custom pass out of bound exception - Fixed an issue with emissive light meshes not being in the RAS. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. +- Fix LookDev issue when adding a GameObject containing a Volume into the LookDev's view. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. From c1d7ea10085b33a13a6f5a0e3fb75f08fb93eecb Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 17 Mar 2020 12:44:34 +0100 Subject: [PATCH 06/84] fixed changelog --- com.unity.render-pipelines.core/CHANGELOG.md | 1 + com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 59f069f3299..190ed5e3271 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -34,6 +34,7 @@ The version number for this package has increased due to a version update of a r - Fix LookDev EnvironmentLibrary tab when asset is deleted - Fix LookDev used Cubemap when asset is deleted - Fixed the definition of `rcp()` for GLES2. +- Fix LookDev issue when adding a GameObject containing a Volume into the LookDev's view. ### Changed - Restored usage of ENABLE_VR to fix compilation errors on some platforms. diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b350bcfd80d..2094eb85075 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -44,7 +44,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed draw renderers custom pass out of bound exception - Fixed an issue with emissive light meshes not being in the RAS. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. -- Fix LookDev issue when adding a GameObject containing a Volume into the LookDev's view. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. From 5c316e3a76e80ae3510ccb3092a9b4602990cb26 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Tue, 17 Mar 2020 11:48:27 +0000 Subject: [PATCH 07/84] Add smoothness remark (#6226) --- .../Documentation~/Refraction-in-HDRP.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Refraction-in-HDRP.md b/com.unity.render-pipelines.high-definition/Documentation~/Refraction-in-HDRP.md index 156970cfbf6..a693f3965b3 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Refraction-in-HDRP.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Refraction-in-HDRP.md @@ -18,6 +18,8 @@ To set up refraction on your Material, you need to do the following: For more information on the properties that control refraction, see [Surface Type](Surface-Type.html). +Note that, intuitively, the less smooth the material is for the refracting object the blurrier the refraction will be. + Settings up a Probe Proxy Volume is also necessary if you want to use screen space refraction effectively. This is because screen space refraction uses the Probe Proxy Volume to approximate the scene and find the correct refracted color. To obtain the best results, the proxy volume should approximate as much of the Scene where refracted rays are intended to land as possible. For more information on proxy volumes, see the [Reflection Proxy Volume](Reflection-Proxy-Volume.html) page. ## Refraction calculation From ea21c80ffa80bd0ae7e8b951db967512fcbebbdd Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Tue, 17 Mar 2020 09:11:28 -0400 Subject: [PATCH 08/84] Removed legacy VR code from HDRP #5923 --- .../CHANGELOG.md | 1 + .../Camera/HDCameraUI.Drawers.cs | 28 ------- .../RenderPipeline/Camera/HDCameraUI.Skin.cs | 13 --- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 4 +- .../Runtime/RenderPipeline/HDProfileId.cs | 2 + .../HDRenderPipeline.LightLoop.cs | 4 +- .../HDRenderPipeline.RenderGraph.cs | 4 +- .../HDRenderPipeline.RenderGraphUtils.cs | 9 +- .../RenderPipeline/HDRenderPipeline.cs | 27 +++--- .../RenderPass/CustomPass/CustomPassVolume.cs | 2 +- .../Runtime/RenderPipeline/Utility/HDUtils.cs | 6 -- .../Runtime/RenderPipeline/XR/XRPass.cs | 82 +++++-------------- .../Runtime/RenderPipeline/XR/XRSystem.cs | 80 +----------------- 13 files changed, 51 insertions(+), 211 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 2094eb85075..616693261c1 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. - Light dimmer can now get values higher than one and was renamed to multiplier in the UI. - Removed info box requesting volume component for Visual Environment and updated the documentation with the relevant information. +- Removed legacy VR code ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs index 1f44121f2a4..b4fe3f6cbbd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs @@ -18,7 +18,6 @@ enum Expandable Output = 1 << 2, Orthographic = 1 << 3, RenderLoop = 1 << 4, - XR = 1 << 5 } enum ProjectionType @@ -91,7 +90,6 @@ static HDCameraUI() SectionFrameSettings, SectionPhysicalSettings, SectionOutputSettings, - SectionXRSettings }; string key = $"HDRP:{typeof(HDCameraUI).Name}:ShutterSpeedState"; @@ -158,19 +156,6 @@ static HDCameraUI() ) ); - public static readonly CED.IDrawer SectionXRSettings = CED.Conditional( - (serialized, owner) => XRGraphics.tryEnable, - CED.FoldoutGroup( - xrSettingsHeaderContent, - Expandable.XR, - k_ExpandedState, - CED.Group( - Drawer_FieldVR, - Drawer_FieldTargetEye - ) - ) - ); - public static readonly CED.IDrawer SectionFrameSettings = CED.Conditional( (serialized, owner) => k_ExpandedState[Expandable.General], CED.Group((serialized, owner) => @@ -527,12 +512,6 @@ static void Drawer_CameraWarnings(SerializedHDCamera p, Editor owner) } } - static void Drawer_FieldVR(SerializedHDCamera p, Editor owner) - { - EditorGUILayout.PropertyField(p.baseCameraSettings.stereoSeparation, stereoSeparationContent); - EditorGUILayout.PropertyField(p.baseCameraSettings.stereoConvergence, stereoConvergenceContent); - } - #if ENABLE_MULTIPLE_DISPLAYS static void Drawer_SectionMultiDisplay(SerializedHDCamera p, Editor owner) { @@ -547,13 +526,6 @@ static void Drawer_SectionMultiDisplay(SerializedHDCamera p, Editor owner) #endif - static readonly int[] k_TargetEyeValues = { (int)StereoTargetEyeMask.Both, (int)StereoTargetEyeMask.Left, (int)StereoTargetEyeMask.Right, (int)StereoTargetEyeMask.None }; - - static void Drawer_FieldTargetEye(SerializedHDCamera p, Editor owner) - { - EditorGUILayout.IntPopup(p.baseCameraSettings.targetEye, k_TargetEyes, k_TargetEyeValues, targetEyeContent); - } - static MethodInfo k_DisplayUtility_GetDisplayIndices = Type.GetType("UnityEditor.DisplayUtility,UnityEditor") .GetMethod("GetDisplayIndices"); static int[] DisplayUtility_GetDisplayIndices() diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs index 1cc4d712f6e..f07b7951c06 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs @@ -8,7 +8,6 @@ static partial class HDCameraUI const string generalSettingsHeaderContent = "General"; const string physicalSettingsHeaderContent = "Physical"; const string outputSettingsHeaderContent = "Output"; - const string xrSettingsHeaderContent = "XR"; const string clippingPlaneMultiFieldTitle = "Clipping Planes"; @@ -63,18 +62,6 @@ static partial class HDCameraUI static readonly GUIContent targetDisplayContent = EditorGUIUtility.TrTextContent("Target Display"); #endif - - static readonly GUIContent stereoSeparationContent = EditorGUIUtility.TrTextContent("Stereo Separation"); - static readonly GUIContent stereoConvergenceContent = EditorGUIUtility.TrTextContent("Stereo Convergence"); - static readonly GUIContent targetEyeContent = EditorGUIUtility.TrTextContent("Target Eye"); - static readonly GUIContent[] k_TargetEyes = //order must match k_TargetEyeValues - { - new GUIContent("Both"), - new GUIContent("Left"), - new GUIContent("Right"), - new GUIContent("None (Main Display)"), - }; - static readonly GUIContent[] antialiasingModeNames = { new GUIContent("No Anti-aliasing"), diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 72bc6142ad7..e6a375931e6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -601,12 +601,13 @@ internal void SetupGlobalParams(CommandBuffer cmd, int frameCount) float exposureMultiplierForProbes = 1.0f / Mathf.Max(probeRangeCompressionFactor, 1e-6f); cmd.SetGlobalFloat(HDShaderIDs._ProbeExposureScale, exposureMultiplierForProbes); - // TODO: qualify this code with xr.singlePassEnabled when compute shaders can use keywords + // XRTODO: qualify this code with xr.singlePassEnabled when compute shaders can use keywords if (true) { cmd.SetGlobalInt(HDShaderIDs._XRViewCount, viewCount); // Convert AoS to SoA for GPU constant buffer until we can use StructuredBuffer via command buffer + // XRTODO: use the new API and remove this code for (int i = 0; i < viewCount; i++) { m_XRViewMatrix[i] = m_XRViewConstants[i].viewMatrix; @@ -1119,6 +1120,7 @@ void UpdateVolumeAndPhysicalParameters() Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj) { // Do not add extra jitter in VR (micro-variations from head tracking are enough) + // XRTODO: make this a setting in GlobalXRSettings instead of assuming if (xr.enabled) { taaJitter = Vector4.zero; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs index 815883bdd96..71b595144f0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDProfileId.cs @@ -140,6 +140,8 @@ internal enum HDProfileId // Misc VolumeUpdate, CustomPassVolumeUpdate, + + // XR XROcclusionMesh, XRMirrorView, XRCustomMirrorView, diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs index 0284bc0988c..12bf3e37994 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs @@ -254,9 +254,9 @@ RenderGraphResource RenderSSR( RenderGraph renderGraph, //var settings = hdCamera.volumeStack.GetComponent(); //if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.RayTracing) && settings.rayTracing.value) //{ - // hdCamera.xr.StartSinglePass(cmd, hdCamera.camera, renderContext); + // hdCamera.xr.StartSinglePass(cmd); // RenderRayTracedReflections(hdCamera, cmd, m_SsrLightingTexture, renderContext, m_FrameCount); - // hdCamera.xr.StopSinglePass(cmd, hdCamera.camera, renderContext); + // hdCamera.xr.StopSinglePass(cmd); //} //else { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs index bc4914815f2..dcb7d0f13e6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs @@ -107,9 +107,9 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest, // TODO RENDERGRAPH //using (new ProfilingSample(cmd, "Render screen space shadows", CustomSamplerId.ScreenSpaceShadows.GetSampler())) //{ - // hdCamera.xr.StartSinglePass(cmd, camera, renderContext); + // hdCamera.xr.StartSinglePass(cmd); // RenderScreenSpaceShadows(hdCamera, cmd); - // hdCamera.xr.StopSinglePass(cmd, camera, renderContext); + // hdCamera.xr.StopSinglePass(cmd); //} var volumetricLighting = VolumetricLightingPass(m_RenderGraph, hdCamera, volumetricDensityBuffer, m_TileAndClusterData.bigTileLightList, shadowResult, m_FrameCount); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs index fce18652309..c9d55df10eb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraphUtils.cs @@ -66,7 +66,6 @@ Color GetColorBufferClearColor(HDCamera hdCamera) // XR Specific class XRRenderingPassData { - public Camera camera; public XRPass xr; } @@ -76,13 +75,12 @@ internal static void StartXRSinglePass(RenderGraph renderGraph, HDCamera hdCamer { using (var builder = renderGraph.AddRenderPass("Start XR single-pass", out var passData)) { - passData.camera = hdCamera.camera; passData.xr = hdCamera.xr; builder.SetRenderFunc( (XRRenderingPassData data, RenderGraphContext context) => { - data.xr.StartSinglePass(context.cmd, data.camera, context.renderContext); + data.xr.StartSinglePass(context.cmd); }); } } @@ -94,13 +92,12 @@ internal static void StopXRSinglePass(RenderGraph renderGraph, HDCamera hdCamera { using (var builder = renderGraph.AddRenderPass("Stop XR single-pass", out var passData)) { - passData.camera = hdCamera.camera; passData.xr = hdCamera.xr; builder.SetRenderFunc( (XRRenderingPassData data, RenderGraphContext context) => { - data.xr.StopSinglePass(context.cmd, data.camera, context.renderContext); + data.xr.StopSinglePass(context.cmd); }); } } @@ -122,7 +119,7 @@ void EndCameraXR(RenderGraph renderGraph, HDCamera hdCamera) builder.SetRenderFunc( (EndCameraXRPassData data, RenderGraphContext ctx) => { - data.hdCamera.xr.EndCamera(ctx.cmd, data.hdCamera, ctx.renderContext); + data.hdCamera.xr.EndCamera(ctx.cmd, data.hdCamera); }); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 588c26a742f..70aa8c2de0c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1938,16 +1938,16 @@ AOVRequestData aovRequest return; } - hdCamera.xr.StartSinglePass(cmd, camera, renderContext); + hdCamera.xr.StartSinglePass(cmd); ClearBuffers(hdCamera, cmd); // Render XR occlusion mesh to depth buffer early in the frame to improve performance if (hdCamera.xr.enabled && m_Asset.currentPlatformRenderPipelineSettings.xrSettings.occlusionMesh) { - hdCamera.xr.StopSinglePass(cmd, camera, renderContext); + hdCamera.xr.StopSinglePass(cmd); hdCamera.xr.RenderOcclusionMeshes(cmd, m_SharedRTManager.GetDepthStencilBuffer(hdCamera.frameSettings.IsEnabled(FrameSettingsField.MSAA))); - hdCamera.xr.StartSinglePass(cmd, camera, renderContext); + hdCamera.xr.StartSinglePass(cmd); } // Bind the custom color/depth before the first custom pass @@ -2053,7 +2053,7 @@ AOVRequestData aovRequest msaaEnabled ? m_SharedRTManager.GetStencilBuffer(msaaEnabled) : null, m_SharedRTManager.GetCoarseStencilBuffer(), cmd); - hdCamera.xr.StopSinglePass(cmd, camera, renderContext); + hdCamera.xr.StopSinglePass(cmd); var buildLightListTask = new HDGPUAsyncTask("Build light list", ComputeQueueType.Background); // It is important that this task is in the same queue as the build light list due to dependency it has on it. If really need to move it, put an extra fence to make sure buildLightListTask has finished. @@ -2167,9 +2167,9 @@ void Callback(CommandBuffer c, HDCamera cam) RenderContactShadows(hdCamera, cmd); PushFullScreenDebugTexture(hdCamera, cmd, m_ContactShadowBuffer, FullScreenDebugMode.ContactShadows); - hdCamera.xr.StartSinglePass(cmd, camera, renderContext); + hdCamera.xr.StartSinglePass(cmd); RenderScreenSpaceShadows(hdCamera, cmd); - hdCamera.xr.StopSinglePass(cmd, camera, renderContext); + hdCamera.xr.StopSinglePass(cmd); if (hdCamera.frameSettings.VolumeVoxelizationRunsAsync()) { @@ -2203,7 +2203,7 @@ void Callback(CommandBuffer c, HDCamera cam) SSRTask.End(cmd, hdCamera); } - hdCamera.xr.StartSinglePass(cmd, camera, renderContext); + hdCamera.xr.StartSinglePass(cmd); RenderDeferredLighting(hdCamera, cmd); @@ -2355,7 +2355,7 @@ void Callback(CommandBuffer c, HDCamera cam) RenderDebug(hdCamera, cmd, cullingResults); - hdCamera.xr.StopSinglePass(cmd, hdCamera.camera, renderContext); + hdCamera.xr.StopSinglePass(cmd); using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.BlitToFinalRTDevBuildOnly))) { @@ -2370,7 +2370,7 @@ void Callback(CommandBuffer c, HDCamera cam) } // XR mirror view and blit do device - hdCamera.xr.EndCamera(cmd, hdCamera, renderContext); + hdCamera.xr.EndCamera(cmd, hdCamera); // Send all the color graphics buffer to client systems if required. SendColorGraphicsBuffer(cmd, hdCamera); @@ -2483,10 +2483,7 @@ void SetupCameraProperties(HDCamera hdCamera, ScriptableRenderContext renderCont renderContext.ExecuteCommandBuffer(cmd); cmd.Clear(); - if (hdCamera.xr.legacyMultipassEnabled) - renderContext.SetupCameraProperties(hdCamera.camera, hdCamera.xr.enabled, hdCamera.xr.legacyMultipassEye); - else - renderContext.SetupCameraProperties(hdCamera.camera, hdCamera.xr.enabled); + renderContext.SetupCameraProperties(hdCamera.camera, hdCamera.xr.enabled); } void InitializeGlobalResources(ScriptableRenderContext renderContext) @@ -3819,9 +3816,9 @@ void RenderSSR(HDCamera hdCamera, CommandBuffer cmd, ScriptableRenderContext ren bool usesRaytracedReflections = hdCamera.frameSettings.IsEnabled(FrameSettingsField.RayTracing) && settings.rayTracing.value; if (usesRaytracedReflections) { - hdCamera.xr.StartSinglePass(cmd, hdCamera.camera, renderContext); + hdCamera.xr.StartSinglePass(cmd); RenderRayTracedReflections(hdCamera, cmd, m_SsrLightingTexture, renderContext, m_FrameCount); - hdCamera.xr.StopSinglePass(cmd, hdCamera.camera, renderContext); + hdCamera.xr.StopSinglePass(cmd); } else { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs index d62fec80b74..debfc10836e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs @@ -218,7 +218,7 @@ internal void AggregateCullingParameters(ref ScriptableCullingParameters culling // By default we don't want the culling to return any objects cullingParameters.cullingMask = 0; - cullingParameters.cullingOptions &= CullingOptions.Stereo; // We just keep stereo if enabled and clear the other flags + cullingParameters.cullingOptions = CullingOptions.None; foreach (var injectionPoint in injectionPoints) GetActivePassVolume(injectionPoint)?.AggregateCullingParameters(ref cullingParameters, hdCamera); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs index 59ca696143d..d21b1fcb6f6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs @@ -945,11 +945,5 @@ internal static void DisplayUnsupportedAPIMessage(string graphicAPI = null) string msg = "Platform " + currentPlatform + " with device " + graphicAPI + " is not supported with High Definition Render Pipeline, no rendering will occur"; DisplayUnsupportedMessage(msg); } - - internal static void DisplayUnsupportedXRMessage() - { - string msg = "AR/VR devices are not supported, no rendering will occur"; - DisplayUnsupportedMessage(msg); - } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs index 1bf30769c78..a4523b22549 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs @@ -37,17 +37,6 @@ internal struct XRView internal readonly Rect viewport; internal readonly Mesh occlusionMesh; internal readonly int textureArraySlice; - internal readonly Camera.StereoscopicEye legacyStereoEye; - - internal XRView(Camera camera, Camera.StereoscopicEye eye, int dstSlice) - { - projMatrix = camera.GetStereoProjectionMatrix(eye); - viewMatrix = camera.GetStereoViewMatrix(eye); - viewport = camera.pixelRect; - occlusionMesh = null; - textureArraySlice = dstSlice; - legacyStereoEye = eye; - } internal XRView(Matrix4x4 proj, Matrix4x4 view, Rect vp, int dstSlice) { @@ -56,7 +45,6 @@ internal XRView(Matrix4x4 proj, Matrix4x4 view, Rect vp, int dstSlice) viewport = vp; occlusionMesh = null; textureArraySlice = dstSlice; - legacyStereoEye = (Camera.StereoscopicEye)(-1); } #if ENABLE_VR && ENABLE_XR_MODULE @@ -67,7 +55,6 @@ internal XRView(XRDisplaySubsystem.XRRenderPass renderPass, XRDisplaySubsystem.X viewport = renderParameter.viewport; occlusionMesh = renderParameter.occlusionMesh; textureArraySlice = renderParameter.textureArraySlice; - legacyStereoEye = (Camera.StereoscopicEye)(-1); // Convert viewport from normalized to screen space viewport.x *= renderPass.renderTargetDesc.width; @@ -116,10 +103,6 @@ class XRPass CustomMirrorView customMirrorView = null; internal void SetCustomMirrorView(CustomMirrorView callback) => customMirrorView = callback; - // Legacy multipass support - internal int legacyMultipassEye { get => (int)views[0].legacyStereoEye; } - internal bool legacyMultipassEnabled { get => enabled && !singlePassEnabled && legacyMultipassEye >= 0; } - internal static XRPass Create(XRPassCreateInfo createInfo) { XRPass passInfo = GenericPool.Get(); @@ -148,11 +131,6 @@ internal static XRPass Create(XRPassCreateInfo createInfo) return passInfo; } - internal void AddView(Camera camera, Camera.StereoscopicEye eye, int textureArraySlice = -1) - { - AddViewInternal(new XRView(camera, eye, textureArraySlice)); - } - internal void AddView(Matrix4x4 proj, Matrix4x4 view, Rect vp, int textureArraySlice = -1) { AddViewInternal(new XRView(proj, view, vp, textureArraySlice)); @@ -212,28 +190,14 @@ internal void AddViewInternal(XRView xrView) /// /// Enable XR single-pass rendering. /// - public void StartSinglePass(CommandBuffer cmd, Camera camera, ScriptableRenderContext renderContext) + public void StartSinglePass(CommandBuffer cmd) { if (enabled) { // Required for some legacy shaders (text for example) cmd.SetViewProjectionMatrices(GetViewMatrix(), GetProjMatrix()); - if (camera.stereoEnabled) - { - // Reset scissor and viewport for C++ stereo code - cmd.DisableScissorRect(); - cmd.SetViewport(camera.pixelRect); - - renderContext.ExecuteCommandBuffer(cmd); - cmd.Clear(); - - if (legacyMultipassEnabled) - renderContext.StartMultiEye(camera, legacyMultipassEye); - else - renderContext.StartMultiEye(camera); - } - else if (singlePassEnabled) + if (singlePassEnabled) { if (viewCount <= TextureXR.slices) { @@ -251,39 +215,35 @@ public void StartSinglePass(CommandBuffer cmd, Camera camera, ScriptableRenderCo /// /// Disable XR single-pass rendering. /// - public void StopSinglePass(CommandBuffer cmd, Camera camera, ScriptableRenderContext renderContext) + public void StopSinglePass(CommandBuffer cmd) { if (enabled) { - if (camera.stereoEnabled) - { - renderContext.ExecuteCommandBuffer(cmd); - cmd.Clear(); - renderContext.StopMultiEye(camera); - } - else - { - cmd.DisableShaderKeyword("STEREO_INSTANCING_ON"); - cmd.SetInstanceMultiplier(1); - } + cmd.DisableShaderKeyword("STEREO_INSTANCING_ON"); + cmd.SetInstanceMultiplier(1); } } - internal void EndCamera(CommandBuffer cmd, HDCamera hdCamera, ScriptableRenderContext renderContext) + /// Obsolete + [Obsolete] + public void StartSinglePass(CommandBuffer cmd, Camera camera, ScriptableRenderContext renderContext) + { + StartSinglePass(cmd); + } + + /// Obsolete + [Obsolete] + public void StopSinglePass(CommandBuffer cmd, Camera camera, ScriptableRenderContext renderContext) + { + StopSinglePass(cmd); + } + + internal void EndCamera(CommandBuffer cmd, HDCamera hdCamera) { if (!enabled) return; - StopSinglePass(cmd, hdCamera.camera, renderContext); - - // Legacy VR - push to XR headset and/or display mirror - if (hdCamera.camera.stereoEnabled) - { - if (legacyMultipassEnabled) - renderContext.StereoEndRender(hdCamera.camera, legacyMultipassEye, legacyMultipassEye == 1); - else - renderContext.StereoEndRender(hdCamera.camera); - } + StopSinglePass(cmd); // Callback for custom mirror view if (customMirrorView != null) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs index f2c85d785d9..a6f2ac37fa8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs @@ -1,6 +1,5 @@ -// XRSystem is where information about XR views and passes are read from 3 exclusive sources: +// XRSystem is where information about XR views and passes are read from 2 exclusive sources: // - XRDisplaySubsystem from the XR SDK -// - the 'legacy' C++ stereo rendering path and XRSettings // - custom XR layout (only internal for now) using System; @@ -92,12 +91,7 @@ internal int GetMaxViews() // XRTODO : replace by API from XR SDK, assume we have 2 slices until then maxViews = 2; } - else #endif - { - if (XRGraphics.stereoRenderingMode == XRGraphics.StereoRenderingMode.SinglePassInstanced) - maxViews = 2; - } if (testModeEnabled) maxViews = Math.Max(maxViews, 2); @@ -107,7 +101,7 @@ internal int GetMaxViews() internal List<(Camera, XRPass)> SetupFrame(Camera[] cameras, bool singlePassAllowed, bool singlePassTestModeActive) { - bool xrSdkActive = RefreshXrSdk(); + bool xrActive = RefreshXrSdk(); if (framePasses.Count > 0) { @@ -125,9 +119,6 @@ internal int GetMaxViews() if (camera == null) continue; - // Read XR SDK or legacy settings - bool xrEnabled = xrSdkActive || (camera.stereoEnabled && XRGraphics.enabled); - // Enable XR layout only for gameview camera bool xrSupported = camera.cameraType == CameraType.Game && camera.targetTexture == null; @@ -135,24 +126,12 @@ internal int GetMaxViews() { // custom layout in used } - else if (xrEnabled && xrSupported) + else if (xrActive && xrSupported) { // Disable vsync on the main display when rendering to a XR device QualitySettings.vSyncCount = 0; - if (XRGraphics.renderViewportScale != 1.0f) - { - Debug.LogWarning("RenderViewportScale has no effect with this render pipeline. Use dynamic resolution instead."); - } - - if (xrSdkActive) - { - CreateLayoutFromXrSdk(camera, singlePassAllowed); - } - else - { - CreateLayoutLegacyStereo(camera); - } + CreateLayoutFromXrSdk(camera, singlePassAllowed); } else { @@ -200,57 +179,6 @@ bool RefreshXrSdk() return false; } - void CreateLayoutLegacyStereo(Camera camera) - { - if (!camera.TryGetCullingParameters(true, out var cullingParams)) - { - Debug.LogError("Unable to get Culling Parameters from camera!"); - return; - } - - var passCreateInfo = new XRPassCreateInfo - { - multipassId = 0, - cullingPassId = 0, - cullingParameters = cullingParams, - renderTarget = camera.targetTexture, - customMirrorView = null - }; - - if (XRGraphics.stereoRenderingMode == XRGraphics.StereoRenderingMode.MultiPass) - { - if (camera.stereoTargetEye == StereoTargetEyeMask.Both || camera.stereoTargetEye == StereoTargetEyeMask.Left) - { - var pass = XRPass.Create(passCreateInfo); - pass.AddView(camera, Camera.StereoscopicEye.Left, 0); - - AddPassToFrame(camera, pass); - passCreateInfo.multipassId++; - } - - - if (camera.stereoTargetEye == StereoTargetEyeMask.Both || camera.stereoTargetEye == StereoTargetEyeMask.Right) - { - var pass = XRPass.Create(passCreateInfo); - pass.AddView(camera, Camera.StereoscopicEye.Right, 1); - - AddPassToFrame(camera, pass); - } - } - else - { - var pass = XRPass.Create(passCreateInfo); - - if (camera.stereoTargetEye == StereoTargetEyeMask.Both || camera.stereoTargetEye == StereoTargetEyeMask.Left) - pass.AddView(camera, Camera.StereoscopicEye.Left, 0); - - if (camera.stereoTargetEye == StereoTargetEyeMask.Both || camera.stereoTargetEye == StereoTargetEyeMask.Right) - pass.AddView(camera, Camera.StereoscopicEye.Right, 1); - - AddPassToFrame(camera, pass); - } - } - void CreateLayoutFromXrSdk(Camera camera, bool singlePassAllowed) { #if ENABLE_VR && ENABLE_XR_MODULE From daeb5fdfe0cdaf5b36b17b7be91d83e013b0197f Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Tue, 17 Mar 2020 09:15:14 -0400 Subject: [PATCH 09/84] Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file #5895 --- com.unity.render-pipelines.core/CHANGELOG.md | 1 + .../Runtime/Unity.RenderPipelines.Core.Runtime.asmdef | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 190ed5e3271..7f2fa1d9b33 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -35,6 +35,7 @@ The version number for this package has increased due to a version update of a r - Fix LookDev used Cubemap when asset is deleted - Fixed the definition of `rcp()` for GLES2. - Fix LookDev issue when adding a GameObject containing a Volume into the LookDev's view. +- Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file ### Changed - Restored usage of ENABLE_VR to fix compilation errors on some platforms. diff --git a/com.unity.render-pipelines.core/Runtime/Unity.RenderPipelines.Core.Runtime.asmdef b/com.unity.render-pipelines.core/Runtime/Unity.RenderPipelines.Core.Runtime.asmdef index e604c9ea9fc..dee97e1417e 100644 --- a/com.unity.render-pipelines.core/Runtime/Unity.RenderPipelines.Core.Runtime.asmdef +++ b/com.unity.render-pipelines.core/Runtime/Unity.RenderPipelines.Core.Runtime.asmdef @@ -21,11 +21,6 @@ "expression": "1.0.0", "define": "ENABLE_XR_MODULE" }, - { - "name": "com.unity.modules.xr", - "expression": "1.0.0", - "define": "ENABLE_XR_MODULE" - }, { "name": "com.unity.inputsystem", "expression": "0.0.0", From e13c5860da9aeff837164d8873f26adb4f35ab02 Mon Sep 17 00:00:00 2001 From: Evgenii Golubev Date: Tue, 17 Mar 2020 07:36:45 -0700 Subject: [PATCH 10/84] Improve light clipping and culling #2 #4711 --- .../CHANGELOG.md | 2 + .../Runtime/Lighting/LightEvaluation.hlsl | 14 +++- .../Runtime/Lighting/LightLoop/LightLoop.cs | 70 +++++++++---------- 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 616693261c1..cd48cffb9b7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -50,6 +50,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Light dimmer can now get values higher than one and was renamed to multiplier in the UI. - Removed info box requesting volume component for Visual Environment and updated the documentation with the relevant information. - Removed legacy VR code +- Add range-based clipping to box lights (case 1178780) +- Improve area light culling (case 1085873) ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl index e35df0cc382..51237056a5b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl @@ -362,7 +362,12 @@ float4 EvaluateCookie_Punctual(LightLoopContext lightLoopContext, LightData ligh // Perform orthographic or perspective projection. float perspectiveZ = (lightType != GPULIGHTTYPE_PROJECTOR_BOX) ? positionLS.z : 1.0; float2 positionCS = positionLS.xy / perspectiveZ; - bool isInBounds = Max3(abs(positionCS.x), abs(positionCS.y), 1.0 - positionLS.z) <= light.boxLightSafeExtent; + + float z = positionLS.z; + float r = light.range; + + // Box lights have no range attenuation, so we must clip manually. + bool isInBounds = Max3(abs(positionCS.x), abs(positionCS.y), abs(z - 0.5 * r) - 0.5 * r + 1) <= light.boxLightSafeExtent; // Remap the texture coordinates from [-1, 1]^2 to [0, 1]^2. float2 positionNDC = positionCS * 0.5 + 0.5; @@ -390,7 +395,12 @@ float4 EvaluateCookie_Punctual(LightLoopContext lightLoopContext, LightData ligh // Perform orthographic or perspective projection. float perspectiveZ = (lightType != GPULIGHTTYPE_PROJECTOR_BOX) ? positionLS.z : 1.0; float2 positionCS = positionLS.xy / perspectiveZ; - bool isInBounds = Max3(abs(positionCS.x), abs(positionCS.y), 1.0 - positionLS.z) <= light.boxLightSafeExtent; + + float z = positionLS.z; + float r = light.range; + + // Box lights have no range attenuation, so we must clip manually. + bool isInBounds = Max3(abs(positionCS.x), abs(positionCS.y), abs(z - 0.5 * r) - 0.5 * r + 1) <= light.boxLightSafeExtent; // Manually clamp to border (black). cookie.a = isInBounds ? 1.0 : 0.0; 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 f969fa4d690..b2d2439d737 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 @@ -105,33 +105,33 @@ class LightDefinitions [GenerateHLSL] struct SFiniteLightBound { - public Vector3 boxAxisX; - public Vector3 boxAxisY; - public Vector3 boxAxisZ; - public Vector3 center; // a center in camera space inside the bounding volume of the light source. - public Vector2 scaleXY; - public float radius; + public Vector3 boxAxisX; // Scaled by the extents (half-size) + public Vector3 boxAxisY; // Scaled by the extents (half-size) + public Vector3 boxAxisZ; // Scaled by the extents (half-size) + public Vector3 center; // Center of the bounds (box) in camera space + public Vector2 scaleXY; // Scale applied to the top of the box to turn it into a truncated pyramid + public float radius; // Circumscribed sphere for the bounds (box) }; [GenerateHLSL] struct LightVolumeData { - public Vector3 lightPos; - public uint lightVolume; + public Vector3 lightPos; // Of light's "origin" + public uint lightVolume; // Type index - public Vector3 lightAxisX; - public uint lightCategory; + public Vector3 lightAxisX; // Normalized + public uint lightCategory; // Category index - public Vector3 lightAxisY; - public float radiusSq; + public Vector3 lightAxisY; // Normalized + public float radiusSq; // Cone and sphere: light range squared - public Vector3 lightAxisZ; // spot +Z axis - public float cotan; + public Vector3 lightAxisZ; // Normalized + public float cotan; // Cone: cotan of the aperture (half-angle) - public Vector3 boxInnerDist; + public Vector3 boxInnerDist; // Box: extents (half-size) of the inner box public uint featureFlags; - public Vector3 boxInvRange; + public Vector3 boxInvRange; // Box: 1 / (OuterBoxExtents - InnerBoxExtents) public float unused2; }; @@ -1630,63 +1630,61 @@ void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLig else if (gpuLightType == GPULightType.Tube) { Vector3 dimensions = new Vector3(lightDimensions.x + 2 * range, 2 * range, 2 * range); // Omni-directional - Vector3 extents = 0.5f * dimensions; + Vector3 extents = 0.5f * dimensions; + Vector3 centerVS = positionVS; - bound.center = positionVS; + bound.center = centerVS; bound.boxAxisX = extents.x * xAxisVS; bound.boxAxisY = extents.y * yAxisVS; bound.boxAxisZ = extents.z * zAxisVS; + bound.radius = extents.magnitude; bound.scaleXY.Set(1.0f, 1.0f); - bound.radius = extents.magnitude; - lightVolumeData.lightPos = positionVS; + lightVolumeData.lightPos = centerVS; lightVolumeData.lightAxisX = xAxisVS; lightVolumeData.lightAxisY = yAxisVS; lightVolumeData.lightAxisZ = zAxisVS; - lightVolumeData.boxInnerDist = new Vector3(lightDimensions.x, 0, 0); - lightVolumeData.boxInvRange.Set(1.0f / range, 1.0f / range, 1.0f / range); + lightVolumeData.boxInvRange.Set(1.0f / extents.x, 1.0f / extents.y, 1.0f / extents.z); lightVolumeData.featureFlags = (uint)LightFeatureFlags.Area; } else if (gpuLightType == GPULightType.Rectangle) { Vector3 dimensions = new Vector3(lightDimensions.x + 2 * range, lightDimensions.y + 2 * range, range); // One-sided - Vector3 extents = 0.5f * dimensions; - Vector3 centerVS = positionVS + extents.z * zAxisVS; + Vector3 extents = 0.5f * dimensions; + Vector3 centerVS = positionVS + extents.z * zAxisVS; - bound.center = centerVS; + bound.center = centerVS; bound.boxAxisX = extents.x * xAxisVS; bound.boxAxisY = extents.y * yAxisVS; bound.boxAxisZ = extents.z * zAxisVS; + bound.radius = extents.magnitude; bound.scaleXY.Set(1.0f, 1.0f); - bound.radius = extents.magnitude; - lightVolumeData.lightPos = centerVS; + lightVolumeData.lightPos = centerVS; lightVolumeData.lightAxisX = xAxisVS; lightVolumeData.lightAxisY = yAxisVS; lightVolumeData.lightAxisZ = zAxisVS; - lightVolumeData.boxInnerDist = extents; - lightVolumeData.boxInvRange.Set(Mathf.Infinity, Mathf.Infinity, Mathf.Infinity); + lightVolumeData.boxInvRange.Set(1.0f / extents.x, 1.0f / extents.y, 1.0f / extents.z); lightVolumeData.featureFlags = (uint)LightFeatureFlags.Area; } else if (gpuLightType == GPULightType.ProjectorBox) { Vector3 dimensions = new Vector3(lightDimensions.x, lightDimensions.y, range); // One-sided - Vector3 extents = 0.5f * dimensions; - Vector3 centerVS = positionVS + extents.z * zAxisVS; + Vector3 extents = 0.5f * dimensions; + Vector3 centerVS = positionVS + extents.z * zAxisVS; - bound.center = centerVS; + bound.center = centerVS; bound.boxAxisX = extents.x * xAxisVS; bound.boxAxisY = extents.y * yAxisVS; bound.boxAxisZ = extents.z * zAxisVS; - bound.radius = extents.magnitude; + bound.radius = extents.magnitude; bound.scaleXY.Set(1.0f, 1.0f); - lightVolumeData.lightPos = centerVS; + lightVolumeData.lightPos = centerVS; lightVolumeData.lightAxisX = xAxisVS; lightVolumeData.lightAxisY = yAxisVS; lightVolumeData.lightAxisZ = zAxisVS; - lightVolumeData.boxInnerDist = extents; - lightVolumeData.boxInvRange.Set(Mathf.Infinity, Mathf.Infinity, Mathf.Infinity); + lightVolumeData.boxInvRange.Set(1.0f / extents.x, 1.0f / extents.y, 1.0f / extents.z); lightVolumeData.featureFlags = (uint)LightFeatureFlags.Punctual; } else if (gpuLightType == GPULightType.Disc) From 5542b5be1c60681aa0c1327547672e0407dcf9f5 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Tue, 17 Mar 2020 15:42:56 +0100 Subject: [PATCH 11/84] Hdrp/fix/decal material ui errors #6225 --- .../CHANGELOG.md | 1 + .../Editor/Material/Unlit/HDShaderGUI.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index cd48cffb9b7..874c89ac4b8 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed draw renderers custom pass out of bound exception - Fixed an issue with emissive light meshes not being in the RAS. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. +- Fixed error in the console when switching shader to decal in the material UI. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/HDShaderGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/HDShaderGUI.cs index ae84659a07e..0c887989336 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/HDShaderGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/HDShaderGUI.cs @@ -80,9 +80,13 @@ protected static void ResetMaterialCustomRenderQueue(Material material) throw new ArgumentException("Unknown SurfaceType"); } - float sortingPriority = material.GetFloat(kTransparentSortPriority); - bool alphaTest = material.GetFloat(kAlphaCutoffEnabled) > 0.5f; - material.renderQueue = HDRenderQueue.ChangeType(targetQueueType, (int)sortingPriority, alphaTest); + // Decal doesn't have properties to compute the render queue + if (material.HasProperty(kTransparentSortPriority) && material.HasProperty(kAlphaCutoffEnabled)) + { + float sortingPriority = material.GetFloat(kTransparentSortPriority); + bool alphaTest = material.GetFloat(kAlphaCutoffEnabled) > 0.5f; + material.renderQueue = HDRenderQueue.ChangeType(targetQueueType, (int)sortingPriority, alphaTest); + } } readonly static string[] floatPropertiesToSynchronize = { From c698ea4ce58c9f9708a341fd52b3909116b39912 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 17 Mar 2020 17:40:57 +0100 Subject: [PATCH 12/84] Fix z-fighting in sceneview when scene lighting is off (#6213) * Do not override the depth state of transparent materials in RenderDebugView * Changelog * Changelog - add case number Co-authored-by: sebastienlagarde --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 874c89ac4b8..681abd58ce2 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -460,6 +460,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed alpha clipping test (comparison was '>', now '>=') - Fixed preview camera (eg. shader graph preview) when path tracing is on - Fixed issue with unclear naming of debug menu for decals. +- Fixed z-fighting in scene view when scene lighting is off (case 1203927) ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 70aa8c2de0c..57fb32f0858 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -3259,7 +3259,7 @@ void RenderDebugViewMaterial(CullingResults cull, HDCamera hdCamera, ScriptableR DrawOpaqueRendererList(renderContext, cmd, hdCamera.frameSettings, rendererListOpaque); // Render forward transparent - var rendererListTransparent = RendererList.Create(CreateTransparentRendererListDesc(cull, hdCamera.camera, m_AllTransparentPassNames, m_CurrentRendererConfigurationBakedLighting, stateBlock: m_DepthStateOpaque)); + var rendererListTransparent = RendererList.Create(CreateTransparentRendererListDesc(cull, hdCamera.camera, m_AllTransparentPassNames, m_CurrentRendererConfigurationBakedLighting)); DrawTransparentRendererList(renderContext, cmd, hdCamera.frameSettings, rendererListTransparent); } } From cb56b4f4256803fff3dca017430217dbbcc96f01 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 17 Mar 2020 17:44:10 +0100 Subject: [PATCH 13/84] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 681abd58ce2..fe462f32de6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue with emissive light meshes not being in the RAS. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. - Fixed error in the console when switching shader to decal in the material UI. +- Fixed z-fighting in scene view when scene lighting is off (case 1203927) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. @@ -460,7 +461,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed alpha clipping test (comparison was '>', now '>=') - Fixed preview camera (eg. shader graph preview) when path tracing is on - Fixed issue with unclear naming of debug menu for decals. -- Fixed z-fighting in scene view when scene lighting is off (case 1203927) ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled From 52bf1d59228e997bb5d40180469987f860ff7b7c Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Tue, 17 Mar 2020 17:12:37 +0000 Subject: [PATCH 14/84] Mention default post processing in default volumes. (#6233) --- .../Documentation~/Post-Processing-Main.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Main.md b/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Main.md index 8bb78aaff8a..65b33496234 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Main.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Main.md @@ -2,7 +2,7 @@ The High Definition Render Pipeline (HDRP) includes its own purpose-built implementation for [post-processing](https://docs.unity3d.com/Manual/PostProcessingOverview.html). This is built into HDRP, so you do not need to install any other package. -This implementation uses the [Volume](Volumes.html) system. You add post-processing effects to your Camera in the same way you add any other [Volume Override](Volume-Components.html). +This implementation uses the [Volume](Volumes.html) system. You add post-processing effects to your Camera in the same way you add any other [Volume Override](Volume-Components.html). Note that HDRP already enables some post-processing effects in the [Default Settings Volume Profile](Default-Settings-Window.html). The images below show a Scene with and without HDRP post-processing. From 98c6578c884250a0fec6d6052855b0723b328a95 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Tue, 17 Mar 2020 18:35:26 +0000 Subject: [PATCH 15/84] Fix cubemap inspector so that thumbnail for cubemap work #6231 --- .../CHANGELOG.md | 1 + .../Lighting/Reflection/HDCubemapInspector.cs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index fe462f32de6..b0c876ff9b8 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. - Fixed error in the console when switching shader to decal in the material UI. - Fixed z-fighting in scene view when scene lighting is off (case 1203927) +- Fixed issue that prevented cubemap thumbnails from rendering. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs index 2f230b4f8ff..d160aab7c45 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs @@ -191,5 +191,22 @@ static void InitIcons() s_ExposureLow = EditorGUIUtility.IconContent("SceneViewLighting"); s_PreLabel = "preLabel"; } + public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height) + { + m_CameraDistance = 1.25f; + m_CameraPhi = Mathf.PI * 0.33f; + m_CameraTheta = Mathf.PI; + + InitPreview(); + + UpdateCamera(); + + m_PreviewUtility.ambientColor = Color.black; + m_PreviewUtility.BeginStaticPreview(new Rect(0, 0, width, height)); + m_PreviewUtility.DrawMesh(sphereMesh, Matrix4x4.identity, m_ReflectiveMaterial, 0); + m_PreviewUtility.camera.Render(); + + return m_PreviewUtility.EndStaticPreview(); + } } } From 5d5afe04d415d1d498275c1fa0a7c68facb32065 Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Tue, 17 Mar 2020 23:47:05 +0100 Subject: [PATCH 16/84] - Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. (#6197) Co-authored-by: sebastienlagarde --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b0c876ff9b8..e4b09b98534 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed error in the console when switching shader to decal in the material UI. - Fixed z-fighting in scene view when scene lighting is off (case 1203927) - Fixed issue that prevented cubemap thumbnails from rendering. +- Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs index bb03bb73132..5e8e5c21cce 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs @@ -438,7 +438,10 @@ internal void BuildRayTracingAccelerationStructure(HDCamera hdCamera) { Renderer currentRenderer = currentLOD.renderers[rendererIdx]; // Add this fella to the renderer list - m_RayTracingRendererReference.Add(currentRenderer.GetInstanceID(), 1); + // Unfortunately, we need to check that this renderer was not already pushed into the list (happens if the user uses the same mesh renderer + // for two LODs) + if (!m_RayTracingRendererReference.ContainsKey(currentRenderer.GetInstanceID())) + m_RayTracingRendererReference.Add(currentRenderer.GetInstanceID(), 1); } } } From fe0c42a732ef1b8fa669ad83591c8c17005db044 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Wed, 18 Mar 2020 10:55:53 +0000 Subject: [PATCH 17/84] [Backport 8.x.x] Fix some typos in the debug menu (#6249) * Backport renaming * changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Debug/DebugDisplay.cs | 4 ++-- .../Runtime/Material/Builtin/BuiltinData.cs | 8 ++++---- .../Runtime/Material/Builtin/BuiltinData.cs.hlsl | 8 ++++---- .../Runtime/Material/Builtin/BuiltinData.hlsl | 2 +- .../Runtime/Material/Eye/Eye.cs | 2 +- .../Runtime/Material/Fabric/Fabric.cs | 2 +- .../Runtime/Material/Hair/Hair.cs | 4 ++-- .../Runtime/Material/Lit/Lit.cs | 4 ++-- 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index e4b09b98534..6aa8ab30cf7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed z-fighting in scene view when scene lighting is off (case 1203927) - Fixed issue that prevented cubemap thumbnails from rendering. - Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. +- Fix some typos in the debug menu. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 55f128b5413..bcc96f54a63 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -606,7 +606,7 @@ void RegisterMaterialDebug() { var list = new List(); - list.Add(new DebugUI.EnumField { displayName = "Common Material Property", getter = () => (int)data.materialDebugSettings.debugViewMaterialCommonValue, setter = value => SetDebugViewCommonMaterialProperty((MaterialSharedProperty)value), autoEnum = typeof(MaterialSharedProperty), getIndex = () => (int)data.materialDebugSettings.debugViewMaterialCommonValue, setIndex = value => { data.ResetExclusiveEnumIndices(); data.materialDebugSettings.debugViewMaterialCommonValue = (MaterialSharedProperty)value; } }); + list.Add(new DebugUI.EnumField { displayName = "Common Material Properties", getter = () => (int)data.materialDebugSettings.debugViewMaterialCommonValue, setter = value => SetDebugViewCommonMaterialProperty((MaterialSharedProperty)value), autoEnum = typeof(MaterialSharedProperty), getIndex = () => (int)data.materialDebugSettings.debugViewMaterialCommonValue, setIndex = value => { data.ResetExclusiveEnumIndices(); data.materialDebugSettings.debugViewMaterialCommonValue = (MaterialSharedProperty)value; } }); list.Add( new DebugUI.EnumField { displayName = "Material", getter = () => (data.materialDebugSettings.debugViewMaterial[0]) == 0 ? 0 : data.materialDebugSettings.debugViewMaterial[1], setter = value => SetDebugViewMaterial(value), enumNames = MaterialDebugSettings.debugViewMaterialStrings, enumValues = MaterialDebugSettings.debugViewMaterialValues, getIndex = () => data.materialDebugSettings.materialEnumIndex, setIndex = value => { data.ResetExclusiveEnumIndices(); data.materialDebugSettings.materialEnumIndex = value; } }); list.Add( new DebugUI.EnumField { displayName = "Engine", getter = () => data.materialDebugSettings.debugViewEngine, setter = value => SetDebugViewEngine(value), enumNames = MaterialDebugSettings.debugViewEngineStrings, enumValues = MaterialDebugSettings.debugViewEngineValues, getIndex = () => data.engineEnumIndex, setIndex = value => { data.ResetExclusiveEnumIndices(); data.engineEnumIndex = value; } }); list.Add( new DebugUI.EnumField { displayName = "Attributes", getter = () => (int)data.materialDebugSettings.debugViewVarying, setter = value => SetDebugViewVarying((DebugViewVarying)value), autoEnum = typeof(DebugViewVarying), getIndex = () => data.attributesEnumIndex, setIndex = value => { data.ResetExclusiveEnumIndices(); data.attributesEnumIndex = value; } }); @@ -675,7 +675,7 @@ void RegisterLightingDebug() new DebugUI.BoolField { displayName = "Show Directional Lights", getter = () => data.lightingDebugSettings.showDirectionalLight, setter = value => data.lightingDebugSettings.showDirectionalLight = value }, new DebugUI.BoolField { displayName = "Show Punctual Lights", getter = () => data.lightingDebugSettings.showPunctualLight, setter = value => data.lightingDebugSettings.showPunctualLight = value }, new DebugUI.BoolField { displayName = "Show Area Lights", getter = () => data.lightingDebugSettings.showAreaLight, setter = value => data.lightingDebugSettings.showAreaLight = value }, - new DebugUI.BoolField { displayName = "Show Reflection Probe", getter = () => data.lightingDebugSettings.showReflectionProbe, setter = value => data.lightingDebugSettings.showReflectionProbe = value }, + new DebugUI.BoolField { displayName = "Show Reflection Probes", getter = () => data.lightingDebugSettings.showReflectionProbe, setter = value => data.lightingDebugSettings.showReflectionProbe = value }, } }); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs index b047bb30299..377f3658cf7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs @@ -25,9 +25,9 @@ public struct BuiltinData // We would prefer to split lighting and material information but for performance reasons, // those lighting information are fill // at the same time than material information. - [SurfaceDataAttributes("Bake Diffuse Lighting", false, true, FieldPrecision.Real)] + [SurfaceDataAttributes("Baked Diffuse Lighting", false, true, FieldPrecision.Real)] public Vector3 bakeDiffuseLighting; // This is the result of sampling lightmap/lightprobe/proxyvolume - [SurfaceDataAttributes("Back Bake Diffuse Lighting", false, true, FieldPrecision.Real)] + [SurfaceDataAttributes("Back Baked Diffuse Lighting", false, true, FieldPrecision.Real)] public Vector3 backBakeDiffuseLighting; // This is the result of sampling lightmap/lightprobe/proxyvolume from the back for transmission // Use for float instead of vector4 to ease the debug (no performance impact) @@ -45,7 +45,7 @@ public struct BuiltinData public Vector3 emissiveColor; // These is required for motion blur and temporalAA - [SurfaceDataAttributes("MotionVector", precision = FieldPrecision.Real)] + [SurfaceDataAttributes("Motion Vector", precision = FieldPrecision.Real)] public Vector2 motionVector; // Distortion @@ -55,7 +55,7 @@ public struct BuiltinData public float distortionBlur; // Define the color buffer mipmap level to use // Misc - [SurfaceDataAttributes("RenderingLayers")] + [SurfaceDataAttributes("Rendering Layers")] public uint renderingLayers; [SurfaceDataAttributes("Depth Offset")] diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs.hlsl index a40100d10ca..6c9cc02867d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.cs.hlsl @@ -8,8 +8,8 @@ // UnityEngine.Rendering.HighDefinition.Builtin+BuiltinData: static fields // #define DEBUGVIEW_BUILTIN_BUILTINDATA_OPACITY (100) -#define DEBUGVIEW_BUILTIN_BUILTINDATA_BAKE_DIFFUSE_LIGHTING (101) -#define DEBUGVIEW_BUILTIN_BUILTINDATA_BACK_BAKE_DIFFUSE_LIGHTING (102) +#define DEBUGVIEW_BUILTIN_BUILTINDATA_BAKED_DIFFUSE_LIGHTING (101) +#define DEBUGVIEW_BUILTIN_BUILTINDATA_BACK_BAKED_DIFFUSE_LIGHTING (102) #define DEBUGVIEW_BUILTIN_BUILTINDATA_SHADOWMASK_0 (103) #define DEBUGVIEW_BUILTIN_BUILTINDATA_SHADOWMASK_1 (104) #define DEBUGVIEW_BUILTIN_BUILTINDATA_SHADOWMASK_2 (105) @@ -58,11 +58,11 @@ void GetGeneratedBuiltinDataDebug(uint paramId, BuiltinData builtindata, inout f case DEBUGVIEW_BUILTIN_BUILTINDATA_OPACITY: result = builtindata.opacity.xxx; break; - case DEBUGVIEW_BUILTIN_BUILTINDATA_BAKE_DIFFUSE_LIGHTING: + case DEBUGVIEW_BUILTIN_BUILTINDATA_BAKED_DIFFUSE_LIGHTING: result = builtindata.bakeDiffuseLighting; needLinearToSRGB = true; break; - case DEBUGVIEW_BUILTIN_BUILTINDATA_BACK_BAKE_DIFFUSE_LIGHTING: + case DEBUGVIEW_BUILTIN_BUILTINDATA_BACK_BAKED_DIFFUSE_LIGHTING: result = builtindata.backBakeDiffuseLighting; needLinearToSRGB = true; break; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl index ab5e84820fa..5c0b1fd9e2c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl @@ -69,7 +69,7 @@ void GetBuiltinDataDebug(uint paramId, BuiltinData builtinData, inout float3 res switch (paramId) { - case DEBUGVIEW_BUILTIN_BUILTINDATA_BAKE_DIFFUSE_LIGHTING: + case DEBUGVIEW_BUILTIN_BUILTINDATA_BAKED_DIFFUSE_LIGHTING: // TODO: require a remap // TODO: we should not gamma correct, but easier to debug for now without correct high range value result = builtinData.bakeDiffuseLighting; needLinearToSRGB = true; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs index 369edb2c47b..e6088f255b0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs @@ -22,7 +22,7 @@ public enum MaterialFeatureFlags [GenerateHLSL(PackingRules.Exact, false, false, true, 1500)] public struct SurfaceData { - [SurfaceDataAttributes("MaterialFeatures")] + [SurfaceDataAttributes("Material Features")] public uint materialFeatures; // Standard diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs index 168dc9e90c0..c602b810c46 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs @@ -25,7 +25,7 @@ public enum MaterialFeatureFlags [GenerateHLSL(PackingRules.Exact, false, false, true, 1300)] public struct SurfaceData { - [SurfaceDataAttributes("MaterialFeatures")] + [SurfaceDataAttributes("Material Features")] public uint materialFeatures; // Standard diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs index 3da14b35c81..dfe960f625c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs @@ -18,7 +18,7 @@ public enum MaterialFeatureFlags [GenerateHLSL(PackingRules.Exact, false, false, true, 1400)] public struct SurfaceData { - [SurfaceDataAttributes("MaterialFeatures")] + [SurfaceDataAttributes("Material Features")] public uint materialFeatures; [MaterialSharedPropertyMapping(MaterialSharedProperty.AmbientOcclusion)] @@ -46,7 +46,7 @@ public struct SurfaceData [SurfaceDataAttributes("Transmittance")] public Vector3 transmittance; - [SurfaceDataAttributes("RimTransmissionIntensity")] + [SurfaceDataAttributes("Rim Transmission Intensity")] public float rimTransmissionIntensity; // Anisotropic diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs index e5db2dc20d3..3ec1640b95a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs @@ -29,7 +29,7 @@ public enum MaterialFeatureFlags [GenerateHLSL(PackingRules.Exact, false, false, true, 1000)] public struct SurfaceData { - [SurfaceDataAttributes("MaterialFeatures")] + [SurfaceDataAttributes("Material Features")] public uint materialFeatures; // Standard @@ -101,7 +101,7 @@ public struct SurfaceData public Vector3 transmittanceColor; [SurfaceDataAttributes("Transmittance Absorption Distance", precision = FieldPrecision.Real)] public float atDistance; - [SurfaceDataAttributes("Transmittance mask", precision = FieldPrecision.Real)] + [SurfaceDataAttributes("Transmittance Mask", precision = FieldPrecision.Real)] public float transmittanceMask; }; From 9978787c12f35cbe48413ad0bb5b22e7222107e2 Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Wed, 18 Mar 2020 12:06:32 +0100 Subject: [PATCH 18/84] Added debug exposure to light hierarchy debug. (#6216) # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md Co-authored-by: sebastienlagarde --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Debug/DebugDisplay.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 6aa8ab30cf7..8a5ee62d575 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue that prevented cubemap thumbnails from rendering. - Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. - Fix some typos in the debug menu. +- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index bcc96f54a63..5f2e838fdaf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -1179,7 +1179,7 @@ internal bool DebugNeedsExposure() DebugViewGbuffer debugGBuffer = (DebugViewGbuffer)data.materialDebugSettings.debugViewGBuffer; return (debugLighting == DebugLightingMode.DiffuseLighting || debugLighting == DebugLightingMode.SpecularLighting || debugLighting == DebugLightingMode.VisualizeCascade) || (data.lightingDebugSettings.overrideAlbedo || data.lightingDebugSettings.overrideNormal || data.lightingDebugSettings.overrideSmoothness || data.lightingDebugSettings.overrideSpecularColor || data.lightingDebugSettings.overrideEmissiveColor || data.lightingDebugSettings.overrideAmbientOcclusion) || - (debugGBuffer == DebugViewGbuffer.BakeDiffuseLightingWithAlbedoPlusEmissive) || + (debugGBuffer == DebugViewGbuffer.BakeDiffuseLightingWithAlbedoPlusEmissive) || (data.lightingDebugSettings.debugLightFilterMode != DebugLightFilterMode.None) || (data.fullScreenDebugMode == FullScreenDebugMode.PreRefractionColorPyramid || data.fullScreenDebugMode == FullScreenDebugMode.FinalColorPyramid || data.fullScreenDebugMode == FullScreenDebugMode.ScreenSpaceReflections || data.fullScreenDebugMode == FullScreenDebugMode.LightCluster || data.fullScreenDebugMode == FullScreenDebugMode.ScreenSpaceShadows || data.fullScreenDebugMode == FullScreenDebugMode.NanTracker || data.fullScreenDebugMode == FullScreenDebugMode.ColorLog) || data.fullScreenDebugMode == FullScreenDebugMode.RayTracedGlobalIllumination; } } From 8e09b167610f182d3d549120867a42f98a8d26bc Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Wed, 18 Mar 2020 12:23:02 +0100 Subject: [PATCH 19/84] - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. (#6254) --- .../CHANGELOG.md | 1 + .../Denoising/ReflectionDenoiser.compute | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 8a5ee62d575..7190c2003e6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Removed legacy VR code - Add range-based clipping to box lights (case 1178780) - Improve area light culling (case 1085873) +- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute index b762bd53f23..6e66f08da24 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute @@ -20,6 +20,11 @@ // Tile size of this compute #define REFLECTION_FILTER_TILE_SIZE 8 +//#pragma enable_d3d11_debug_symbols + +// Thereshold at which we decide to reject the reflection history +#define REFLECTION_HISTORY_REJECTION_THRESHOLD 0.75 + TEXTURE2D_X(_DenoiseInputTexture); TEXTURE2D_X(_HistoryBuffer); RW_TEXTURE2D_X(float4, _DenoiseOutputTextureRW); @@ -51,9 +56,17 @@ void TemporalAccumulation(uint3 dispatchThreadId : SV_DispatchThreadID, uint2 gr float velocityLength = length(velocity); float2 uv = posInputs.positionNDC; - float3 color = Fetch(_DenoiseInputTexture, uv, 0.0, _RTHandleScale.xy) * GetCurrentExposureMultiplier(); - float3 history = Fetch(_HistoryBuffer, posInputs.positionNDC - velocity, 0.0, _RTHandleScaleHistory.xy) * GetCurrentExposureMultiplier(); + float4 historyRaw = Fetch4(_HistoryBuffer, posInputs.positionNDC - velocity, 0.0, _RTHandleScaleHistory.xy); + float3 history = historyRaw.xyz * GetCurrentExposureMultiplier(); + + // If the validity of the history is lower than a given threshold, we do not want to use it + if (historyRaw.w < REFLECTION_HISTORY_REJECTION_THRESHOLD) + { + _DenoiseOutputTextureRW[COORD_TEXTURE2D_X(centerCoord)] = float4(color * GetInverseCurrentExposureMultiplier(), LOAD_TEXTURE2D_X(_DenoiseInputTexture, centerCoord).w); + return; + } + float3 topLeft = Fetch(_DenoiseInputTexture, uv, -RADIUS, _RTHandleScale.xy) * GetCurrentExposureMultiplier(); float3 bottomRight = Fetch(_DenoiseInputTexture, uv, RADIUS, _RTHandleScale.xy) * GetCurrentExposureMultiplier(); @@ -100,7 +113,9 @@ void CopyHistory(uint3 dispatchThreadId : SV_DispatchThreadID) if (any(dispatchThreadId.xy > uint2(_ScreenSize.xy))) return; // Out of bounds, discard - _DenoiseOutputTextureRW[COORD_TEXTURE2D_X(dispatchThreadId.xy)] = _DenoiseInputTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)]; + float4 currentColor = _DenoiseInputTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)]; + // We need to apply a step function on the blend factor to evaluate the validity of the history (if it is stricly higher than 0.0 then its valid) + _DenoiseOutputTextureRW[COORD_TEXTURE2D_X(dispatchThreadId.xy)] = float4(currentColor.xyz, currentColor.w > 0.0 ? 1.0 : 0.0); } int _DenoiserFilterRadius; From bd908e41b0aa2fd52ee89d01dd61c0b17db85761 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Thu, 19 Mar 2020 09:08:01 +0000 Subject: [PATCH 20/84] Clearer naming of tile and cluster categories for environment lights #6227 --- .../CHANGELOG.md | 1 + .../Runtime/Debug/DebugDisplay.cs | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7190c2003e6..571a94800e0 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Add range-based clipping to box lights (case 1178780) - Improve area light culling (case 1085873) - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. +- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 5f2e838fdaf..f27b847060f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -98,6 +98,8 @@ public class DebugDisplaySettings : IDebugData static int[] s_MaterialFullScreenDebugValues = null; static GUIContent[] s_MsaaSamplesDebugStrings = null; static int[] s_MsaaSamplesDebugValues = null; + static GUIContent[] s_TileAndClusterDebugStrings = null; + static int[] s_TileAndClusterDebugValues = null; static List s_CameraNames = new List(); static GUIContent[] s_CameraNamesStrings = null; @@ -208,6 +210,8 @@ internal DebugDisplaySettings() FillFullScreenDebugEnum(ref s_RenderingFullScreenDebugStrings, ref s_RenderingFullScreenDebugValues, FullScreenDebugMode.MinRenderingFullScreenDebug, FullScreenDebugMode.MaxRenderingFullScreenDebug); FillFullScreenDebugEnum(ref s_MaterialFullScreenDebugStrings, ref s_MaterialFullScreenDebugValues, FullScreenDebugMode.MinMaterialFullScreenDebug, FullScreenDebugMode.MaxMaterialFullScreenDebug); + FillTileClusterDebugEnum(); + s_MaterialFullScreenDebugStrings[(int)FullScreenDebugMode.ValidateDiffuseColor - ((int)FullScreenDebugMode.MinMaterialFullScreenDebug)] = new GUIContent("Diffuse Color"); s_MaterialFullScreenDebugStrings[(int)FullScreenDebugMode.ValidateSpecularColor - ((int)FullScreenDebugMode.MinMaterialFullScreenDebug)] = new GUIContent("Metal or SpecularColor"); @@ -885,7 +889,7 @@ void RegisterLightingDebug() { children = { - new DebugUI.EnumField { displayName = "Tile/Cluster Debug By Category", getter = () => (int)data.lightingDebugSettings.tileClusterDebugByCategory, setter = value => data.lightingDebugSettings.tileClusterDebugByCategory = (TileClusterCategoryDebug)value, autoEnum = typeof(TileClusterCategoryDebug), getIndex = () => data.tileClusterDebugByCategoryEnumIndex, setIndex = value => data.tileClusterDebugByCategoryEnumIndex = value } + new DebugUI.EnumField { displayName = "Tile/Cluster Debug By Category", getter = () => (int)data.lightingDebugSettings.tileClusterDebugByCategory, setter = value => data.lightingDebugSettings.tileClusterDebugByCategory = (TileClusterCategoryDebug)value, enumNames = s_TileAndClusterDebugStrings, enumValues = s_TileAndClusterDebugValues, getIndex = () => data.tileClusterDebugByCategoryEnumIndex, setIndex = value => data.tileClusterDebugByCategoryEnumIndex = value } } }); } @@ -1107,6 +1111,20 @@ void FillFullScreenDebugEnum(ref GUIContent[] strings, ref int[] values, FullScr index++; } } + void FillTileClusterDebugEnum() + { + string[] names = Enum.GetNames(typeof(TileClusterCategoryDebug)); + for(int i=0; i new GUIContent(t)) + .ToArray(); + s_TileAndClusterDebugValues = (int[])Enum.GetValues(typeof(TileClusterCategoryDebug)); + } static string FormatVector(Vector3 v) { From b48722e8d98794f066e345e7791f258e35a16fb7 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Thu, 19 Mar 2020 12:07:47 +0100 Subject: [PATCH 21/84] Fix texture curve destroy (#6277) # Conflicts: # com.unity.render-pipelines.core/CHANGELOG.md --- com.unity.render-pipelines.core/CHANGELOG.md | 1 + .../Runtime/Utilities/TextureCurve.cs | 43 +++++++------------ .../Runtime/Volume/VolumeComponent.cs | 14 ++++++ .../Runtime/Volume/VolumeParameter.cs | 5 +++ .../Runtime/Sky/SkyManager.cs | 1 + 5 files changed, 37 insertions(+), 27 deletions(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 7f2fa1d9b33..6210901563e 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -36,6 +36,7 @@ The version number for this package has increased due to a version update of a r - Fixed the definition of `rcp()` for GLES2. - Fix LookDev issue when adding a GameObject containing a Volume into the LookDev's view. - Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file +- Fixed the texture curve being destroyed from another thread than main (case 1211754) ### Changed - Restored usage of ENABLE_VR to fix compilation errors on some platforms. diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs b/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs index 4e3b9ea2c1d..4a1e3235d64 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs @@ -14,7 +14,7 @@ namespace UnityEngine.Rendering /// A wrapper around AnimationCurve to automatically bake it into a texture. /// [Serializable] - public class TextureCurve : IDisposable + public class TextureCurve { const int k_Precision = 128; // Edit LutBuilder3D if you change this value const float k_Step = 1f / k_Precision; @@ -78,23 +78,9 @@ public TextureCurve(Keyframe[] keys, float zeroValue, bool loop, in Vector2 boun } /// - /// Finalizer. + /// Releases the internal texture resource. /// - ~TextureCurve() - { - ReleaseUnityResources(); - } - - /// - /// Cleans up the internal texture resource. - /// - public void Dispose() - { - ReleaseUnityResources(); - GC.SuppressFinalize(this); - } - - void ReleaseUnityResources() + public void Release() { CoreUtils.Destroy(m_Texture); m_Texture = null; @@ -127,17 +113,18 @@ static TextureFormat GetTextureFormat() /// A 128x1 texture. public Texture2D GetTexture() { - if (m_IsTextureDirty) + if (m_Texture == null) { - if (m_Texture == null) - { - m_Texture = new Texture2D(k_Precision, 1, GetTextureFormat(), false, true); - m_Texture.name = "CurveTexture"; - m_Texture.hideFlags = HideFlags.HideAndDontSave; - m_Texture.filterMode = FilterMode.Bilinear; - m_Texture.wrapMode = TextureWrapMode.Clamp; - } + m_Texture = new Texture2D(k_Precision, 1, GetTextureFormat(), false, true); + m_Texture.name = "CurveTexture"; + m_Texture.hideFlags = HideFlags.HideAndDontSave; + m_Texture.filterMode = FilterMode.Bilinear; + m_Texture.wrapMode = TextureWrapMode.Clamp; + m_IsTextureDirty = true; + } + if (m_IsTextureDirty) + { var pixels = new Color[k_Precision]; for (int i = 0; i < pixels.Length; i++) @@ -254,6 +241,8 @@ public class TextureCurveParameter : VolumeParameter public TextureCurveParameter(TextureCurve value, bool overrideState = false) : base(value, overrideState) { } + public override void Release() => m_Value.Release(); + // TODO: TextureCurve interpolation } -} +} \ No newline at end of file diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs index 6d0dad29a1a..37288fbb311 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs @@ -209,5 +209,19 @@ public override int GetHashCode() return hash; } } + + /// + /// Unity calls this method before the object is destroyed. + /// + protected virtual void OnDestroy() => Release(); + + /// + /// Releases all the allocated resources. + /// + public void Release() + { + for (int i = 0; i < parameters.Count; i++) + parameters[i].Release(); + } } } diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs index 84d334c5b08..8fa9e1078e9 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs @@ -103,6 +103,11 @@ public static bool IsObjectParameter(Type type) return type.BaseType != null && IsObjectParameter(type.BaseType); } + + /// + /// Override this method to free all allocated resources + /// + public virtual void Release() {} } /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index 4e8852b73c0..dcd0c4cd226 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -337,6 +337,7 @@ public void Cleanup() m_CachedSkyContexts[i].Cleanup(); m_StaticLightingSky.Cleanup(); + lightingOverrideVolumeStack.Dispose(); #if UNITY_EDITOR CoreUtils.Destroy(m_DefaultPreviewSky); From dd858c6b0f815070f77bfea18654714060e16021 Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Thu, 19 Mar 2020 12:15:46 +0100 Subject: [PATCH 22/84] Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). (#6270) --- .../CHANGELOG.md | 1 + .../Runtime/Material/Lit/LitRaytracing.hlsl | 11 +++++++++++ .../ShaderPass/ShaderPassRaytracingForward.hlsl | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 571a94800e0..9e149a2113d 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. - Fix some typos in the debug menu. - Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. +- Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl index 3f7eec7efe0..54dadd272ba 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl @@ -16,6 +16,17 @@ IndirectLighting EvaluateBSDF_RaytracedRefraction(LightLoopContext lightLoopCont return lighting; } +#if HAS_REFRACTION +void OverrideRefractionData(SurfaceData surfaceData, float refractionDistance, float3 refractionPositionWS, inout BSDFData bsdfData, inout PreLightData preLightData) +{ + // This variable is only used for SSRefraction, we intentionally put an invalid value in it. + bsdfData.absorptionCoefficient = TransmittanceColorAtDistanceToAbsorption(surfaceData.transmittanceColor, refractionDistance); + preLightData.transparentRefractV = 0.0; + preLightData.transparentPositionWS = refractionPositionWS; + preLightData.transparentTransmittance = exp(-bsdfData.absorptionCoefficient * refractionDistance); +} +#endif + #endif #if (SHADERPASS == SHADERPASS_RAYTRACING_GBUFFER) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingForward.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingForward.hlsl index 56bc1dd51d9..0723ba0bea3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingForward.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingForward.hlsl @@ -93,6 +93,13 @@ void ClosestHitForward(inout RayIntersection rayIntersection : SV_RayPayload, At transmitted = transmittedIntersection.color; refractedWeight = 1.0; additionalRayCount += transmittedIntersection.rayCount; + + // Given that we are sharing code with rasterization, we need to override properly the refraction parameters + OverrideRefractionData(surfaceData, + transmittedIntersection.t, + pointWSPos + transmittedIntersection.t * refractedDir, + bsdfData, + preLightData); } #endif #endif From ae7c57fe8290d7aef587e84f66858c9511779ab6 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Thu, 19 Mar 2020 12:27:00 +0100 Subject: [PATCH 23/84] fix for Fogbugz 1214609 - HDRP Wizard addively increases the Light Intesity instead of setting it (#6266) --- .../Documentation~/Render-Pipeline-Wizard.md | 2 +- .../Editor/DefaultScene/HDWizard.Window.cs | 2 +- .../Editor/Upgraders/UpgradeStandardShaderMaterials.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Wizard.md b/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Wizard.md index 88b5a6d0b74..38fde79730d 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Wizard.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Wizard.md @@ -102,5 +102,5 @@ When upgrading a project from the built-in render pipeline to HDRP, you need to - **Upgrade Project Materials to High Definition Materials**: Upgrades every Material in your Unity Project to HDRP Materials. - **Upgrade Selected Materials to High Definition Materials**: Upgrades every Material currently selected to HDRP Materials. -- **Upgrade Unity Builtin Scene Light Intensity for High Definition**: Upgrades each Light in the current Scene to HDRP compatible intensity values. +- **Multiply Unity Builtin Directional Light Intensity to match High Definition**: Multiply intensity of each Directional Light in the current Scene to match HDRP compatible intensity values. Caution: This script should be executed only once. diff --git a/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs b/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs index 77e9947fd6f..2c301b272bc 100644 --- a/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs +++ b/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs @@ -41,7 +41,7 @@ static class Style public const string migrateAllButton = "Upgrade Project Materials to High Definition Materials"; public const string migrateSelectedButton = "Upgrade Selected Materials to High Definition Materials"; - public const string migrateLights = "Upgrade Unity Builtin Scene Light Intensity for High Definition"; + public const string migrateLights = "Multiply Unity Builtin Directional Light Intensity to match High Definition"; public const string migrateMaterials = "Upgrade HDRP Materials to Latest Version"; public const string hdrpVersionLast = "You are using High-Definition Render Pipeline lastest {0} version."; //{0} will be replaced when displayed by the version number. diff --git a/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs b/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs index ba4382aa032..d07e9d15459 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs @@ -33,12 +33,13 @@ internal static void UpgradeMaterialsSelection() MaterialUpgrader.UpgradeSelection(GetHDUpgraders(), "Upgrade to HD Material"); } - [MenuItem("Edit/Render Pipeline/Upgrade Unity Builtin Scene Light Intensity for High Definition", priority = CoreUtils.editMenuPriority2)] + [MenuItem("Edit/Render Pipeline/Multiply Unity Builtin Directional Light Intensity to match High Definition", priority = CoreUtils.editMenuPriority2)] internal static void UpgradeLights() { Light[] lights = Light.GetLights(LightType.Directional, 0); foreach (var l in lights) { + Undo.RecordObject(l, "Light intensity x PI"); l.intensity *= Mathf.PI; } } From 9e007964f0e4660afb1cc5462b76b74b3c8dd8ff Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Thu, 19 Mar 2020 12:33:01 +0100 Subject: [PATCH 24/84] Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. #6235 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Sky/SkyManager.cs | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9e149a2113d..e2106a63b22 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix some typos in the debug menu. - Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. - Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). +- Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index dcd0c4cd226..447da6c071e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -83,8 +83,6 @@ public void Reset() // We keep around the renderer and the rendering context to avoid useless allocation if they get reused. hash = 0; refCount = 0; - if (renderingContext != null) - renderingContext.ClearAmbientProbe(); } public void Cleanup() @@ -552,8 +550,7 @@ void AllocateNewRenderingContext(SkyUpdateContext skyContext, int slot, int newH if (context.renderingContext == null) context.renderingContext = new SkyRenderingContext(m_Resolution, m_IBLFilterArray.Length, supportConvolution, previousAmbientProbe, name); - else - context.renderingContext.UpdateAmbientProbe(previousAmbientProbe); + skyContext.cachedSkyRenderingContextId = slot; } @@ -633,7 +630,7 @@ internal void ReleaseCachedContext(int id) cachedContext.refCount--; if (cachedContext.refCount == 0) - cachedContext.Cleanup(); + cachedContext.Reset(); } bool IsCachedContextValid(SkyUpdateContext skyContext) From 96a89683635f45f58478950dd694c4fa7f6fe51b Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Thu, 19 Mar 2020 07:40:48 -0400 Subject: [PATCH 25/84] Add XR setting to control camera jitter for temporal effects #6259 --- .../CHANGELOG.md | 1 + .../RenderPipeline/HDRenderPipelineUI.Skin.cs | 1 + .../Editor/RenderPipeline/HDRenderPipelineUI.cs | 1 + .../Settings/SerializedXRSettings.cs | 2 ++ .../Runtime/RenderPipeline/Camera/HDCamera.cs | 5 ++--- .../RenderPipeline/XR/GlobalXRSettings.cs | 5 ++++- .../Runtime/RenderPipeline/XR/XRSystem.cs | 16 +++++++++++++--- .../Runtime/ShaderLibrary/Blit.shader | 6 ------ 8 files changed, 24 insertions(+), 13 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index e2106a63b22..7be02cd56fb 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added a warning and workaround instructions that appear when you enable XR single-pass after the first frame with the XR SDK. - Added an "enable" toggle to the SSR volume component. - Added support of cookie baking and add support on Disc light. +- Added XR setting to control camera jitter for temporal effects ### Fixed - Fix Changelog 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 e78b1a0adf4..c1aedeca879 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 @@ -184,6 +184,7 @@ public class GeneralSection public static readonly GUIContent XRSinglePass = EditorGUIUtility.TrTextContent("Single Pass", "When enabled, XR views are rendered simultaneously and the render loop is processed only once. This setting will improve CPU and GPU performance but will use more GPU memory."); public static readonly GUIContent XROcclusionMesh = EditorGUIUtility.TrTextContent("Occlusion Mesh", "When enabled, the occlusion mesh will be rendered for each view during the depth prepass to reduce shaded fragments."); + public static readonly GUIContent XRCameraJitter = EditorGUIUtility.TrTextContent("Camera Jitter", "When enabled, jitter will be added to the camera to provide more samples for temporal effects. This is usually not required in VR due to micro variations from the tracking."); public static readonly GUIContent lutSize = EditorGUIUtility.TrTextContent("Grading LUT Size", "Sets size of the internal and external color grading lookup textures (LUTs)."); public static readonly GUIContent lutFormat = EditorGUIUtility.TrTextContent("Grading LUT Format", "Specifies the encoding format for color grading lookup textures. Lower precision formats are faster and use less memory at the expense of color precision."); 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 6da2fed2e01..bd41dd2e4e1 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -569,6 +569,7 @@ static void Drawer_SectionXRSettings(SerializedHDRenderPipelineAsset serialized, { EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.singlePass, Styles.XRSinglePass); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.occlusionMesh, Styles.XROcclusionMesh); + EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.cameraJitter, Styles.XRCameraJitter); } static private bool m_ShowDoFLowQualitySection = false; diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs index 5ba0b879de7..4a462298ef0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs @@ -8,6 +8,7 @@ class SerializedXRSettings public SerializedProperty singlePass; public SerializedProperty occlusionMesh; + public SerializedProperty cameraJitter; public SerializedXRSettings(SerializedProperty root) { @@ -15,6 +16,7 @@ public SerializedXRSettings(SerializedProperty root) singlePass = root.Find((GlobalXRSettings s) => s.singlePass); occlusionMesh = root.Find((GlobalXRSettings s) => s.occlusionMesh); + cameraJitter = root.Find((GlobalXRSettings s) => s.cameraJitter); } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index e6a375931e6..6dad9dea362 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1119,9 +1119,8 @@ void UpdateVolumeAndPhysicalParameters() Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj) { - // Do not add extra jitter in VR (micro-variations from head tracking are enough) - // XRTODO: make this a setting in GlobalXRSettings instead of assuming - if (xr.enabled) + // Do not add extra jitter in VR unless requested (micro-variations from head tracking are usually enough) + if (xr.enabled && !HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.xrSettings.cameraJitter) { taaJitter = Vector4.zero; return origProj; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs index 4c4de05bbef..07e631a68b6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs @@ -11,12 +11,15 @@ public struct GlobalXRSettings internal static GlobalXRSettings NewDefault() => new GlobalXRSettings() { singlePass = true, - occlusionMesh = true + occlusionMesh = true, + cameraJitter = false }; /// Use single pass. public bool singlePass; /// Use occlusion mesh. public bool occlusionMesh; + /// Add jitter to camera for temporal effects. + public bool cameraJitter; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs index a6f2ac37fa8..36fc9f4d668 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs @@ -344,7 +344,7 @@ bool LayoutSinglePassTestMode(XRLayout frameLayout) customMirrorView = null }; - var viewInfo = new XRViewCreateInfo + var viewInfo2 = new XRViewCreateInfo { projMatrix = camera.projectionMatrix, viewMatrix = camera.worldToCameraMatrix, @@ -352,12 +352,22 @@ bool LayoutSinglePassTestMode(XRLayout frameLayout) textureArraySlice = -1 }; + // Change the first view so that it's a different viewpoint and projection to detect more issues + var viewInfo1 = viewInfo2; + var planes = viewInfo1.projMatrix.decomposeProjection; + planes.left *= 0.44f; + planes.right *= 0.88f; + planes.top *= 0.11f; + planes.bottom *= 0.33f; + viewInfo1.projMatrix = Matrix4x4.Frustum(planes); + viewInfo1.viewMatrix *= Matrix4x4.Translate(new Vector3(.34f, 0.25f, -0.08f)); + // single-pass 2x rendering { XRPass pass = frameLayout.CreatePass(passInfo); - for (int viewIndex = 0; viewIndex < TextureXR.slices; viewIndex++) - frameLayout.AddViewToPass(viewInfo, pass); + frameLayout.AddViewToPass(viewInfo1, pass); + frameLayout.AddViewToPass(viewInfo2, pass); } // valid layout diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader index 148fd968e22..c55177f8125 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader @@ -97,9 +97,6 @@ Shader "Hidden/HDRP/Blit" { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); float2 uv = input.texcoord.xy; -#if UNITY_SINGLE_PASS_STEREO - uv.x = (uv.x + unity_StereoEyeIndex) * 0.5; -#endif return SAMPLE_TEXTURE2D_X_LOD(_BlitTexture, sampler_LinearRepeat, uv, _BlitMipLevel); } @@ -107,9 +104,6 @@ Shader "Hidden/HDRP/Blit" { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); float2 uv = input.texcoord.xy; -#if UNITY_SINGLE_PASS_STEREO - uv.x = (uv.x + unity_StereoEyeIndex) * 0.5; -#endif return SAMPLE_TEXTURE2D_X_LOD(_BlitTexture, sampler_PointRepeat, uv, _BlitMipLevel); } From 72f952d88b009acae4964764d82342a4c48a5e4d Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Thu, 19 Mar 2020 07:46:42 -0400 Subject: [PATCH 26/84] fix unreachable code in TextureXR.useTexArray (#6260) Co-authored-by: sebastienlagarde --- com.unity.render-pipelines.core/CHANGELOG.md | 1 + .../Runtime/Textures/TextureXR.cs | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 6210901563e..90b8d628086 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -37,6 +37,7 @@ The version number for this package has increased due to a version update of a r - Fix LookDev issue when adding a GameObject containing a Volume into the LookDev's view. - Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file - Fixed the texture curve being destroyed from another thread than main (case 1211754) +- Fixed unreachable code in TextureXR.useTexArray ### Changed - Restored usage of ENABLE_VR to fix compilation errors on some platforms. diff --git a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs index e5f40685b5d..bc984323b6b 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs @@ -38,16 +38,13 @@ public static bool useTexArray { case GraphicsDeviceType.Direct3D11: case GraphicsDeviceType.Direct3D12: - return SystemInfo.graphicsDeviceType != GraphicsDeviceType.XboxOne; - case GraphicsDeviceType.PlayStation4: - return true; - case GraphicsDeviceType.Vulkan: return true; - } - return false; + default: + return false; + } } } From 2d70b648ea49791da03bb86690c65638c6a17e7e Mon Sep 17 00:00:00 2001 From: fredericv-unity3d <55485372+fredericv-unity3d@users.noreply.github.com> Date: Thu, 19 Mar 2020 12:53:07 +0100 Subject: [PATCH 27/84] Deprecate Utilities namespace #6219 --- .../Editor/Utilities/EditorMaterialQuality.cs | 1 - .../Runtime/Utilities/MaterialQuality.cs | 175 ++++- .../CHANGELOG.md | 665 ++++++++++-------- .../RenderPipeline/HDRenderPipelineUI.cs | 1 - .../Settings/FrameSettingsUI.Drawers.cs | 3 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 1 - .../RenderPipeline/HDRenderPipeline.cs | 1 - .../RenderPipeline/HDRenderPipelineAsset.cs | 1 - .../RenderPipeline/Settings/FrameSettings.cs | 1 - 9 files changed, 535 insertions(+), 314 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs b/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs index b61838e0793..28c3c31ae9b 100644 --- a/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs +++ b/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs @@ -1,5 +1,4 @@ using UnityEngine.Rendering; -using Utilities; namespace UnityEditor.Rendering.Utilities { diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs b/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs index 3975343b72c..01c62081140 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs @@ -1,13 +1,183 @@ using System; -using UnityEngine; -using UnityEngine.Rendering; +namespace UnityEngine.Rendering +{ + /// + /// Material quality flags. + /// + [Flags] + public enum MaterialQuality + { + /// Low Material Quality. + Low = 1 << 0, + /// Medium Material Quality. + Medium = 1 << 1, + /// High Material Quality. + High = 1 << 2 + } + + /// + /// Material Quality utility class. + /// + public static class MaterialQualityUtilities + { + /// + /// Keywords strings for Material Quality levels. + /// + public static string[] KeywordNames = + { + "MATERIAL_QUALITY_LOW", + "MATERIAL_QUALITY_MEDIUM", + "MATERIAL_QUALITY_HIGH", + }; + + /// + /// String representation of the MaterialQuality enum. + /// + public static string[] EnumNames = Enum.GetNames(typeof(MaterialQuality)); + + /// + /// Keywords for Material Quality levels. + /// + public static ShaderKeyword[] Keywords = + { + new ShaderKeyword(KeywordNames[0]), + new ShaderKeyword(KeywordNames[1]), + new ShaderKeyword(KeywordNames[2]), + }; + + /// + /// Returns the highest available quality level in a MaterialQuality bitfield. + /// + /// Input MaterialQuality bitfield. + /// The highest available quality level. + public static MaterialQuality GetHighestQuality(this MaterialQuality levels) + { + for (var i = Keywords.Length - 1; i >= 0; --i) + { + var level = (MaterialQuality) (1 << i); + if ((levels & level) != 0) + return level; + } + + return 0; + } + + /// + /// Returns the closest available quality level in a MaterialQuality bitfield. + /// + /// Available MaterialQuality bitfield. + /// Input MaterialQuality level. + /// The closest available quality level. + public static MaterialQuality GetClosestQuality(this MaterialQuality availableLevels, MaterialQuality requestedLevel) + { + // Special fallback when there are no available quality levels. Needs to match in the shader stripping code + if (availableLevels == 0) + return MaterialQuality.Low; + + // First we want to find the closest available quality level below the requested one. + int requestedLevelIndex = ToFirstIndex(requestedLevel); + MaterialQuality chosenQuality = (MaterialQuality)0; + for (int i = requestedLevelIndex; i >= 0; --i) + { + var level = FromIndex(i); + if ((level & availableLevels) != 0) + { + chosenQuality = level; + break; + } + } + + if (chosenQuality != 0) + return chosenQuality; + + // If none is found then we fallback to the closest above. + for (var i = requestedLevelIndex + 1; i < Keywords.Length; ++i) + { + var level = FromIndex(i); + var diff = Math.Abs(requestedLevel - level); + if ((level & availableLevels) != 0) + { + chosenQuality = level; + break; + } + } + + Debug.Assert(chosenQuality != 0); + return chosenQuality; + } + + /// + /// Set the global keyword for the provided MaterialQuality. + /// + /// MaterialQuality level to set the keyword for. + public static void SetGlobalShaderKeywords(this MaterialQuality level) + { + for (var i = 0; i < KeywordNames.Length; ++i) + { + if ((level & (MaterialQuality) (1 << i)) != 0) + Shader.EnableKeyword(KeywordNames[i]); + else + Shader.DisableKeyword(KeywordNames[i]); + } + } + + /// + /// Set the global keyword for the provided MaterialQuality. + /// + /// MaterialQuality level to set the keyword for. + /// Command Buffer used to setup the keyword. + public static void SetGlobalShaderKeywords(this MaterialQuality level, CommandBuffer cmd) + { + for (var i = 0; i < KeywordNames.Length; ++i) + { + if ((level & (MaterialQuality)(1 << i)) != 0) + cmd.EnableShaderKeyword(KeywordNames[i]); + else + cmd.DisableShaderKeyword(KeywordNames[i]); + } + } + + /// + /// Returns the index (in the MaterialQuality enum) of the first available level. + /// + /// MaterialQuality bitfield. + /// The index of the first available level. + public static int ToFirstIndex(this MaterialQuality level) + { + for (var i = 0; i < KeywordNames.Length; ++i) + { + if ((level & (MaterialQuality) (1 << i)) != 0) + return i; + } + + return -1; + } + + /// + /// Returns the enum equivalent of the index in the MaterialQuality enum list. + /// + /// Index of the material quality. + /// The equivalent enum. + public static MaterialQuality FromIndex(int index) => (MaterialQuality) (1 << index); + } +} + + +// TODO: Remove when breaking changes (introduced in 7.x.x) +// Namespace is invalid +// We will remove it in a future release but keep an obsolete version for compatibility. +// Instead, we should use 'UnityEngine.Rendering' namespace Utilities { + using UnityEngine; + using UnityEngine.Rendering; + /// /// Material quality flags. /// [Flags] + [Obsolete("Use UnityEngine.Rendering.MaterialQuality")] public enum MaterialQuality { /// Low Material Quality. @@ -21,6 +191,7 @@ public enum MaterialQuality /// /// Material Quality utility class. /// + [Obsolete("Use UnityEngine.Rendering.MaterialQualityUtilities")] public static class MaterialQualityUtilities { /// diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7be02cd56fb..417d14fe290 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,16 +6,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Add XR setting to control camera jitter for temporal effects #6259 + +### Fixed +- Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. + +### Changed +- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. +- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. + +## [7.3.0] - 2020-03-11 + ### Added - Added the exposure sliders to the planar reflection probe preview - Added a warning and workaround instructions that appear when you enable XR single-pass after the first frame with the XR SDK. - Added an "enable" toggle to the SSR volume component. -- Added support of cookie baking and add support on Disc light. -- Added XR setting to control camera jitter for temporal effects ### Fixed -- Fix Changelog - Fixed issue with AssetPostprocessors dependencies causing models to be imported twice when upgrading the package version. +- Fix player build DX12 - Fix issue with AO being misaligned when multiple view are visible. - Fix issue that caused the clamp of camera rotation motion for motion blur to be ineffective. - Fixed culling of lights with XR SDK @@ -39,68 +49,34 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed invalid game view rendering when disabling all cameras in the scene (case 1105163) - Fixed infinite reload loop while displaying Light's Shadow's Link Light Layer in Inspector of Prefab Asset. - Fixed the cookie atlas size and planar atlas size being too big after an upgrade of the HDRP asset. -- Fix player build DX12 +- Fixed alpha clipping test (comparison was '>', now '>=') +- Fixed preview camera (eg. shader graph preview) when path tracing is on +- Fixed DXR player build - Fixed compilation issue with linux vulkan and raytrace shader - Fixed the HDRP asset migration code not being called after an upgrade of the package - Fixed draw renderers custom pass out of bound exception - Fixed an issue with emissive light meshes not being in the RAS. +- Fixed a warning due to StaticLightingSky when reloading domain in some cases. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. +- Fix an exception in case two LOD levels are using the same mesh renderer. - Fixed error in the console when switching shader to decal in the material UI. - Fixed z-fighting in scene view when scene lighting is off (case 1203927) -- Fixed issue that prevented cubemap thumbnails from rendering. -- Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. -- Fix some typos in the debug menu. -- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. +- Fixed some typos in debug menu (case 1224594) - Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). -- Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. - Light dimmer can now get values higher than one and was renamed to multiplier in the UI. - Removed info box requesting volume component for Visual Environment and updated the documentation with the relevant information. -- Removed legacy VR code - Add range-based clipping to box lights (case 1178780) - Improve area light culling (case 1085873) -- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. -- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. +- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. +- Utilities namespace is obsolete, moved its content to UnityEngine.Rendering (case 1204677) -## [8.0.0] - 2020-05-25 +## [7.2.0] - 2020-02-10 ### Added -- Ray tracing support for VR single-pass -- Added sharpen filter shader parameter and UI for TemporalAA to control image quality instead of hardcoded value -- Added frame settings option for custom post process and custom passes as well as custom color buffer format option. -- Add check in wizard on SRP Batcher enabled. -- Added default implementations of OnPreprocessMaterialDescription for FBX, Obj, Sketchup and 3DS file formats. -- Added custom pass fade radius -- Added after post process injection point for custom passes -- Added basic alpha compositing support - Alpha is available afterpostprocess when using FP16 buffer format. -- Added falloff distance on Reflection Probe and Planar Reflection Probe -- Added Backplate projection from the HDRISky -- Added Shadow Matte in UnlitMasterNode, which only received shadow without lighting -- Added hability to name LightLayers in HDRenderPipelineAsset -- Added a range compression factor for Reflection Probe and Planar Reflection Probe to avoid saturation of colors. -- Added path tracing support for directional, point and spot lights, as well as emission from Lit and Unlit. -- Added non temporal version of SSAO. -- Added more detailed ray tracing stats in the debug window -- Added Disc area light (bake only) -- Added a warning in the material UI to prevent transparent + subsurface-scattering combination. -- Added XR single-pass setting into HDRP asset -- Added a penumbra tint option for lights -- Added support for depth copy with XR SDK -- Added debug setting to Render Pipeline Debug Window to list the active XR views -- Added an option to filter the result of the volumetric lighting (off by default). -- Added a transmission multiplier for directional lights -- Added XR single-pass test mode to Render Pipeline Debug Window -- Added debug setting to Render Pipeline Window to list the active XR views -- Added a new refraction mode for the Lit shader (thin). Which is a box refraction with small thickness values -- Added the code to support Barn Doors for Area Lights based on a shaderconfig option. -- Added HDRPCameraBinder property binder for Visual Effect Graph -- Added "Celestial Body" controls to the Directional Light -- Added new parameters to the Physically Based Sky -- Added Reflections to the DXR Wizard - Added the possibility to have ray traced colored and semi-transparent shadows on directional lights. -- Added a check in the custom post process template to throw an error if the default shader is not found. - Exposed the debug overlay ratio in the debug menu. - Added a separate frame settings for tonemapping alongside color grading. - Added the receive fog option in the material UI for ShaderGraphs. @@ -109,7 +85,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added Contrast Adaptive Sharpen (CAS) Upscaling effect. - Added APIs to update probe settings at runtime. - Added documentation for the rayTracingSupported method in HDRP -- Added user-selectable format for the post processing passes. +- Added user-selectable format for the post processing passes. - Added support for alpha channel in some post-processing passes (DoF, TAA, Uber). - Added warnings in FrameSettings inspector when using DXR and atempting to use Asynchronous Execution. - Exposed Stencil bits that can be used by the user. @@ -122,7 +98,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added the alpha clip enabled toggle to the material UI for all HDRP shader graphs. - Added Material Samples to explain how to use the lit shader features - Added an initial implementation of ray traced sub surface scattering -- Added AssetPostprocessors and Shadergraphs to handle Arnold Standard Surface and 3DsMax Physical material import from FBX. +- Added AssetPostprocessors and Shadergraphs to handle Arnold Standard Surface and 3DsMax Physical material import from FBX. - Added support for Smoothness Fade start work when enabling ray traced reflections. - Added Contact shadow, Micro shadows and Screen space refraction API documentation. - Added script documentation for SSR, SSAO (ray tracing), GI, Light Cluster, RayTracingSettings, Ray Counters, etc. @@ -132,223 +108,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Update documentation of HDRISky-Backplate, precise how to have Ambient Occlusion on the Backplate -- Sorting, undo, labels, layout in the Lighting Explorer. -- Fixed sky settings and materials in Shader Graph Samples package -- Fix/workaround a probable graphics driver bug in the GTAO shader. -- Fixed Hair and PBR shader graphs double sided modes -- Fixed an issue where updating an HDRP asset in the Quality setting panel would not recreate the pipeline. -- Fixed issue with point lights being considered even when occupying less than a pixel on screen (case 1183196) -- Fix a potential NaN source with iridescence (case 1183216) -- Fixed issue of spotlight breaking when minimizing the cone angle via the gizmo (case 1178279) -- Fixed issue that caused decals not to modify the roughness in the normal buffer, causing SSR to not behave correctly (case 1178336) -- Fixed lit transparent refraction with XR single-pass rendering -- Removed extra jitter for TemporalAA in VR -- Fixed ShaderGraph time in main preview -- Fixed issue on some UI elements in HDRP asset not expanding when clicking the arrow (case 1178369) -- Fixed alpha blending in custom post process -- Fixed the modification of the _AlphaCutoff property in the material UI when exposed with a ShaderGraph parameter. -- Fixed HDRP test `1218_Lit_DiffusionProfiles` on Vulkan. -- Fixed an issue where building a player in non-dev mode would generate render target error logs every frame -- Fixed crash when upgrading version of HDRP -- Fixed rendering issues with material previews -- Fixed NPE when using light module in Shuriken particle systems (1173348). -- Refresh cached shadow on editor changes -- Fixed light supported units caching (1182266) -- Fixed an issue where SSAO (that needs temporal reprojection) was still being rendered when Motion Vectors were not available (case 1184998) -- Fixed a nullref when modifying the height parameters inside the layered lit shader UI. -- Fixed Decal gizmo that become white after exiting play mode -- Fixed Decal pivot position to behave like a spotlight -- Fixed an issue where using the LightingOverrideMask would break sky reflection for regular cameras -- Fix DebugMenu FrameSettingsHistory persistency on close -- Fix DensityVolume, ReflectionProbe aned PlanarReflectionProbe advancedControl display -- Fix DXR scene serialization in wizard -- Fixed an issue where Previews would reallocate History Buffers every frame -- Fixed the SetLightLayer function in HDAdditionalLightData setting the wrong light layer -- Fix error first time a preview is created for planar -- Fixed an issue where SSR would use an incorrect roughness value on ForwardOnly (StackLit, AxF, Fabric, etc.) materials when the pipeline is configured to also allow deferred Lit. -- Fixed issues with light explorer (cases 1183468, 1183269) -- Fix dot colors in LayeredLit material inspector -- Fix undo not resetting all value when undoing the material affectation in LayerLit material -- Fix for issue that caused gizmos to render in render textures (case 1174395) -- Fixed the light emissive mesh not updated when the light was disabled/enabled -- Fixed light and shadow layer sync when setting the HDAdditionalLightData.lightlayersMask property -- Fixed a nullref when a custom post process component that was in the HDRP PP list is removed from the project -- Fixed issue that prevented decals from modifying specular occlusion (case 1178272). -- Fixed exposure of volumetric reprojection -- Fixed multi selection support for Scalable Settings in lights -- Fixed font shaders in test projects for VR by using a Shader Graph version -- Fixed refresh of baked cubemap by incrementing updateCount at the end of the bake (case 1158677). -- Fixed issue with rectangular area light when seen from the back -- Fixed decals not affecting lightmap/lightprobe -- Fixed zBufferParams with XR single-pass rendering -- Fixed moving objects not rendered in custom passes -- Fixed abstract classes listed in the + menu of the custom pass list -- Fixed custom pass that was rendered in previews -- Fixed precision error in zero value normals when applying decals (case 1181639) -- Fixed issue that triggered No Scene Lighting view in game view as well (case 1156102) -- Assign default volume profile when creating a new HDRP Asset -- Fixed fov to 0 in planar probe breaking the projection matrix (case 1182014) -- Fixed bugs with shadow caching -- Reassign the same camera for a realtime probe face render request to have appropriate history buffer during realtime probe rendering. -- Fixed issue causing wrong shading when normal map mode is Object space, no normal map is set, but a detail map is present (case 1143352) -- Fixed issue with decal and htile optimization -- Fixed TerrainLit shader compilation error regarding `_Control0_TexelSize` redefinition (case 1178480). -- Fixed warning about duplicate HDRuntimeReflectionSystem when configuring play mode without domain reload. -- Fixed an editor crash when multiple decal projectors were selected and some had null material -- Added all relevant fix actions to FixAll button in Wizard -- Moved FixAll button on top of the Wizard -- Fixed an issue where fog color was not pre-exposed correctly -- Fix priority order when custom passes are overlapping -- Fix cleanup not called when the custom pass GameObject is destroyed -- Replaced most instances of GraphicsSettings.renderPipelineAsset by GraphicsSettings.currentRenderPipeline. This should fix some parameters not working on Quality Settings overrides. -- Fixed an issue with Realtime GI not working on upgraded projects. -- Fixed issue with screen space shadows fallback texture was not set as a texture array. -- Fixed Pyramid Lights bounding box -- Fixed terrain heightmap default/null values and epsilons -- Fixed custom post-processing effects breaking when an abstract class inherited from `CustomPostProcessVolumeComponent` -- Fixed XR single-pass rendering in Editor by using ShaderConfig.s_XrMaxViews to allocate matrix array -- Multiple different skies rendered at the same time by different cameras are now handled correctly without flickering -- Fixed flickering issue happening when different volumes have shadow settings and multiple cameras are present. -- Fixed issue causing planar probes to disappear if there is no light in the scene. -- Fixed a number of issues with the prefab isolation mode (Volumes leaking from the main scene and reflection not working properly) -- Fixed an issue with fog volume component upgrade not working properly -- Fixed Spot light Pyramid Shape has shadow artifacts on aspect ratio values lower than 1 -- Fixed issue with AO upsampling in XR -- Fixed camera without HDAdditionalCameraData component not rendering -- Removed the macro ENABLE_RAYTRACING for most of the ray tracing code -- Fixed prefab containing camera reloading in loop while selected in the Project view -- Fixed issue causing NaN wheh the Z scale of an object is set to 0. -- Fixed DXR shader passes attempting to render before pipeline loaded -- Fixed black ambient sky issue when importing a project after deleting Library. -- Fixed issue when upgrading a Standard transparent material (case 1186874) -- Fixed area light cookies not working properly with stack lit -- Fixed material render queue not updated when the shader is changed in the material inspector. -- Fixed a number of issues with full screen debug modes not reseting correctly when setting another mutually exclusive mode -- Fixed compile errors for platforms with no VR support -- Fixed an issue with volumetrics and RTHandle scaling (case 1155236) -- Fixed an issue where sky lighting might be updated uselessly -- Fixed issue preventing to allow setting decal material to none (case 1196129) -- Fixed XR multi-pass decals rendering -- Fixed several fields on Light Inspector that not supported Prefab overrides -- Fixed EOL for some files -- Fixed scene view rendering with volumetrics and XR enabled -- Fixed decals to work with multiple cameras -- Fixed optional clear of GBuffer (Was always on) -- Fixed render target clears with XR single-pass rendering -- Fixed HDRP samples file hierarchy -- Fixed Light units not matching light type -- Fixed QualitySettings panel not displaying HDRP Asset -- Fixed black reflection probes the first time loading a project -- Fixed y-flip in scene view with XR SDK -- Fixed Decal projectors do not immediately respond when parent object layer mask is changed in editor. -- Fixed y-flip in scene view with XR SDK -- Fixed a number of issues with Material Quality setting -- Fixed the transparent Cull Mode option in HD unlit master node settings only visible if double sided is ticked. -- Fixed an issue causing shadowed areas by contact shadows at the edge of far clip plane if contact shadow length is very close to far clip plane. -- Fixed editing a scalable settings will edit all loaded asset in memory instead of targetted asset. -- Fixed Planar reflection default viewer FOV -- Fixed flickering issues when moving the mouse in the editor with ray tracing on. -- Fixed the ShaderGraph main preview being black after switching to SSS in the master node settings -- Fixed custom fullscreen passes in VR -- Fixed camera culling masks not taken in account in custom pass volumes -- Fixed object not drawn in custom pass when using a DrawRenderers with an HDRP shader in a build. -- Fixed injection points for Custom Passes (AfterDepthAndNormal and BeforePreRefraction were missing) -- Fixed a enum to choose shader tags used for drawing objects (DepthPrepass or Forward) when there is no override material. -- Fixed lit objects in the BeforePreRefraction, BeforeTransparent and BeforePostProcess. -- Fixed the None option when binding custom pass render targets to allow binding only depth or color. -- Fixed custom pass buffers allocation so they are not allocated if they're not used. -- Fixed the Custom Pass entry in the volume create asset menu items. -- Fixed Prefab Overrides workflow on Camera. -- Fixed alignment issue in Preset for Camera. -- Fixed alignment issue in Physical part for Camera. -- Fixed FrameSettings multi-edition. -- Fixed a bug happening when denoising multiple ray traced light shadows -- Fixed minor naming issues in ShaderGraph settings -- VFX: Removed z-fight glitches that could appear when using deferred depth prepass and lit quad primitives -- VFX: Preserve specular option for lit outputs (matches HDRP lit shader) -- Fixed an issue with Metal Shader Compiler and GTAO shader for metal -- Fixed resources load issue while upgrading HDRP package. -- Fix LOD fade mask by accounting for field of view -- Fixed spot light missing from ray tracing indirect effects. -- Fixed a UI bug in the diffusion profile list after fixing them from the wizard. -- Fixed the hash collision when creating new diffusion profile assets. -- Fixed a light leaking issue with box light casting shadows (case 1184475) -- Fixed Cookie texture type in the cookie slot of lights (Now displays a warning because it is not supported). -- Fixed a nullref that happens when using the Shuriken particle light module -- Fixed alignment in Wizard -- Fixed text overflow in Wizard's helpbox -- Fixed Wizard button fix all that was not automatically grab all required fixes -- Fixed VR tab for MacOS in Wizard -- Fixed local config package workflow in Wizard -- Fixed issue with contact shadows shifting when MSAA is enabled. -- Fixed EV100 in the PBR sky -- Fixed an issue In URP where sometime the camera is not passed to the volume system and causes a null ref exception (case 1199388) -- Fixed nullref when releasing HDRP with custom pass disabled -- Fixed performance issue derived from copying stencil buffer. -- Fixed an editor freeze when importing a diffusion profile asset from a unity package. -- Fixed an exception when trying to reload a builtin resource. -- Fixed the light type intensity unit reset when switching the light type. -- Fixed compilation error related to define guards and CreateLayoutFromXrSdk() -- Fixed documentation link on CustomPassVolume. -- Fixed player build when HDRP is in the project but not assigned in the graphic settings. -- Fixed an issue where ambient probe would be black for the first face of a baked reflection probe -- VFX: Fixed Missing Reference to Visual Effect Graph Runtime Assembly -- Fixed an issue where rendering done by users in EndCameraRendering would be executed before the main render loop. -- Fixed Prefab Override in main scope of Volume. -- Fixed alignment issue in Presset of main scope of Volume. -- Fixed persistence of ShowChromeGizmo and moved it to toolbar for coherency in ReflectionProbe and PlanarReflectionProbe. -- Fixed Alignement issue in ReflectionProbe and PlanarReflectionProbe. -- Fixed Prefab override workflow issue in ReflectionProbe and PlanarReflectionProbe. -- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in ReflectionProbe and PlanarReflectionProbe. -- Fixed Prefab override workflow issue in DensityVolume. -- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in DensityVolume. -- Fix light limit counts specified on the HDRP asset -- Fixed Quality Settings for SSR, Contact Shadows and Ambient Occlusion volume components -- Fixed decalui deriving from hdshaderui instead of just shaderui -- Use DelayedIntField instead of IntField for scalable settings -- Fixed init of debug for FrameSettingsHistory on SceneView camera -- Added a fix script to handle the warning 'referenced script in (GameObject 'SceneIDMap') is missing' -- Fix Wizard load when none selected for RenderPipelineAsset - Fixed TerrainLitGUI when per-pixel normal property is not present. -- Fixed rendering errors when enabling debug modes with custom passes -- Fix an issue that made PCSS dependent on Atlas resolution (not shadow map res) -- Fixing a bug whith histories when n>4 for ray traced shadows -- Fixing wrong behavior in ray traced shadows for mesh renderers if their cast shadow is shadow only or double sided -- Only tracing rays for shadow if the point is inside the code for spotlight shadows -- Only tracing rays if the point is inside the range for point lights -- Fixing ghosting issues when the screen space shadow indexes change for a light with ray traced shadows -- Fixed an issue with stencil management and Xbox One build that caused corrupted output in deferred mode. -- Fixed a mismatch in behavior between the culling of shadow maps and ray traced point and spot light shadows -- Fixed recursive ray tracing not working anymore after intermediate buffer refactor. -- Fixed ray traced shadow denoising not working (history rejected all the time). -- Fixed shader warning on xbox one -- Fixed cookies not working for spot lights in ray traced reflections, ray traced GI and recursive rendering -- Fixed an inverted handling of CoatSmoothness for SSR in StackLit. -- Fixed missing distortion inputs in Lit and Unlit material UI. -- Fixed issue that propagated NaNs across multiple frames through the exposure texture. -- Fixed issue with Exclude from TAA stencil ignored. -- Fixed ray traced reflection exposure issue. -- Fixed issue with TAA history not initialising corretly scale factor for first frame -- Fixed issue with stencil test of material classification not using the correct Mask (causing false positive and bad performance with forward material in deferred) -- Fixed issue with History not reset when chaning antialiasing mode on camera -- Fixed issue with volumetric data not being initialized if default settings have volumetric and reprojection off. -- Fixed ray tracing reflection denoiser not applied in tier 1 -- Fixed the vibility of ray tracing related methods. -- Fixed the diffusion profile list not saved when clicking the fix button in the material UI. -- Fixed crash when pushing bounce count higher than 1 for ray traced GI or reflections -- Fixed PCSS softness scale so that it better match ray traced reference for punctual lights. -- Fixed exposure management for the path tracer -- Fixed AxF material UI containing two advanced options settings. -- Fixed an issue where cached sky contexts were being destroyed wrongly, breaking lighting in the LookDev -- Fixed issue that clamped PCSS softness too early and not after distance scale. -- Fixed fog affect transparent on HD unlit master node -- Fixed custom post processes re-ordering not saved. -- Fixed NPE when using scalable settings -- Fixed an issue where PBR sky precomputation was reset incorrectly in some cases causing bad performance. - Fixed a bug due to depth history begin overriden too soon -- Fixed CustomPassSampleCameraColor scale issue when called from Before Transparent injection point. -- Fixed corruption of AO in baked probes. -- Fixed issue with upgrade of projects that still had Very High as shadow filtering quality. - Fixed issue that caused Distortion UI to appear in Lit. - Fixed several issues with decal duplicating when editing them. - Fixed initialization of volumetric buffer params (1204159) @@ -384,7 +145,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed shader warning in AO code. - Fixed a warning in simpledenoiser.compute - Fixed tube and rectangle light culling to use their shape instead of their range as a bounding box. -- Fixed caused by using gather on a UINT texture in motion blur. +- Fixed caused by using gather on a UINT texture in motion blur. - Fix issue with ambient occlusion breaking when dynamic resolution is active. - Fixed some possible NaN causes in Depth of Field. - Fixed Custom Pass nullref due to the new Profiling Sample API changes @@ -467,48 +228,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue with MipRatio debug mode showing _DebugMatCapTexture not being set. - Fixed missing initialization of input params in Blit for VR. - Fix Inf source in LTC for area lights. -- Fixed alpha clipping test (comparison was '>', now '>=') -- Fixed preview camera (eg. shader graph preview) when path tracing is on -- Fixed issue with unclear naming of debug menu for decals. ### Changed -- Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled -- Rename Emission Radius to Radius in UI in Point, Spot -- Angular Diameter parameter for directional light is no longuer an advanced property -- DXR: Remove Light Radius and Angular Diamater of Raytrace shadow. Angular Diameter and Radius are used instead. -- Remove MaxSmoothness parameters from UI for point, spot and directional light. The MaxSmoothness is now deduce from Radius Parameters -- DXR: Remove the Ray Tracing Environement Component. Add a Layer Mask to the ray Tracing volume components to define which objects are taken into account for each effect. -- Removed second cubemaps used for shadowing in lookdev -- Disable Physically Based Sky below ground -- Increase max limit of area light and reflection probe to 128 -- Change default texture for detailmap to grey -- Optimize Shadow RT load on Tile based architecture platforms. -- Improved quality of SSAO. -- Moved RequestShadowMapRendering() back to public API. -- Update HDRP DXR Wizard with an option to automatically clone the hdrp config package and setup raytracing to 1 in shaders file. -- Added SceneSelection pass for TerrainLit shader. -- Simplified Light's type API regrouping the logic in one place (Check type in HDAdditionalLightData) -- The support of LOD CrossFade (Dithering transition) in master nodes now required to enable it in the master node settings (Save variant) -- Improved shadow bias, by removing constant depth bias and substituting it with slope-scale bias. -- Fix the default stencil values when a material is created from a SSS ShaderGraph. -- Tweak test asset to be compatible with XR: unlit SG material for canvas and double-side font material -- Slightly tweaked the behaviour of bloom when resolution is low to reduce artifacts. -- Hidden fields in Light Inspector that is not relevant while in BakingOnly mode. -- Changed parametrization of PCSS, now softness is derived from angular diameter (for directional lights) or shape radius (for point/spot lights) and min filter size is now in the [0..1] range. -- Moved the copy of the geometry history buffers to right after the depth mip chain generation. -- Rename "Luminance" to "Nits" in UX for physical light unit -- Rename FrameSettings "SkyLighting" to "SkyReflection" -- Reworked XR automated tests -- The ray traced screen space shadow history for directional, spot and point lights is discarded if the light transform has changed. -- Changed the behavior for ray tracing in case a mesh renderer has both transparent and opaque submeshes. -- Improve history buffer management -- Replaced PlayerSettings.virtualRealitySupported with XRGraphics.tryEnable. -- Remove redundant FrameSettings RealTimePlanarReflection -- Improved a bit the GC calls generated during the rendering. -- Material update is now only triggered when the relevant settings are touched in the shader graph master nodes -- Changed the way Sky Intensity (on Sky volume components) is handled. It's now a combo box where users can choose between Exposure, Multiplier or Lux (for HDRI sky only) instead of both multiplier and exposure being applied all the time. Added a new menu item to convert old profiles. -- Change how method for specular occlusions is decided on inspector shader (Lit, LitTesselation, LayeredLit, LayeredLitTessellation) -- Unlocked SSS, SSR, Motion Vectors and Distortion frame settings for reflections probes. - Hide unused LOD settings in Quality Settings legacy window. - Reduced the constrained distance for temporal reprojection of ray tracing denoising - Removed shadow near plane from the Directional Light Shadow UI. @@ -556,6 +277,342 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Moved BeginCameraRendering callback right before culling. - Changed the visibility of the Indirect Lighting Controller component to public. +## [7.1.8] - 2020-01-20 + +### Fixed +- Fixed white and dark flashes on scenes with very high or very low exposure when Automatic Exposure is being used. +- Fixed memory leak in Sky when in matcap mode. + +### Changed +- On Xbox and PS4 you will also need to download the com.unity.render-pipeline.platform (ps4 or xboxone) package from the appropriate platform developer forum + +## [7.1.7] - 2019-12-11 + +### Added +- Added a check in the custom post process template to throw an error if the default shader is not found. + +### Fixed +- Fixed rendering errors when enabling debug modes with custom passes +- Fix an issue that made PCSS dependent on Atlas resolution (not shadow map res) +- Fixing a bug whith histories when n>4 for ray traced shadows +- Fixing wrong behavior in ray traced shadows for mesh renderers if their cast shadow is shadow only or double sided +- Only tracing rays for shadow if the point is inside the code for spotlight shadows +- Only tracing rays if the point is inside the range for point lights +- Fixing ghosting issues when the screen space shadow indexes change for a light with ray traced shadows +- Fixed an issue with stencil management and Xbox One build that caused corrupted output in deferred mode. +- Fixed a mismatch in behavior between the culling of shadow maps and ray traced point and spot light shadows +- Fixed recursive ray tracing not working anymore after intermediate buffer refactor. +- Fixed ray traced shadow denoising not working (history rejected all the time). +- Fixed shader warning on xbox one +- Fixed cookies not working for spot lights in ray traced reflections, ray traced GI and recursive rendering +- Fixed an inverted handling of CoatSmoothness for SSR in StackLit. +- Fixed missing distortion inputs in Lit and Unlit material UI. +- Fixed issue that propagated NaNs across multiple frames through the exposure texture. +- Fixed issue with Exclude from TAA stencil ignored. +- Fixed ray traced reflection exposure issue. +- Fixed issue with TAA history not initialising corretly scale factor for first frame +- Fixed issue with stencil test of material classification not using the correct Mask (causing false positive and bad performance with forward material in deferred) +- Fixed issue with History not reset when chaning antialiasing mode on camera +- Fixed issue with volumetric data not being initialized if default settings have volumetric and reprojection off. +- Fixed ray tracing reflection denoiser not applied in tier 1 +- Fixed the vibility of ray tracing related methods. +- Fixed the diffusion profile list not saved when clicking the fix button in the material UI. +- Fixed crash when pushing bounce count higher than 1 for ray traced GI or reflections +- Fixed PCSS softness scale so that it better match ray traced reference for punctual lights. +- Fixed exposure management for the path tracer +- Fixed AxF material UI containing two advanced options settings. +- Fixed an issue where cached sky contexts were being destroyed wrongly, breaking lighting in the LookDev +- Fixed issue that clamped PCSS softness too early and not after distance scale. +- Fixed fog affect transparent on HD unlit master node +- Fixed custom post processes re-ordering not saved. +- Fixed NPE when using scalable settings +- Fixed an issue where PBR sky precomputation was reset incorrectly in some cases causing bad performance. +- Fixed a bug in dxr due to depth history begin overriden too soon +- Fixed CustomPassSampleCameraColor scale issue when called from Before Transparent injection point. +- Fixed corruption of AO in baked probes. +- Fixed issue with upgrade of projects that still had Very High as shadow filtering quality. +- Removed shadow near plane from the Directional Light Shadow UI. +- Fixed performance issue with performances of custom pass culling. + +## [7.1.6] - 2019-11-22 + +### Added +- Added Backplate projection from the HDRISky +- Added Shadow Matte in UnlitMasterNode, which only received shadow without lighting +- Added support for depth copy with XR SDK +- Added debug setting to Render Pipeline Debug Window to list the active XR views +- Added an option to filter the result of the volumetric lighting (off by default). +- Added a transmission multiplier for directional lights +- Added XR single-pass test mode to Render Pipeline Debug Window +- Added debug setting to Render Pipeline Window to list the active XR views +- Added a new refraction mode for the Lit shader (thin). Which is a box refraction with small thickness values +- Added the code to support Barn Doors for Area Lights based on a shaderconfig option. +- Added HDRPCameraBinder property binder for Visual Effect Graph +- Added "Celestial Body" controls to the Directional Light +- Added new parameters to the Physically Based Sky +- Added Reflections to the DXR Wizard + +### Fixed +- Fixed y-flip in scene view with XR SDK +- Fixed Decal projectors do not immediately respond when parent object layer mask is changed in editor. +- Fixed y-flip in scene view with XR SDK +- Fixed a number of issues with Material Quality setting +- Fixed the transparent Cull Mode option in HD unlit master node settings only visible if double sided is ticked. +- Fixed an issue causing shadowed areas by contact shadows at the edge of far clip plane if contact shadow length is very close to far clip plane. +- Fixed editing a scalable settings will edit all loaded asset in memory instead of targetted asset. +- Fixed Planar reflection default viewer FOV +- Fixed flickering issues when moving the mouse in the editor with ray tracing on. +- Fixed the ShaderGraph main preview being black after switching to SSS in the master node settings +- Fixed custom fullscreen passes in VR +- Fixed camera culling masks not taken in account in custom pass volumes +- Fixed object not drawn in custom pass when using a DrawRenderers with an HDRP shader in a build. +- Fixed injection points for Custom Passes (AfterDepthAndNormal and BeforePreRefraction were missing) +- Fixed a enum to choose shader tags used for drawing objects (DepthPrepass or Forward) when there is no override material. +- Fixed lit objects in the BeforePreRefraction, BeforeTransparent and BeforePostProcess. +- Fixed the None option when binding custom pass render targets to allow binding only depth or color. +- Fixed custom pass buffers allocation so they are not allocated if they're not used. +- Fixed the Custom Pass entry in the volume create asset menu items. +- Fixed Prefab Overrides workflow on Camera. +- Fixed alignment issue in Preset for Camera. +- Fixed alignment issue in Physical part for Camera. +- Fixed FrameSettings multi-edition. +- Fixed a bug happening when denoising multiple ray traced light shadows +- Fixed minor naming issues in ShaderGraph settings +- Fixed an issue with Metal Shader Compiler and GTAO shader for metal +- Fixed resources load issue while upgrading HDRP package. +- Fixed LOD fade mask by accounting for field of view +- Fixed spot light missing from ray tracing indirect effects. +- Fixed a UI bug in the diffusion profile list after fixing them from the wizard. +- Fixed the hash collision when creating new diffusion profile assets. +- Fixed a light leaking issue with box light casting shadows (case 1184475) +- Fixed Cookie texture type in the cookie slot of lights (Now displays a warning because it is not supported). +- Fixed a nullref that happens when using the Shuriken particle light module +- Fixed alignment in Wizard +- Fixed text overflow in Wizard's helpbox +- Fixed Wizard button fix all that was not automatically grab all required fixes +- Fixed VR tab for MacOS in Wizard +- Fixed local config package workflow in Wizard +- Fixed issue with contact shadows shifting when MSAA is enabled. +- Fixed EV100 in the PBR sky +- Fixed an issue In URP where sometime the camera is not passed to the volume system and causes a null ref exception (case 1199388) +- Fixed nullref when releasing HDRP with custom pass disabled +- Fixed performance issue derived from copying stencil buffer. +- Fixed an editor freeze when importing a diffusion profile asset from a unity package. +- Fixed an exception when trying to reload a builtin resource. +- Fixed the light type intensity unit reset when switching the light type. +- Fixed compilation error related to define guards and CreateLayoutFromXrSdk() +- Fixed documentation link on CustomPassVolume. +- Fixed player build when HDRP is in the project but not assigned in the graphic settings. +- Fixed an issue where ambient probe would be black for the first face of a baked reflection probe +- VFX: Fixed Missing Reference to Visual Effect Graph Runtime Assembly +- Fixed an issue where rendering done by users in EndCameraRendering would be executed before the main render loop. +- Fixed Prefab Override in main scope of Volume. +- Fixed alignment issue in Presset of main scope of Volume. +- Fixed persistence of ShowChromeGizmo and moved it to toolbar for coherency in ReflectionProbe and PlanarReflectionProbe. +- Fixed Alignement issue in ReflectionProbe and PlanarReflectionProbe. +- Fixed Prefab override workflow issue in ReflectionProbe and PlanarReflectionProbe. +- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in ReflectionProbe and PlanarReflectionProbe. +- Fixed Prefab override workflow issue in DensityVolume. +- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in DensityVolume. +- Fix light limit counts specified on the HDRP asset +- Fixed Quality Settings for SSR, Contact Shadows and Ambient Occlusion volume components +- Fixed decalui deriving from hdshaderui instead of just shaderui +- Use DelayedIntField instead of IntField for scalable settings + +### Changed +- Reworked XR automated tests +- The ray traced screen space shadow history for directional, spot and point lights is discarded if the light transform has changed. +- Changed the behavior for ray tracing in case a mesh renderer has both transparent and opaque submeshes. +- Improve history buffer management +- Replaced PlayerSettings.virtualRealitySupported with XRGraphics.tryEnable. +- Remove redundant FrameSettings RealTimePlanarReflection +- Improved a bit the GC calls generated during the rendering. +- Material update is now only triggered when the relevant settings are touched in the shader graph master nodes +- Changed the way Sky Intensity (on Sky volume components) is handled. It's now a combo box where users can choose between Exposure, Multiplier or Lux (for HDRI sky only) instead of both multiplier and exposure being applied all the time. Added a new menu item to convert old profiles. +- Change how method for specular occlusions is decided on inspector shader (Lit, LitTesselation, LayeredLit, LayeredLitTessellation) +- Unlocked SSS, SSR, Motion Vectors and Distortion frame settings for reflections probes. + +## [7.1.5] - 2019-11-15 + +### Fixed +- Fixed black reflection probes the first time loading a project + +## [7.1.4] - 2019-11-13 + +### Added +- Added XR single-pass setting into HDRP asset +- Added a penumbra tint option for lights + +### Fixed +- Fixed EOL for some files +- Fixed scene view rendering with volumetrics and XR enabled +- Fixed decals to work with multiple cameras +- Fixed optional clear of GBuffer (Was always on) +- Fixed render target clears with XR single-pass rendering +- Fixed HDRP samples file hierarchy +- Fixed Light units not matching light type +- Fixed QualitySettings panel not displaying HDRP Asset + +### Changed +- Changed parametrization of PCSS, now softness is derived from angular diameter (for directional lights) or shape radius (for point/spot lights) and min filter size is now in the [0..1] range. +- Moved the copy of the geometry history buffers to right after the depth mip chain generation. +- Rename "Luminance" to "Nits" in UX for physical light unit +- Rename FrameSettings "SkyLighting" to "SkyReflection" + +## [7.1.3] - 2019-11-04 + +### Added +- Ray tracing support for VR single-pass +- Added sharpen filter shader parameter and UI for TemporalAA to control image quality instead of hardcoded value +- Added frame settings option for custom post process and custom passes as well as custom color buffer format option. +- Add check in wizard on SRP Batcher enabled. +- Added default implementations of OnPreprocessMaterialDescription for FBX, Obj, Sketchup and 3DS file formats. +- Added custom pass fade radius +- Added after post process injection point for custom passes +- Added basic alpha compositing support - Alpha is available afterpostprocess when using FP16 buffer format. +- Added falloff distance on Reflection Probe and Planar Reflection Probe +- Added hability to name LightLayers in HDRenderPipelineAsset +- Added a range compression factor for Reflection Probe and Planar Reflection Probe to avoid saturation of colors. +- Added path tracing support for directional, point and spot lights, as well as emission from Lit and Unlit. +- Added non temporal version of SSAO. +- Added more detailed ray tracing stats in the debug window +- Added Disc area light (bake only) +- Added a warning in the material UI to prevent transparent + subsurface-scattering combination. + +### Fixed +- Sorting, undo, labels, layout in the Lighting Explorer. +- Fixed sky settings and materials in Shader Graph Samples package +- Fixed light supported units caching (1182266) +- Fixed an issue where SSAO (that needs temporal reprojection) was still being rendered when Motion Vectors were not available (case 1184998) +- Fixed a nullref when modifying the height parameters inside the layered lit shader UI. +- Fixed Decal gizmo that become white after exiting play mode +- Fixed Decal pivot position to behave like a spotlight +- Fixed an issue where using the LightingOverrideMask would break sky reflection for regular cameras +- Fix DebugMenu FrameSettingsHistory persistency on close +- Fix DensityVolume, ReflectionProbe aned PlanarReflectionProbe advancedControl display +- Fix DXR scene serialization in wizard +- Fixed an issue where Previews would reallocate History Buffers every frame +- Fixed the SetLightLayer function in HDAdditionalLightData setting the wrong light layer +- Fix error first time a preview is created for planar +- Fixed an issue where SSR would use an incorrect roughness value on ForwardOnly (StackLit, AxF, Fabric, etc.) materials when the pipeline is configured to also allow deferred Lit. +- Fixed issues with light explorer (cases 1183468, 1183269) +- Fix dot colors in LayeredLit material inspector +- Fix undo not resetting all value when undoing the material affectation in LayerLit material +- Fix for issue that caused gizmos to render in render textures (case 1174395) +- Fixed the light emissive mesh not updated when the light was disabled/enabled +- Fixed light and shadow layer sync when setting the HDAdditionalLightData.lightlayersMask property +- Fixed a nullref when a custom post process component that was in the HDRP PP list is removed from the project +- Fixed issue that prevented decals from modifying specular occlusion (case 1178272). +- Fixed exposure of volumetric reprojection +- Fixed multi selection support for Scalable Settings in lights +- Fixed font shaders in test projects for VR by using a Shader Graph version +- Fixed refresh of baked cubemap by incrementing updateCount at the end of the bake (case 1158677). +- Fixed issue with rectangular area light when seen from the back +- Fixed decals not affecting lightmap/lightprobe +- Fixed zBufferParams with XR single-pass rendering +- Fixed moving objects not rendered in custom passes +- Fixed abstract classes listed in the + menu of the custom pass list +- Fixed custom pass that was rendered in previews +- Fixed precision error in zero value normals when applying decals (case 1181639) +- Fixed issue that triggered No Scene Lighting view in game view as well (case 1156102) +- Assign default volume profile when creating a new HDRP Asset +- Fixed fov to 0 in planar probe breaking the projection matrix (case 1182014) +- Fixed bugs with shadow caching +- Reassign the same camera for a realtime probe face render request to have appropriate history buffer during realtime probe rendering. +- Fixed issue causing wrong shading when normal map mode is Object space, no normal map is set, but a detail map is present (case 1143352) +- Fixed issue with decal and htile optimization +- Fixed TerrainLit shader compilation error regarding `_Control0_TexelSize` redefinition (case 1178480). +- Fixed warning about duplicate HDRuntimeReflectionSystem when configuring play mode without domain reload. +- Fixed an editor crash when multiple decal projectors were selected and some had null material +- Added all relevant fix actions to FixAll button in Wizard +- Moved FixAll button on top of the Wizard +- Fixed an issue where fog color was not pre-exposed correctly +- Fix priority order when custom passes are overlapping +- Fix cleanup not called when the custom pass GameObject is destroyed +- Replaced most instances of GraphicsSettings.renderPipelineAsset by GraphicsSettings.currentRenderPipeline. This should fix some parameters not working on Quality Settings overrides. +- Fixed an issue with Realtime GI not working on upgraded projects. +- Fixed issue with screen space shadows fallback texture was not set as a texture array. +- Fixed Pyramid Lights bounding box +- Fixed terrain heightmap default/null values and epsilons +- Fixed custom post-processing effects breaking when an abstract class inherited from `CustomPostProcessVolumeComponent` +- Fixed XR single-pass rendering in Editor by using ShaderConfig.s_XrMaxViews to allocate matrix array +- Multiple different skies rendered at the same time by different cameras are now handled correctly without flickering +- Fixed flickering issue happening when different volumes have shadow settings and multiple cameras are present. +- Fixed issue causing planar probes to disappear if there is no light in the scene. +- Fixed a number of issues with the prefab isolation mode (Volumes leaking from the main scene and reflection not working properly) +- Fixed an issue with fog volume component upgrade not working properly +- Fixed Spot light Pyramid Shape has shadow artifacts on aspect ratio values lower than 1 +- Fixed issue with AO upsampling in XR +- Fixed camera without HDAdditionalCameraData component not rendering +- Removed the macro ENABLE_RAYTRACING for most of the ray tracing code +- Fixed prefab containing camera reloading in loop while selected in the Project view +- Fixed issue causing NaN wheh the Z scale of an object is set to 0. +- Fixed DXR shader passes attempting to render before pipeline loaded +- Fixed black ambient sky issue when importing a project after deleting Library. +- Fixed issue when upgrading a Standard transparent material (case 1186874) +- Fixed area light cookies not working properly with stack lit +- Fixed material render queue not updated when the shader is changed in the material inspector. +- Fixed a number of issues with full screen debug modes not reseting correctly when setting another mutually exclusive mode +- Fixed compile errors for platforms with no VR support +- Fixed an issue with volumetrics and RTHandle scaling (case 1155236) +- Fixed an issue where sky lighting might be updated uselessly +- Fixed issue preventing to allow setting decal material to none (case 1196129) +- Fixed XR multi-pass decals rendering +- Fixed several fields on Light Inspector that not supported Prefab overrides +- VFX: Removed z-fight glitches that could appear when using deferred depth prepass and lit quad primitives +- VFX: Preserve specular option for lit outputs (matches HDRP lit shader) +- Fixed init of debug for FrameSettingsHistory on SceneView camera +- Added a fix script to handle the warning 'referenced script in (GameObject 'SceneIDMap') is missing' +- Fix Wizard load when none selected for RenderPipelineAsset +- Fixed issue with unclear naming of debug menu for decals. + +### Changed +- Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled +- Rename Emission Radius to Radius in UI in Point, Spot +- Angular Diameter parameter for directional light is no longuer an advanced property +- DXR: Remove Light Radius and Angular Diamater of Raytrace shadow. Angular Diameter and Radius are used instead. +- Remove MaxSmoothness parameters from UI for point, spot and directional light. The MaxSmoothness is now deduce from Radius Parameters +- DXR: Remove the Ray Tracing Environement Component. Add a Layer Mask to the ray Tracing volume components to define which objects are taken into account for each effect. +- Removed second cubemaps used for shadowing in lookdev +- Disable Physically Based Sky below ground +- Increase max limit of area light and reflection probe to 128 +- Change default texture for detailmap to grey +- Optimize Shadow RT load on Tile based architecture platforms. +- Improved quality of SSAO. +- Moved RequestShadowMapRendering() back to public API. +- Update HDRP DXR Wizard with an option to automatically clone the hdrp config package and setup raytracing to 1 in shaders file. +- Added SceneSelection pass for TerrainLit shader. +- Simplified Light's type API regrouping the logic in one place (Check type in HDAdditionalLightData) +- The support of LOD CrossFade (Dithering transition) in master nodes now required to enable it in the master node settings (Save variant) +- Improved shadow bias, by removing constant depth bias and substituting it with slope-scale bias. +- Fix the default stencil values when a material is created from a SSS ShaderGraph. +- Tweak test asset to be compatible with XR: unlit SG material for canvas and double-side font material +- Slightly tweaked the behaviour of bloom when resolution is low to reduce artifacts. +- Hidden fields in Light Inspector that is not relevant while in BakingOnly mode. + +## [7.1.2] - 2019-09-19 + +### Fixed +- Fix/workaround a probable graphics driver bug in the GTAO shader. +- Fixed Hair and PBR shader graphs double sided modes +- Fixed an issue where updating an HDRP asset in the Quality setting panel would not recreate the pipeline. +- Fixed issue with point lights being considered even when occupying less than a pixel on screen (case 1183196) +- Fix a potential NaN source with iridescence (case 1183216) +- Fixed issue of spotlight breaking when minimizing the cone angle via the gizmo (case 1178279) +- Fixed issue that caused decals not to modify the roughness in the normal buffer, causing SSR to not behave correctly (case 1178336) +- Fixed lit transparent refraction with XR single-pass rendering +- Removed extra jitter for TemporalAA in VR +- Fixed ShaderGraph time in main preview +- Fixed issue on some UI elements in HDRP asset not expanding when clicking the arrow (case 1178369) +- Fixed alpha blending in custom post process +- Fixed the modification of the _AlphaCutoff property in the material UI when exposed with a ShaderGraph parameter. +- Fixed HDRP test `1218_Lit_DiffusionProfiles` on Vulkan. +- Fixed an issue where building a player in non-dev mode would generate render target error logs every frame +- Fixed crash when upgrading version of HDRP +- Fixed rendering issues with material previews +- Fixed NPE when using light module in Shuriken particle systems (1173348). +- Refresh cached shadow on editor changes + ## [7.1.1] - 2019-09-05 ### Added 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 bd41dd2e4e1..51409175f00 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -2,7 +2,6 @@ using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using System.Text; -using Utilities; using UnityEngine.Experimental.Rendering; using static UnityEngine.Rendering.HighDefinition.RenderPipelineSettings; diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs index 3a5972baca5..6901660a3c6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs @@ -1,8 +1,7 @@ using System; using UnityEngine; using UnityEngine.Rendering.HighDefinition; -using UnityEditor.Rendering; -using Utilities; +using UnityEngine.Rendering; namespace UnityEditor.Rendering.HighDefinition { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 6dad9dea362..2ec922ed688 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Utilities; using UnityEngine.Experimental.Rendering; using UnityEngine.Experimental.Rendering.RenderGraphModule; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 57fb32f0858..20d58b31824 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -6,7 +6,6 @@ using UnityEngine.Experimental.GlobalIllumination; using UnityEngine.Experimental.Rendering; using UnityEngine.Experimental.Rendering.RenderGraphModule; -using Utilities; namespace UnityEngine.Rendering.HighDefinition { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs index d40e6bbfb3d..de83731a0eb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using UnityEngine.Serialization; -using Utilities; namespace UnityEngine.Rendering.HighDefinition { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index 1bad98da64e..774bc661c16 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -3,7 +3,6 @@ using System.Diagnostics; using System.Reflection; using System.Linq; -using Utilities; namespace UnityEngine.Rendering.HighDefinition { From bb430d67e052f8b5db6f84723eab2ee522493351 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Thu, 19 Mar 2020 14:32:20 +0000 Subject: [PATCH 28/84] Fix issue on thumbnail generation so that no error on new project and thumbnail are generated at first import #6265 --- .../CHANGELOG.md | 724 ++++++++---------- .../Lighting/Reflection/HDCubemapInspector.cs | 55 +- .../Runtime/RenderPipeline/Utility/HDUtils.cs | 36 + 3 files changed, 416 insertions(+), 399 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 417d14fe290..61a5e0d706f 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,26 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -### Added -- Add XR setting to control camera jitter for temporal effects #6259 - -### Fixed -- Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. - -### Changed -- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. -- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. - -## [7.3.0] - 2020-03-11 - ### Added - Added the exposure sliders to the planar reflection probe preview - Added a warning and workaround instructions that appear when you enable XR single-pass after the first frame with the XR SDK. - Added an "enable" toggle to the SSR volume component. +- Added support of cookie baking and add support on Disc light. +- Added XR setting to control camera jitter for temporal effects ### Fixed +- Fix Changelog - Fixed issue with AssetPostprocessors dependencies causing models to be imported twice when upgrading the package version. -- Fix player build DX12 - Fix issue with AO being misaligned when multiple view are visible. - Fix issue that caused the clamp of camera rotation motion for motion blur to be ineffective. - Fixed culling of lights with XR SDK @@ -49,34 +39,69 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed invalid game view rendering when disabling all cameras in the scene (case 1105163) - Fixed infinite reload loop while displaying Light's Shadow's Link Light Layer in Inspector of Prefab Asset. - Fixed the cookie atlas size and planar atlas size being too big after an upgrade of the HDRP asset. -- Fixed alpha clipping test (comparison was '>', now '>=') -- Fixed preview camera (eg. shader graph preview) when path tracing is on -- Fixed DXR player build +- Fix player build DX12 - Fixed compilation issue with linux vulkan and raytrace shader - Fixed the HDRP asset migration code not being called after an upgrade of the package - Fixed draw renderers custom pass out of bound exception - Fixed an issue with emissive light meshes not being in the RAS. -- Fixed a warning due to StaticLightingSky when reloading domain in some cases. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. -- Fix an exception in case two LOD levels are using the same mesh renderer. - Fixed error in the console when switching shader to decal in the material UI. - Fixed z-fighting in scene view when scene lighting is off (case 1203927) -- Fixed some typos in debug menu (case 1224594) +- Fixed issue that prevented cubemap thumbnails from rendering. +- Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. +- Fix some typos in the debug menu. +- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. - Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). +- Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. +- Fixed cubemap thumbnail generation at project load time. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. - Light dimmer can now get values higher than one and was renamed to multiplier in the UI. - Removed info box requesting volume component for Visual Environment and updated the documentation with the relevant information. +- Removed legacy VR code - Add range-based clipping to box lights (case 1178780) - Improve area light culling (case 1085873) -- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. -- Utilities namespace is obsolete, moved its content to UnityEngine.Rendering (case 1204677) +- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. +- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. -## [7.2.0] - 2020-02-10 +## [8.0.0] - 2020-05-25 ### Added +- Ray tracing support for VR single-pass +- Added sharpen filter shader parameter and UI for TemporalAA to control image quality instead of hardcoded value +- Added frame settings option for custom post process and custom passes as well as custom color buffer format option. +- Add check in wizard on SRP Batcher enabled. +- Added default implementations of OnPreprocessMaterialDescription for FBX, Obj, Sketchup and 3DS file formats. +- Added custom pass fade radius +- Added after post process injection point for custom passes +- Added basic alpha compositing support - Alpha is available afterpostprocess when using FP16 buffer format. +- Added falloff distance on Reflection Probe and Planar Reflection Probe +- Added Backplate projection from the HDRISky +- Added Shadow Matte in UnlitMasterNode, which only received shadow without lighting +- Added hability to name LightLayers in HDRenderPipelineAsset +- Added a range compression factor for Reflection Probe and Planar Reflection Probe to avoid saturation of colors. +- Added path tracing support for directional, point and spot lights, as well as emission from Lit and Unlit. +- Added non temporal version of SSAO. +- Added more detailed ray tracing stats in the debug window +- Added Disc area light (bake only) +- Added a warning in the material UI to prevent transparent + subsurface-scattering combination. +- Added XR single-pass setting into HDRP asset +- Added a penumbra tint option for lights +- Added support for depth copy with XR SDK +- Added debug setting to Render Pipeline Debug Window to list the active XR views +- Added an option to filter the result of the volumetric lighting (off by default). +- Added a transmission multiplier for directional lights +- Added XR single-pass test mode to Render Pipeline Debug Window +- Added debug setting to Render Pipeline Window to list the active XR views +- Added a new refraction mode for the Lit shader (thin). Which is a box refraction with small thickness values +- Added the code to support Barn Doors for Area Lights based on a shaderconfig option. +- Added HDRPCameraBinder property binder for Visual Effect Graph +- Added "Celestial Body" controls to the Directional Light +- Added new parameters to the Physically Based Sky +- Added Reflections to the DXR Wizard - Added the possibility to have ray traced colored and semi-transparent shadows on directional lights. +- Added a check in the custom post process template to throw an error if the default shader is not found. - Exposed the debug overlay ratio in the debug menu. - Added a separate frame settings for tonemapping alongside color grading. - Added the receive fog option in the material UI for ShaderGraphs. @@ -85,7 +110,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added Contrast Adaptive Sharpen (CAS) Upscaling effect. - Added APIs to update probe settings at runtime. - Added documentation for the rayTracingSupported method in HDRP -- Added user-selectable format for the post processing passes. +- Added user-selectable format for the post processing passes. - Added support for alpha channel in some post-processing passes (DoF, TAA, Uber). - Added warnings in FrameSettings inspector when using DXR and atempting to use Asynchronous Execution. - Exposed Stencil bits that can be used by the user. @@ -98,7 +123,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added the alpha clip enabled toggle to the material UI for all HDRP shader graphs. - Added Material Samples to explain how to use the lit shader features - Added an initial implementation of ray traced sub surface scattering -- Added AssetPostprocessors and Shadergraphs to handle Arnold Standard Surface and 3DsMax Physical material import from FBX. +- Added AssetPostprocessors and Shadergraphs to handle Arnold Standard Surface and 3DsMax Physical material import from FBX. - Added support for Smoothness Fade start work when enabling ray traced reflections. - Added Contact shadow, Micro shadows and Screen space refraction API documentation. - Added script documentation for SSR, SSAO (ray tracing), GI, Light Cluster, RayTracingSettings, Ray Counters, etc. @@ -108,36 +133,251 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Update documentation of HDRISky-Backplate, precise how to have Ambient Occlusion on the Backplate +- Sorting, undo, labels, layout in the Lighting Explorer. +- Fixed sky settings and materials in Shader Graph Samples package +- Fix/workaround a probable graphics driver bug in the GTAO shader. +- Fixed Hair and PBR shader graphs double sided modes +- Fixed an issue where updating an HDRP asset in the Quality setting panel would not recreate the pipeline. +- Fixed issue with point lights being considered even when occupying less than a pixel on screen (case 1183196) +- Fix a potential NaN source with iridescence (case 1183216) +- Fixed issue of spotlight breaking when minimizing the cone angle via the gizmo (case 1178279) +- Fixed issue that caused decals not to modify the roughness in the normal buffer, causing SSR to not behave correctly (case 1178336) +- Fixed lit transparent refraction with XR single-pass rendering +- Removed extra jitter for TemporalAA in VR +- Fixed ShaderGraph time in main preview +- Fixed issue on some UI elements in HDRP asset not expanding when clicking the arrow (case 1178369) +- Fixed alpha blending in custom post process +- Fixed the modification of the _AlphaCutoff property in the material UI when exposed with a ShaderGraph parameter. +- Fixed HDRP test `1218_Lit_DiffusionProfiles` on Vulkan. +- Fixed an issue where building a player in non-dev mode would generate render target error logs every frame +- Fixed crash when upgrading version of HDRP +- Fixed rendering issues with material previews +- Fixed NPE when using light module in Shuriken particle systems (1173348). +- Refresh cached shadow on editor changes +- Fixed light supported units caching (1182266) +- Fixed an issue where SSAO (that needs temporal reprojection) was still being rendered when Motion Vectors were not available (case 1184998) +- Fixed a nullref when modifying the height parameters inside the layered lit shader UI. +- Fixed Decal gizmo that become white after exiting play mode +- Fixed Decal pivot position to behave like a spotlight +- Fixed an issue where using the LightingOverrideMask would break sky reflection for regular cameras +- Fix DebugMenu FrameSettingsHistory persistency on close +- Fix DensityVolume, ReflectionProbe aned PlanarReflectionProbe advancedControl display +- Fix DXR scene serialization in wizard +- Fixed an issue where Previews would reallocate History Buffers every frame +- Fixed the SetLightLayer function in HDAdditionalLightData setting the wrong light layer +- Fix error first time a preview is created for planar +- Fixed an issue where SSR would use an incorrect roughness value on ForwardOnly (StackLit, AxF, Fabric, etc.) materials when the pipeline is configured to also allow deferred Lit. +- Fixed issues with light explorer (cases 1183468, 1183269) +- Fix dot colors in LayeredLit material inspector +- Fix undo not resetting all value when undoing the material affectation in LayerLit material +- Fix for issue that caused gizmos to render in render textures (case 1174395) +- Fixed the light emissive mesh not updated when the light was disabled/enabled +- Fixed light and shadow layer sync when setting the HDAdditionalLightData.lightlayersMask property +- Fixed a nullref when a custom post process component that was in the HDRP PP list is removed from the project +- Fixed issue that prevented decals from modifying specular occlusion (case 1178272). +- Fixed exposure of volumetric reprojection +- Fixed multi selection support for Scalable Settings in lights +- Fixed font shaders in test projects for VR by using a Shader Graph version +- Fixed refresh of baked cubemap by incrementing updateCount at the end of the bake (case 1158677). +- Fixed issue with rectangular area light when seen from the back +- Fixed decals not affecting lightmap/lightprobe +- Fixed zBufferParams with XR single-pass rendering +- Fixed moving objects not rendered in custom passes +- Fixed abstract classes listed in the + menu of the custom pass list +- Fixed custom pass that was rendered in previews +- Fixed precision error in zero value normals when applying decals (case 1181639) +- Fixed issue that triggered No Scene Lighting view in game view as well (case 1156102) +- Assign default volume profile when creating a new HDRP Asset +- Fixed fov to 0 in planar probe breaking the projection matrix (case 1182014) +- Fixed bugs with shadow caching +- Reassign the same camera for a realtime probe face render request to have appropriate history buffer during realtime probe rendering. +- Fixed issue causing wrong shading when normal map mode is Object space, no normal map is set, but a detail map is present (case 1143352) +- Fixed issue with decal and htile optimization +- Fixed TerrainLit shader compilation error regarding `_Control0_TexelSize` redefinition (case 1178480). +- Fixed warning about duplicate HDRuntimeReflectionSystem when configuring play mode without domain reload. +- Fixed an editor crash when multiple decal projectors were selected and some had null material +- Added all relevant fix actions to FixAll button in Wizard +- Moved FixAll button on top of the Wizard +- Fixed an issue where fog color was not pre-exposed correctly +- Fix priority order when custom passes are overlapping +- Fix cleanup not called when the custom pass GameObject is destroyed +- Replaced most instances of GraphicsSettings.renderPipelineAsset by GraphicsSettings.currentRenderPipeline. This should fix some parameters not working on Quality Settings overrides. +- Fixed an issue with Realtime GI not working on upgraded projects. +- Fixed issue with screen space shadows fallback texture was not set as a texture array. +- Fixed Pyramid Lights bounding box +- Fixed terrain heightmap default/null values and epsilons +- Fixed custom post-processing effects breaking when an abstract class inherited from `CustomPostProcessVolumeComponent` +- Fixed XR single-pass rendering in Editor by using ShaderConfig.s_XrMaxViews to allocate matrix array +- Multiple different skies rendered at the same time by different cameras are now handled correctly without flickering +- Fixed flickering issue happening when different volumes have shadow settings and multiple cameras are present. +- Fixed issue causing planar probes to disappear if there is no light in the scene. +- Fixed a number of issues with the prefab isolation mode (Volumes leaking from the main scene and reflection not working properly) +- Fixed an issue with fog volume component upgrade not working properly +- Fixed Spot light Pyramid Shape has shadow artifacts on aspect ratio values lower than 1 +- Fixed issue with AO upsampling in XR +- Fixed camera without HDAdditionalCameraData component not rendering +- Removed the macro ENABLE_RAYTRACING for most of the ray tracing code +- Fixed prefab containing camera reloading in loop while selected in the Project view +- Fixed issue causing NaN wheh the Z scale of an object is set to 0. +- Fixed DXR shader passes attempting to render before pipeline loaded +- Fixed black ambient sky issue when importing a project after deleting Library. +- Fixed issue when upgrading a Standard transparent material (case 1186874) +- Fixed area light cookies not working properly with stack lit +- Fixed material render queue not updated when the shader is changed in the material inspector. +- Fixed a number of issues with full screen debug modes not reseting correctly when setting another mutually exclusive mode +- Fixed compile errors for platforms with no VR support +- Fixed an issue with volumetrics and RTHandle scaling (case 1155236) +- Fixed an issue where sky lighting might be updated uselessly +- Fixed issue preventing to allow setting decal material to none (case 1196129) +- Fixed XR multi-pass decals rendering +- Fixed several fields on Light Inspector that not supported Prefab overrides +- Fixed EOL for some files +- Fixed scene view rendering with volumetrics and XR enabled +- Fixed decals to work with multiple cameras +- Fixed optional clear of GBuffer (Was always on) +- Fixed render target clears with XR single-pass rendering +- Fixed HDRP samples file hierarchy +- Fixed Light units not matching light type +- Fixed QualitySettings panel not displaying HDRP Asset +- Fixed black reflection probes the first time loading a project +- Fixed y-flip in scene view with XR SDK +- Fixed Decal projectors do not immediately respond when parent object layer mask is changed in editor. +- Fixed y-flip in scene view with XR SDK +- Fixed a number of issues with Material Quality setting +- Fixed the transparent Cull Mode option in HD unlit master node settings only visible if double sided is ticked. +- Fixed an issue causing shadowed areas by contact shadows at the edge of far clip plane if contact shadow length is very close to far clip plane. +- Fixed editing a scalable settings will edit all loaded asset in memory instead of targetted asset. +- Fixed Planar reflection default viewer FOV +- Fixed flickering issues when moving the mouse in the editor with ray tracing on. +- Fixed the ShaderGraph main preview being black after switching to SSS in the master node settings +- Fixed custom fullscreen passes in VR +- Fixed camera culling masks not taken in account in custom pass volumes +- Fixed object not drawn in custom pass when using a DrawRenderers with an HDRP shader in a build. +- Fixed injection points for Custom Passes (AfterDepthAndNormal and BeforePreRefraction were missing) +- Fixed a enum to choose shader tags used for drawing objects (DepthPrepass or Forward) when there is no override material. +- Fixed lit objects in the BeforePreRefraction, BeforeTransparent and BeforePostProcess. +- Fixed the None option when binding custom pass render targets to allow binding only depth or color. +- Fixed custom pass buffers allocation so they are not allocated if they're not used. +- Fixed the Custom Pass entry in the volume create asset menu items. +- Fixed Prefab Overrides workflow on Camera. +- Fixed alignment issue in Preset for Camera. +- Fixed alignment issue in Physical part for Camera. +- Fixed FrameSettings multi-edition. +- Fixed a bug happening when denoising multiple ray traced light shadows +- Fixed minor naming issues in ShaderGraph settings +- VFX: Removed z-fight glitches that could appear when using deferred depth prepass and lit quad primitives +- VFX: Preserve specular option for lit outputs (matches HDRP lit shader) +- Fixed an issue with Metal Shader Compiler and GTAO shader for metal +- Fixed resources load issue while upgrading HDRP package. +- Fix LOD fade mask by accounting for field of view +- Fixed spot light missing from ray tracing indirect effects. +- Fixed a UI bug in the diffusion profile list after fixing them from the wizard. +- Fixed the hash collision when creating new diffusion profile assets. +- Fixed a light leaking issue with box light casting shadows (case 1184475) +- Fixed Cookie texture type in the cookie slot of lights (Now displays a warning because it is not supported). +- Fixed a nullref that happens when using the Shuriken particle light module +- Fixed alignment in Wizard +- Fixed text overflow in Wizard's helpbox +- Fixed Wizard button fix all that was not automatically grab all required fixes +- Fixed VR tab for MacOS in Wizard +- Fixed local config package workflow in Wizard +- Fixed issue with contact shadows shifting when MSAA is enabled. +- Fixed EV100 in the PBR sky +- Fixed an issue In URP where sometime the camera is not passed to the volume system and causes a null ref exception (case 1199388) +- Fixed nullref when releasing HDRP with custom pass disabled +- Fixed performance issue derived from copying stencil buffer. +- Fixed an editor freeze when importing a diffusion profile asset from a unity package. +- Fixed an exception when trying to reload a builtin resource. +- Fixed the light type intensity unit reset when switching the light type. +- Fixed compilation error related to define guards and CreateLayoutFromXrSdk() +- Fixed documentation link on CustomPassVolume. +- Fixed player build when HDRP is in the project but not assigned in the graphic settings. +- Fixed an issue where ambient probe would be black for the first face of a baked reflection probe +- VFX: Fixed Missing Reference to Visual Effect Graph Runtime Assembly +- Fixed an issue where rendering done by users in EndCameraRendering would be executed before the main render loop. +- Fixed Prefab Override in main scope of Volume. +- Fixed alignment issue in Presset of main scope of Volume. +- Fixed persistence of ShowChromeGizmo and moved it to toolbar for coherency in ReflectionProbe and PlanarReflectionProbe. +- Fixed Alignement issue in ReflectionProbe and PlanarReflectionProbe. +- Fixed Prefab override workflow issue in ReflectionProbe and PlanarReflectionProbe. +- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in ReflectionProbe and PlanarReflectionProbe. +- Fixed Prefab override workflow issue in DensityVolume. +- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in DensityVolume. +- Fix light limit counts specified on the HDRP asset +- Fixed Quality Settings for SSR, Contact Shadows and Ambient Occlusion volume components +- Fixed decalui deriving from hdshaderui instead of just shaderui +- Use DelayedIntField instead of IntField for scalable settings +- Fixed init of debug for FrameSettingsHistory on SceneView camera +- Added a fix script to handle the warning 'referenced script in (GameObject 'SceneIDMap') is missing' +- Fix Wizard load when none selected for RenderPipelineAsset - Fixed TerrainLitGUI when per-pixel normal property is not present. -- Fixed a bug due to depth history begin overriden too soon -- Fixed issue that caused Distortion UI to appear in Lit. -- Fixed several issues with decal duplicating when editing them. -- Fixed initialization of volumetric buffer params (1204159) -- Fixed an issue where frame count was incorrectly reset for the game view, causing temporal processes to fail. -- Fixed Culling group was not disposed error. -- Fixed issues on some GPU that do not support gathers on integer textures. -- Fixed an issue with ambient probe not being initialized for the first frame after a domain reload for volumetric fog. -- Fixed the scene visibility of decal projectors and density volumes -- Fixed a leak in sky manager. -- Fixed an issue where entering playmode while the light editor is opened would produce null reference exceptions. -- Fixed the debug overlay overlapping the debug menu at runtime. -- Fixed an issue with the framecount when changing scene. -- Fixed errors that occurred when using invalid near and far clip plane values for planar reflections. -- Fixed issue with motion blur sample weighting function. -- Fixed motion vectors in MSAA. -- Fixed sun flare blending (case 1205862). -- Fixed a lot of issues related to ray traced screen space shadows. -- Fixed memory leak caused by apply distortion material not being disposed. -- Fixed Reflection probe incorrectly culled when moving its parent (case 1207660) -- Fixed a nullref when upgrading the Fog volume components while the volume is opened in the inspector. -- Fix issues where decals on PS4 would not correctly write out the tile mask causing bits of the decal to go missing. -- Use appropriate label width and text content so the label is completely visible -- Fixed an issue where final post process pass would not output the default alpha value of 1.0 when using 11_11_10 color buffer format. -- Fixed SSR issue after the MSAA Motion Vector fix. -- Fixed an issue with PCSS on directional light if punctual shadow atlas was not allocated. -- Fixed an issue where shadow resolution would be wrong on the first face of a baked reflection probe. -- Fixed issue with PCSS softness being incorrect for cascades different than the first one. -- Fixed custom post process not rendering when using multiple HDRP asset in quality settings +- Fixed rendering errors when enabling debug modes with custom passes +- Fix an issue that made PCSS dependent on Atlas resolution (not shadow map res) +- Fixing a bug whith histories when n>4 for ray traced shadows +- Fixing wrong behavior in ray traced shadows for mesh renderers if their cast shadow is shadow only or double sided +- Only tracing rays for shadow if the point is inside the code for spotlight shadows +- Only tracing rays if the point is inside the range for point lights +- Fixing ghosting issues when the screen space shadow indexes change for a light with ray traced shadows +- Fixed an issue with stencil management and Xbox One build that caused corrupted output in deferred mode. +- Fixed a mismatch in behavior between the culling of shadow maps and ray traced point and spot light shadows +- Fixed recursive ray tracing not working anymore after intermediate buffer refactor. +- Fixed ray traced shadow denoising not working (history rejected all the time). +- Fixed shader warning on xbox one +- Fixed cookies not working for spot lights in ray traced reflections, ray traced GI and recursive rendering +- Fixed an inverted handling of CoatSmoothness for SSR in StackLit. +- Fixed missing distortion inputs in Lit and Unlit material UI. +- Fixed issue that propagated NaNs across multiple frames through the exposure texture. +- Fixed issue with Exclude from TAA stencil ignored. +- Fixed ray traced reflection exposure issue. +- Fixed issue with TAA history not initialising corretly scale factor for first frame +- Fixed issue with stencil test of material classification not using the correct Mask (causing false positive and bad performance with forward material in deferred) +- Fixed issue with History not reset when chaning antialiasing mode on camera +- Fixed issue with volumetric data not being initialized if default settings have volumetric and reprojection off. +- Fixed ray tracing reflection denoiser not applied in tier 1 +- Fixed the vibility of ray tracing related methods. +- Fixed the diffusion profile list not saved when clicking the fix button in the material UI. +- Fixed crash when pushing bounce count higher than 1 for ray traced GI or reflections +- Fixed PCSS softness scale so that it better match ray traced reference for punctual lights. +- Fixed exposure management for the path tracer +- Fixed AxF material UI containing two advanced options settings. +- Fixed an issue where cached sky contexts were being destroyed wrongly, breaking lighting in the LookDev +- Fixed issue that clamped PCSS softness too early and not after distance scale. +- Fixed fog affect transparent on HD unlit master node +- Fixed custom post processes re-ordering not saved. +- Fixed NPE when using scalable settings +- Fixed an issue where PBR sky precomputation was reset incorrectly in some cases causing bad performance. +- Fixed a bug due to depth history begin overriden too soon +- Fixed CustomPassSampleCameraColor scale issue when called from Before Transparent injection point. +- Fixed corruption of AO in baked probes. +- Fixed issue with upgrade of projects that still had Very High as shadow filtering quality. +- Fixed issue that caused Distortion UI to appear in Lit. +- Fixed several issues with decal duplicating when editing them. +- Fixed initialization of volumetric buffer params (1204159) +- Fixed an issue where frame count was incorrectly reset for the game view, causing temporal processes to fail. +- Fixed Culling group was not disposed error. +- Fixed issues on some GPU that do not support gathers on integer textures. +- Fixed an issue with ambient probe not being initialized for the first frame after a domain reload for volumetric fog. +- Fixed the scene visibility of decal projectors and density volumes +- Fixed a leak in sky manager. +- Fixed an issue where entering playmode while the light editor is opened would produce null reference exceptions. +- Fixed the debug overlay overlapping the debug menu at runtime. +- Fixed an issue with the framecount when changing scene. +- Fixed errors that occurred when using invalid near and far clip plane values for planar reflections. +- Fixed issue with motion blur sample weighting function. +- Fixed motion vectors in MSAA. +- Fixed sun flare blending (case 1205862). +- Fixed a lot of issues related to ray traced screen space shadows. +- Fixed memory leak caused by apply distortion material not being disposed. +- Fixed Reflection probe incorrectly culled when moving its parent (case 1207660) +- Fixed a nullref when upgrading the Fog volume components while the volume is opened in the inspector. +- Fix issues where decals on PS4 would not correctly write out the tile mask causing bits of the decal to go missing. +- Use appropriate label width and text content so the label is completely visible +- Fixed an issue where final post process pass would not output the default alpha value of 1.0 when using 11_11_10 color buffer format. +- Fixed SSR issue after the MSAA Motion Vector fix. +- Fixed an issue with PCSS on directional light if punctual shadow atlas was not allocated. +- Fixed an issue where shadow resolution would be wrong on the first face of a baked reflection probe. +- Fixed issue with PCSS softness being incorrect for cascades different than the first one. +- Fixed custom post process not rendering when using multiple HDRP asset in quality settings - Fixed probe gizmo missing id (case 1208975) - Fixed a warning in raytracingshadowfilter.compute - Fixed issue with AO breaking with small near plane values. @@ -145,7 +385,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed shader warning in AO code. - Fixed a warning in simpledenoiser.compute - Fixed tube and rectangle light culling to use their shape instead of their range as a bounding box. -- Fixed caused by using gather on a UINT texture in motion blur. +- Fixed caused by using gather on a UINT texture in motion blur. - Fix issue with ambient occlusion breaking when dynamic resolution is active. - Fixed some possible NaN causes in Depth of Field. - Fixed Custom Pass nullref due to the new Profiling Sample API changes @@ -228,8 +468,48 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue with MipRatio debug mode showing _DebugMatCapTexture not being set. - Fixed missing initialization of input params in Blit for VR. - Fix Inf source in LTC for area lights. +- Fixed alpha clipping test (comparison was '>', now '>=') +- Fixed preview camera (eg. shader graph preview) when path tracing is on +- Fixed issue with unclear naming of debug menu for decals. ### Changed +- Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled +- Rename Emission Radius to Radius in UI in Point, Spot +- Angular Diameter parameter for directional light is no longuer an advanced property +- DXR: Remove Light Radius and Angular Diamater of Raytrace shadow. Angular Diameter and Radius are used instead. +- Remove MaxSmoothness parameters from UI for point, spot and directional light. The MaxSmoothness is now deduce from Radius Parameters +- DXR: Remove the Ray Tracing Environement Component. Add a Layer Mask to the ray Tracing volume components to define which objects are taken into account for each effect. +- Removed second cubemaps used for shadowing in lookdev +- Disable Physically Based Sky below ground +- Increase max limit of area light and reflection probe to 128 +- Change default texture for detailmap to grey +- Optimize Shadow RT load on Tile based architecture platforms. +- Improved quality of SSAO. +- Moved RequestShadowMapRendering() back to public API. +- Update HDRP DXR Wizard with an option to automatically clone the hdrp config package and setup raytracing to 1 in shaders file. +- Added SceneSelection pass for TerrainLit shader. +- Simplified Light's type API regrouping the logic in one place (Check type in HDAdditionalLightData) +- The support of LOD CrossFade (Dithering transition) in master nodes now required to enable it in the master node settings (Save variant) +- Improved shadow bias, by removing constant depth bias and substituting it with slope-scale bias. +- Fix the default stencil values when a material is created from a SSS ShaderGraph. +- Tweak test asset to be compatible with XR: unlit SG material for canvas and double-side font material +- Slightly tweaked the behaviour of bloom when resolution is low to reduce artifacts. +- Hidden fields in Light Inspector that is not relevant while in BakingOnly mode. +- Changed parametrization of PCSS, now softness is derived from angular diameter (for directional lights) or shape radius (for point/spot lights) and min filter size is now in the [0..1] range. +- Moved the copy of the geometry history buffers to right after the depth mip chain generation. +- Rename "Luminance" to "Nits" in UX for physical light unit +- Rename FrameSettings "SkyLighting" to "SkyReflection" +- Reworked XR automated tests +- The ray traced screen space shadow history for directional, spot and point lights is discarded if the light transform has changed. +- Changed the behavior for ray tracing in case a mesh renderer has both transparent and opaque submeshes. +- Improve history buffer management +- Replaced PlayerSettings.virtualRealitySupported with XRGraphics.tryEnable. +- Remove redundant FrameSettings RealTimePlanarReflection +- Improved a bit the GC calls generated during the rendering. +- Material update is now only triggered when the relevant settings are touched in the shader graph master nodes +- Changed the way Sky Intensity (on Sky volume components) is handled. It's now a combo box where users can choose between Exposure, Multiplier or Lux (for HDRI sky only) instead of both multiplier and exposure being applied all the time. Added a new menu item to convert old profiles. +- Change how method for specular occlusions is decided on inspector shader (Lit, LitTesselation, LayeredLit, LayeredLitTessellation) +- Unlocked SSS, SSR, Motion Vectors and Distortion frame settings for reflections probes. - Hide unused LOD settings in Quality Settings legacy window. - Reduced the constrained distance for temporal reprojection of ray tracing denoising - Removed shadow near plane from the Directional Light Shadow UI. @@ -277,342 +557,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Moved BeginCameraRendering callback right before culling. - Changed the visibility of the Indirect Lighting Controller component to public. -## [7.1.8] - 2020-01-20 - -### Fixed -- Fixed white and dark flashes on scenes with very high or very low exposure when Automatic Exposure is being used. -- Fixed memory leak in Sky when in matcap mode. - -### Changed -- On Xbox and PS4 you will also need to download the com.unity.render-pipeline.platform (ps4 or xboxone) package from the appropriate platform developer forum - -## [7.1.7] - 2019-12-11 - -### Added -- Added a check in the custom post process template to throw an error if the default shader is not found. - -### Fixed -- Fixed rendering errors when enabling debug modes with custom passes -- Fix an issue that made PCSS dependent on Atlas resolution (not shadow map res) -- Fixing a bug whith histories when n>4 for ray traced shadows -- Fixing wrong behavior in ray traced shadows for mesh renderers if their cast shadow is shadow only or double sided -- Only tracing rays for shadow if the point is inside the code for spotlight shadows -- Only tracing rays if the point is inside the range for point lights -- Fixing ghosting issues when the screen space shadow indexes change for a light with ray traced shadows -- Fixed an issue with stencil management and Xbox One build that caused corrupted output in deferred mode. -- Fixed a mismatch in behavior between the culling of shadow maps and ray traced point and spot light shadows -- Fixed recursive ray tracing not working anymore after intermediate buffer refactor. -- Fixed ray traced shadow denoising not working (history rejected all the time). -- Fixed shader warning on xbox one -- Fixed cookies not working for spot lights in ray traced reflections, ray traced GI and recursive rendering -- Fixed an inverted handling of CoatSmoothness for SSR in StackLit. -- Fixed missing distortion inputs in Lit and Unlit material UI. -- Fixed issue that propagated NaNs across multiple frames through the exposure texture. -- Fixed issue with Exclude from TAA stencil ignored. -- Fixed ray traced reflection exposure issue. -- Fixed issue with TAA history not initialising corretly scale factor for first frame -- Fixed issue with stencil test of material classification not using the correct Mask (causing false positive and bad performance with forward material in deferred) -- Fixed issue with History not reset when chaning antialiasing mode on camera -- Fixed issue with volumetric data not being initialized if default settings have volumetric and reprojection off. -- Fixed ray tracing reflection denoiser not applied in tier 1 -- Fixed the vibility of ray tracing related methods. -- Fixed the diffusion profile list not saved when clicking the fix button in the material UI. -- Fixed crash when pushing bounce count higher than 1 for ray traced GI or reflections -- Fixed PCSS softness scale so that it better match ray traced reference for punctual lights. -- Fixed exposure management for the path tracer -- Fixed AxF material UI containing two advanced options settings. -- Fixed an issue where cached sky contexts were being destroyed wrongly, breaking lighting in the LookDev -- Fixed issue that clamped PCSS softness too early and not after distance scale. -- Fixed fog affect transparent on HD unlit master node -- Fixed custom post processes re-ordering not saved. -- Fixed NPE when using scalable settings -- Fixed an issue where PBR sky precomputation was reset incorrectly in some cases causing bad performance. -- Fixed a bug in dxr due to depth history begin overriden too soon -- Fixed CustomPassSampleCameraColor scale issue when called from Before Transparent injection point. -- Fixed corruption of AO in baked probes. -- Fixed issue with upgrade of projects that still had Very High as shadow filtering quality. -- Removed shadow near plane from the Directional Light Shadow UI. -- Fixed performance issue with performances of custom pass culling. - -## [7.1.6] - 2019-11-22 - -### Added -- Added Backplate projection from the HDRISky -- Added Shadow Matte in UnlitMasterNode, which only received shadow without lighting -- Added support for depth copy with XR SDK -- Added debug setting to Render Pipeline Debug Window to list the active XR views -- Added an option to filter the result of the volumetric lighting (off by default). -- Added a transmission multiplier for directional lights -- Added XR single-pass test mode to Render Pipeline Debug Window -- Added debug setting to Render Pipeline Window to list the active XR views -- Added a new refraction mode for the Lit shader (thin). Which is a box refraction with small thickness values -- Added the code to support Barn Doors for Area Lights based on a shaderconfig option. -- Added HDRPCameraBinder property binder for Visual Effect Graph -- Added "Celestial Body" controls to the Directional Light -- Added new parameters to the Physically Based Sky -- Added Reflections to the DXR Wizard - -### Fixed -- Fixed y-flip in scene view with XR SDK -- Fixed Decal projectors do not immediately respond when parent object layer mask is changed in editor. -- Fixed y-flip in scene view with XR SDK -- Fixed a number of issues with Material Quality setting -- Fixed the transparent Cull Mode option in HD unlit master node settings only visible if double sided is ticked. -- Fixed an issue causing shadowed areas by contact shadows at the edge of far clip plane if contact shadow length is very close to far clip plane. -- Fixed editing a scalable settings will edit all loaded asset in memory instead of targetted asset. -- Fixed Planar reflection default viewer FOV -- Fixed flickering issues when moving the mouse in the editor with ray tracing on. -- Fixed the ShaderGraph main preview being black after switching to SSS in the master node settings -- Fixed custom fullscreen passes in VR -- Fixed camera culling masks not taken in account in custom pass volumes -- Fixed object not drawn in custom pass when using a DrawRenderers with an HDRP shader in a build. -- Fixed injection points for Custom Passes (AfterDepthAndNormal and BeforePreRefraction were missing) -- Fixed a enum to choose shader tags used for drawing objects (DepthPrepass or Forward) when there is no override material. -- Fixed lit objects in the BeforePreRefraction, BeforeTransparent and BeforePostProcess. -- Fixed the None option when binding custom pass render targets to allow binding only depth or color. -- Fixed custom pass buffers allocation so they are not allocated if they're not used. -- Fixed the Custom Pass entry in the volume create asset menu items. -- Fixed Prefab Overrides workflow on Camera. -- Fixed alignment issue in Preset for Camera. -- Fixed alignment issue in Physical part for Camera. -- Fixed FrameSettings multi-edition. -- Fixed a bug happening when denoising multiple ray traced light shadows -- Fixed minor naming issues in ShaderGraph settings -- Fixed an issue with Metal Shader Compiler and GTAO shader for metal -- Fixed resources load issue while upgrading HDRP package. -- Fixed LOD fade mask by accounting for field of view -- Fixed spot light missing from ray tracing indirect effects. -- Fixed a UI bug in the diffusion profile list after fixing them from the wizard. -- Fixed the hash collision when creating new diffusion profile assets. -- Fixed a light leaking issue with box light casting shadows (case 1184475) -- Fixed Cookie texture type in the cookie slot of lights (Now displays a warning because it is not supported). -- Fixed a nullref that happens when using the Shuriken particle light module -- Fixed alignment in Wizard -- Fixed text overflow in Wizard's helpbox -- Fixed Wizard button fix all that was not automatically grab all required fixes -- Fixed VR tab for MacOS in Wizard -- Fixed local config package workflow in Wizard -- Fixed issue with contact shadows shifting when MSAA is enabled. -- Fixed EV100 in the PBR sky -- Fixed an issue In URP where sometime the camera is not passed to the volume system and causes a null ref exception (case 1199388) -- Fixed nullref when releasing HDRP with custom pass disabled -- Fixed performance issue derived from copying stencil buffer. -- Fixed an editor freeze when importing a diffusion profile asset from a unity package. -- Fixed an exception when trying to reload a builtin resource. -- Fixed the light type intensity unit reset when switching the light type. -- Fixed compilation error related to define guards and CreateLayoutFromXrSdk() -- Fixed documentation link on CustomPassVolume. -- Fixed player build when HDRP is in the project but not assigned in the graphic settings. -- Fixed an issue where ambient probe would be black for the first face of a baked reflection probe -- VFX: Fixed Missing Reference to Visual Effect Graph Runtime Assembly -- Fixed an issue where rendering done by users in EndCameraRendering would be executed before the main render loop. -- Fixed Prefab Override in main scope of Volume. -- Fixed alignment issue in Presset of main scope of Volume. -- Fixed persistence of ShowChromeGizmo and moved it to toolbar for coherency in ReflectionProbe and PlanarReflectionProbe. -- Fixed Alignement issue in ReflectionProbe and PlanarReflectionProbe. -- Fixed Prefab override workflow issue in ReflectionProbe and PlanarReflectionProbe. -- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in ReflectionProbe and PlanarReflectionProbe. -- Fixed Prefab override workflow issue in DensityVolume. -- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in DensityVolume. -- Fix light limit counts specified on the HDRP asset -- Fixed Quality Settings for SSR, Contact Shadows and Ambient Occlusion volume components -- Fixed decalui deriving from hdshaderui instead of just shaderui -- Use DelayedIntField instead of IntField for scalable settings - -### Changed -- Reworked XR automated tests -- The ray traced screen space shadow history for directional, spot and point lights is discarded if the light transform has changed. -- Changed the behavior for ray tracing in case a mesh renderer has both transparent and opaque submeshes. -- Improve history buffer management -- Replaced PlayerSettings.virtualRealitySupported with XRGraphics.tryEnable. -- Remove redundant FrameSettings RealTimePlanarReflection -- Improved a bit the GC calls generated during the rendering. -- Material update is now only triggered when the relevant settings are touched in the shader graph master nodes -- Changed the way Sky Intensity (on Sky volume components) is handled. It's now a combo box where users can choose between Exposure, Multiplier or Lux (for HDRI sky only) instead of both multiplier and exposure being applied all the time. Added a new menu item to convert old profiles. -- Change how method for specular occlusions is decided on inspector shader (Lit, LitTesselation, LayeredLit, LayeredLitTessellation) -- Unlocked SSS, SSR, Motion Vectors and Distortion frame settings for reflections probes. - -## [7.1.5] - 2019-11-15 - -### Fixed -- Fixed black reflection probes the first time loading a project - -## [7.1.4] - 2019-11-13 - -### Added -- Added XR single-pass setting into HDRP asset -- Added a penumbra tint option for lights - -### Fixed -- Fixed EOL for some files -- Fixed scene view rendering with volumetrics and XR enabled -- Fixed decals to work with multiple cameras -- Fixed optional clear of GBuffer (Was always on) -- Fixed render target clears with XR single-pass rendering -- Fixed HDRP samples file hierarchy -- Fixed Light units not matching light type -- Fixed QualitySettings panel not displaying HDRP Asset - -### Changed -- Changed parametrization of PCSS, now softness is derived from angular diameter (for directional lights) or shape radius (for point/spot lights) and min filter size is now in the [0..1] range. -- Moved the copy of the geometry history buffers to right after the depth mip chain generation. -- Rename "Luminance" to "Nits" in UX for physical light unit -- Rename FrameSettings "SkyLighting" to "SkyReflection" - -## [7.1.3] - 2019-11-04 - -### Added -- Ray tracing support for VR single-pass -- Added sharpen filter shader parameter and UI for TemporalAA to control image quality instead of hardcoded value -- Added frame settings option for custom post process and custom passes as well as custom color buffer format option. -- Add check in wizard on SRP Batcher enabled. -- Added default implementations of OnPreprocessMaterialDescription for FBX, Obj, Sketchup and 3DS file formats. -- Added custom pass fade radius -- Added after post process injection point for custom passes -- Added basic alpha compositing support - Alpha is available afterpostprocess when using FP16 buffer format. -- Added falloff distance on Reflection Probe and Planar Reflection Probe -- Added hability to name LightLayers in HDRenderPipelineAsset -- Added a range compression factor for Reflection Probe and Planar Reflection Probe to avoid saturation of colors. -- Added path tracing support for directional, point and spot lights, as well as emission from Lit and Unlit. -- Added non temporal version of SSAO. -- Added more detailed ray tracing stats in the debug window -- Added Disc area light (bake only) -- Added a warning in the material UI to prevent transparent + subsurface-scattering combination. - -### Fixed -- Sorting, undo, labels, layout in the Lighting Explorer. -- Fixed sky settings and materials in Shader Graph Samples package -- Fixed light supported units caching (1182266) -- Fixed an issue where SSAO (that needs temporal reprojection) was still being rendered when Motion Vectors were not available (case 1184998) -- Fixed a nullref when modifying the height parameters inside the layered lit shader UI. -- Fixed Decal gizmo that become white after exiting play mode -- Fixed Decal pivot position to behave like a spotlight -- Fixed an issue where using the LightingOverrideMask would break sky reflection for regular cameras -- Fix DebugMenu FrameSettingsHistory persistency on close -- Fix DensityVolume, ReflectionProbe aned PlanarReflectionProbe advancedControl display -- Fix DXR scene serialization in wizard -- Fixed an issue where Previews would reallocate History Buffers every frame -- Fixed the SetLightLayer function in HDAdditionalLightData setting the wrong light layer -- Fix error first time a preview is created for planar -- Fixed an issue where SSR would use an incorrect roughness value on ForwardOnly (StackLit, AxF, Fabric, etc.) materials when the pipeline is configured to also allow deferred Lit. -- Fixed issues with light explorer (cases 1183468, 1183269) -- Fix dot colors in LayeredLit material inspector -- Fix undo not resetting all value when undoing the material affectation in LayerLit material -- Fix for issue that caused gizmos to render in render textures (case 1174395) -- Fixed the light emissive mesh not updated when the light was disabled/enabled -- Fixed light and shadow layer sync when setting the HDAdditionalLightData.lightlayersMask property -- Fixed a nullref when a custom post process component that was in the HDRP PP list is removed from the project -- Fixed issue that prevented decals from modifying specular occlusion (case 1178272). -- Fixed exposure of volumetric reprojection -- Fixed multi selection support for Scalable Settings in lights -- Fixed font shaders in test projects for VR by using a Shader Graph version -- Fixed refresh of baked cubemap by incrementing updateCount at the end of the bake (case 1158677). -- Fixed issue with rectangular area light when seen from the back -- Fixed decals not affecting lightmap/lightprobe -- Fixed zBufferParams with XR single-pass rendering -- Fixed moving objects not rendered in custom passes -- Fixed abstract classes listed in the + menu of the custom pass list -- Fixed custom pass that was rendered in previews -- Fixed precision error in zero value normals when applying decals (case 1181639) -- Fixed issue that triggered No Scene Lighting view in game view as well (case 1156102) -- Assign default volume profile when creating a new HDRP Asset -- Fixed fov to 0 in planar probe breaking the projection matrix (case 1182014) -- Fixed bugs with shadow caching -- Reassign the same camera for a realtime probe face render request to have appropriate history buffer during realtime probe rendering. -- Fixed issue causing wrong shading when normal map mode is Object space, no normal map is set, but a detail map is present (case 1143352) -- Fixed issue with decal and htile optimization -- Fixed TerrainLit shader compilation error regarding `_Control0_TexelSize` redefinition (case 1178480). -- Fixed warning about duplicate HDRuntimeReflectionSystem when configuring play mode without domain reload. -- Fixed an editor crash when multiple decal projectors were selected and some had null material -- Added all relevant fix actions to FixAll button in Wizard -- Moved FixAll button on top of the Wizard -- Fixed an issue where fog color was not pre-exposed correctly -- Fix priority order when custom passes are overlapping -- Fix cleanup not called when the custom pass GameObject is destroyed -- Replaced most instances of GraphicsSettings.renderPipelineAsset by GraphicsSettings.currentRenderPipeline. This should fix some parameters not working on Quality Settings overrides. -- Fixed an issue with Realtime GI not working on upgraded projects. -- Fixed issue with screen space shadows fallback texture was not set as a texture array. -- Fixed Pyramid Lights bounding box -- Fixed terrain heightmap default/null values and epsilons -- Fixed custom post-processing effects breaking when an abstract class inherited from `CustomPostProcessVolumeComponent` -- Fixed XR single-pass rendering in Editor by using ShaderConfig.s_XrMaxViews to allocate matrix array -- Multiple different skies rendered at the same time by different cameras are now handled correctly without flickering -- Fixed flickering issue happening when different volumes have shadow settings and multiple cameras are present. -- Fixed issue causing planar probes to disappear if there is no light in the scene. -- Fixed a number of issues with the prefab isolation mode (Volumes leaking from the main scene and reflection not working properly) -- Fixed an issue with fog volume component upgrade not working properly -- Fixed Spot light Pyramid Shape has shadow artifacts on aspect ratio values lower than 1 -- Fixed issue with AO upsampling in XR -- Fixed camera without HDAdditionalCameraData component not rendering -- Removed the macro ENABLE_RAYTRACING for most of the ray tracing code -- Fixed prefab containing camera reloading in loop while selected in the Project view -- Fixed issue causing NaN wheh the Z scale of an object is set to 0. -- Fixed DXR shader passes attempting to render before pipeline loaded -- Fixed black ambient sky issue when importing a project after deleting Library. -- Fixed issue when upgrading a Standard transparent material (case 1186874) -- Fixed area light cookies not working properly with stack lit -- Fixed material render queue not updated when the shader is changed in the material inspector. -- Fixed a number of issues with full screen debug modes not reseting correctly when setting another mutually exclusive mode -- Fixed compile errors for platforms with no VR support -- Fixed an issue with volumetrics and RTHandle scaling (case 1155236) -- Fixed an issue where sky lighting might be updated uselessly -- Fixed issue preventing to allow setting decal material to none (case 1196129) -- Fixed XR multi-pass decals rendering -- Fixed several fields on Light Inspector that not supported Prefab overrides -- VFX: Removed z-fight glitches that could appear when using deferred depth prepass and lit quad primitives -- VFX: Preserve specular option for lit outputs (matches HDRP lit shader) -- Fixed init of debug for FrameSettingsHistory on SceneView camera -- Added a fix script to handle the warning 'referenced script in (GameObject 'SceneIDMap') is missing' -- Fix Wizard load when none selected for RenderPipelineAsset -- Fixed issue with unclear naming of debug menu for decals. - -### Changed -- Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled -- Rename Emission Radius to Radius in UI in Point, Spot -- Angular Diameter parameter for directional light is no longuer an advanced property -- DXR: Remove Light Radius and Angular Diamater of Raytrace shadow. Angular Diameter and Radius are used instead. -- Remove MaxSmoothness parameters from UI for point, spot and directional light. The MaxSmoothness is now deduce from Radius Parameters -- DXR: Remove the Ray Tracing Environement Component. Add a Layer Mask to the ray Tracing volume components to define which objects are taken into account for each effect. -- Removed second cubemaps used for shadowing in lookdev -- Disable Physically Based Sky below ground -- Increase max limit of area light and reflection probe to 128 -- Change default texture for detailmap to grey -- Optimize Shadow RT load on Tile based architecture platforms. -- Improved quality of SSAO. -- Moved RequestShadowMapRendering() back to public API. -- Update HDRP DXR Wizard with an option to automatically clone the hdrp config package and setup raytracing to 1 in shaders file. -- Added SceneSelection pass for TerrainLit shader. -- Simplified Light's type API regrouping the logic in one place (Check type in HDAdditionalLightData) -- The support of LOD CrossFade (Dithering transition) in master nodes now required to enable it in the master node settings (Save variant) -- Improved shadow bias, by removing constant depth bias and substituting it with slope-scale bias. -- Fix the default stencil values when a material is created from a SSS ShaderGraph. -- Tweak test asset to be compatible with XR: unlit SG material for canvas and double-side font material -- Slightly tweaked the behaviour of bloom when resolution is low to reduce artifacts. -- Hidden fields in Light Inspector that is not relevant while in BakingOnly mode. - -## [7.1.2] - 2019-09-19 - -### Fixed -- Fix/workaround a probable graphics driver bug in the GTAO shader. -- Fixed Hair and PBR shader graphs double sided modes -- Fixed an issue where updating an HDRP asset in the Quality setting panel would not recreate the pipeline. -- Fixed issue with point lights being considered even when occupying less than a pixel on screen (case 1183196) -- Fix a potential NaN source with iridescence (case 1183216) -- Fixed issue of spotlight breaking when minimizing the cone angle via the gizmo (case 1178279) -- Fixed issue that caused decals not to modify the roughness in the normal buffer, causing SSR to not behave correctly (case 1178336) -- Fixed lit transparent refraction with XR single-pass rendering -- Removed extra jitter for TemporalAA in VR -- Fixed ShaderGraph time in main preview -- Fixed issue on some UI elements in HDRP asset not expanding when clicking the arrow (case 1178369) -- Fixed alpha blending in custom post process -- Fixed the modification of the _AlphaCutoff property in the material UI when exposed with a ShaderGraph parameter. -- Fixed HDRP test `1218_Lit_DiffusionProfiles` on Vulkan. -- Fixed an issue where building a player in non-dev mode would generate render target error logs every frame -- Fixed crash when upgrading version of HDRP -- Fixed rendering issues with material previews -- Fixed NPE when using light module in Shuriken particle systems (1173348). -- Refresh cached shadow on editor changes - ## [7.1.1] - 2019-09-05 ### Added diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs index d160aab7c45..b82a3d45ab0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.Experimental.Rendering; @@ -23,7 +24,7 @@ static Mesh sphereMesh get { return s_SphereMesh ?? (s_SphereMesh = Resources.GetBuiltinResource(typeof(Mesh), "New-Sphere.fbx") as Mesh); } } - Material m_ReflectiveMaterial; + Material m_ReflectiveMaterial = null; PreviewRenderUtility m_PreviewUtility; float m_CameraPhi = 0.75f; float m_CameraTheta = 0.5f; @@ -35,20 +36,25 @@ static Mesh sphereMesh public float previewExposure = 0f; public float mipLevelPreview = 0f; - void Awake() + void InitMaterialIfNeeded() { - m_ReflectiveMaterial = new Material(Shader.Find("Debug/ReflectionProbePreview")) + if(m_ReflectiveMaterial == null) { - hideFlags = HideFlags.HideAndDontSave - }; + var shader = Shader.Find("Debug/ReflectionProbePreview"); + if(shader != null) + { + m_ReflectiveMaterial = new Material(Shader.Find("Debug/ReflectionProbePreview")) + { + hideFlags = HideFlags.HideAndDontSave + }; + } + } } void OnEnable() { if (m_PreviewUtility == null) InitPreview(); - - m_ReflectiveMaterial.SetTexture("_Cubemap", target as Texture); } void OnDisable() @@ -73,8 +79,13 @@ public override void OnPreviewGUI(Rect r, GUIStyle background) if (m_PreviewUtility == null) InitPreview(); + // We init material just before using it as the inspector might have been enabled/awaked before during import. + InitMaterialIfNeeded(); + UpdateCamera(); + m_ReflectiveMaterial.SetTexture("_Cubemap", target as Texture); + m_PreviewUtility.BeginPreview(r, GUIStyle.none); m_PreviewUtility.DrawMesh(sphereMesh, Matrix4x4.identity, m_ReflectiveMaterial, 0); m_PreviewUtility.camera.Render(); @@ -201,12 +212,38 @@ public override Texture2D RenderStaticPreview(string assetPath, Object[] subAsse UpdateCamera(); + // Force loading the needed preview shader + var previewShader = EditorGUIUtility.LoadRequired("Previews/PreviewCubemap.shader") as Shader; + var previewMaterial = new Material(previewShader) + { + hideFlags = HideFlags.HideAndDontSave + }; + + // We need to force it to go through legacy + bool assetUsedFromQuality = false; + var currentPipelineAsset = HDUtils.SwitchToBuiltinRenderPipeline(out assetUsedFromQuality); + + previewMaterial.SetVector("_CameraWorldPosition", m_PreviewUtility.camera.transform.position); + previewMaterial.SetFloat("_Mip", 0.0f); + previewMaterial.SetFloat("_Alpha", 0.0f); + previewMaterial.SetFloat("_Intensity", 1.0f); + previewMaterial.mainTexture = (target as Texture); + m_PreviewUtility.ambientColor = Color.black; m_PreviewUtility.BeginStaticPreview(new Rect(0, 0, width, height)); - m_PreviewUtility.DrawMesh(sphereMesh, Matrix4x4.identity, m_ReflectiveMaterial, 0); + m_PreviewUtility.DrawMesh(sphereMesh, Matrix4x4.identity, previewMaterial, 0); + m_PreviewUtility.camera.Render(); + + var outTexture = m_PreviewUtility.EndStaticPreview(); + + // Reset back to whatever asset was used before the rendering + HDUtils.RestoreRenderPipelineAsset(assetUsedFromQuality, currentPipelineAsset); + + // Dummy empty render call to reset the pipeline in RenderPipelineManager m_PreviewUtility.camera.Render(); - return m_PreviewUtility.EndStaticPreview(); + return outTexture; + } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs index d21b1fcb6f6..21d727622b9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs @@ -449,6 +449,42 @@ internal static string GetHDRenderPipelinePath() internal static string GetCorePath() => "Packages/com.unity.render-pipelines.core/"; + // It returns the previously set RenderPipelineAsset, assetWasFromQuality is true if the current asset was set through the quality settings + internal static RenderPipelineAsset SwitchToBuiltinRenderPipeline(out bool assetWasFromQuality) + { + var graphicSettingAsset = GraphicsSettings.renderPipelineAsset; + assetWasFromQuality = false; + if (graphicSettingAsset != null) + { + // Check if the currently used pipeline is the one from graphics settings + if (GraphicsSettings.currentRenderPipeline == graphicSettingAsset) + { + GraphicsSettings.renderPipelineAsset = null; + return graphicSettingAsset; + } + } + // If we are here, it means the asset comes from quality settings + var assetFromQuality = QualitySettings.renderPipeline; + QualitySettings.renderPipeline = null; + assetWasFromQuality = true; + return assetFromQuality; + } + + // Set the renderPipelineAsset, either on the quality settings if it was unset from there or in GraphicsSettings. + // IMPORTANT: RenderPipelineManager.currentPipeline won't be HDRP until a camera.Render() call is made. + internal static void RestoreRenderPipelineAsset(bool wasUnsetFromQuality, RenderPipelineAsset renderPipelineAsset) + { + if(wasUnsetFromQuality) + { + QualitySettings.renderPipeline = renderPipelineAsset; + } + else + { + GraphicsSettings.renderPipelineAsset = renderPipelineAsset; + } + + } + internal struct PackedMipChainInfo { public Vector2Int textureSize; From 1f7c3179b016a349f8a6bb78a9b85b257bca803f Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Thu, 19 Mar 2020 15:46:22 +0100 Subject: [PATCH 29/84] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 61a5e0d706f..38372f45385 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -50,7 +50,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue that prevented cubemap thumbnails from rendering. - Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. - Fix some typos in the debug menu. -- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. - Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). - Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. - Fixed cubemap thumbnail generation at project load time. @@ -64,6 +63,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Improve area light culling (case 1085873) - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. - Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. +- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. +- Utilities namespace is obsolete, moved its content to UnityEngine.Rendering (case 1204677) ## [8.0.0] - 2020-05-25 From f8d575edcee6f66afafa66c502a428f5ef684f29 Mon Sep 17 00:00:00 2001 From: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Date: Tue, 24 Mar 2020 09:44:24 +0100 Subject: [PATCH 30/84] [8.x.x Backport] Partial fix LookDev opened when CoreRP package reimported (#6289) * Fix null texture usage happening on CoreRP upgrade * Partially fix garbage collected stylesheet issue. (Need more work on UIElement side, see case 1228706 ) * Update CHANGELOG.md * Clean log --- com.unity.render-pipelines.core/CHANGELOG.md | 4 +- .../Editor/LookDev/DisplayWindow.cs | 90 ++++++++++++++++--- .../Editor/LookDev/LookDev.cs | 21 +++-- 3 files changed, 97 insertions(+), 18 deletions(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 90b8d628086..86f7fb6773f 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -6,8 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -Version Updated -The version number for this package has increased due to a version update of a related graphics package. +### Fixed +- Fixed issue when LookDev window is opened and the CoreRP Package is updated to a newer version. ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs index e9b029d6b49..043b61a7aca 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs @@ -200,8 +200,28 @@ event Action IViewDisplayer.OnUpdateRequested remove => OnUpdateRequestedInternal -= value; } + StyleSheet styleSheet = null; + StyleSheet styleSheetLight = null; + void OnEnable() { + //Stylesheet + // Try to load stylesheet. Timing can be odd while upgrading packages (case 1219692). + // In this case, it will be fixed in OnGUI. Though it can spawn error while reimporting assets. + // Waiting for filter on stylesheet (case 1228706) to remove last error. + if (styleSheet == null || styleSheet.Equals(null)) + { + styleSheet = AssetDatabase.LoadAssetAtPath(Style.k_uss); + if (styleSheet != null && !styleSheet.Equals(null)) + rootVisualElement.styleSheets.Add(styleSheet); + } + if (!EditorGUIUtility.isProSkin && styleSheetLight != null && !styleSheetLight.Equals(null)) + { + styleSheetLight = AssetDatabase.LoadAssetAtPath(Style.k_uss_personal_overload); + if (styleSheetLight != null && !styleSheetLight.Equals(null)) + rootVisualElement.styleSheets.Add(styleSheetLight); + } + //Call the open function to configure LookDev // in case the window where open when last editor session finished. // (Else it will open at start and has nothing to display). @@ -213,15 +233,6 @@ void OnEnable() // /!\ be sure to have a minSize that will allow a non negative sized viewport even with side panel open this.minSize = new Vector2(600, 400); - rootVisualElement.styleSheets.Add( - AssetDatabase.LoadAssetAtPath(Style.k_uss)); - - if (!EditorGUIUtility.isProSkin) - { - rootVisualElement.styleSheets.Add( - AssetDatabase.LoadAssetAtPath(Style.k_uss_personal_overload)); - } - CreateToolbar(); m_MainContainer = new VisualElement() { name = Style.k_MainContainerName }; @@ -458,6 +469,9 @@ Rect IViewDisplayer.GetRect(ViewCompositionIndex index) Vector2 m_LastSecondViewSize = new Vector2(); void IViewDisplayer.SetTexture(ViewCompositionIndex index, Texture texture) { + if (texture == null) + return; + bool updated = false; switch (index) { @@ -589,6 +603,62 @@ IStyle GetEnvironmentContenairDraggerStyle() } } - void OnGUI() => OnUpdateRequestedInternal?.Invoke(); + void OnGUI() + { + //Stylesheet + // [case 1219692] if LookDev is open while reimporting CoreRP package, + // stylesheet can be null. In this case, we can have a null stylesheet + // registered as it got destroyed. Reloading it. As we cannot just + // remove a null entry, we must filter and reconstruct the while list. + if (styleSheet == null || styleSheet.Equals(null) + || (!EditorGUIUtility.isProSkin && (styleSheetLight == null || styleSheetLight.Equals(null)))) + { + // While (case 1228706) is still on going, we sill close and reopen the look dev. + // This will prevent spawning error at frame. + LookDev.Close(); + LookDev.Open(); + return; + + // Following lines is the correct fix if UIElement filter garbage collected Stylesheet. + + //System.Collections.Generic.List usedStyleSheets = new System.Collections.Generic.List(); + //int currentCount = rootVisualElement.styleSheets.count; + //for (int i = 0; i < currentCount; ++i) + //{ + // StyleSheet sheet = rootVisualElement.styleSheets[i]; + // if (sheet != null && !sheet.Equals(null)) + // usedStyleSheets.Add(sheet); + //} + //rootVisualElement.styleSheets.Clear(); + //foreach (StyleSheet sheet in usedStyleSheets) + // rootVisualElement.styleSheets.Add(sheet); + + //styleSheet = AssetDatabase.LoadAssetAtPath(Style.k_uss); + //if (styleSheet != null && !styleSheet.Equals(null)) + //{ + // rootVisualElement.styleSheets.Add(styleSheet); + // if (!EditorGUIUtility.isProSkin) + // { + // rootVisualElement.styleSheets.Add( + // AssetDatabase.LoadAssetAtPath(Style.k_uss_personal_overload)); + // } + //} + + //if (styleSheet == null || styleSheet.Equals(null)) + //{ + // styleSheet = AssetDatabase.LoadAssetAtPath(Style.k_uss); + // if (styleSheet != null && !styleSheet.Equals(null)) + // rootVisualElement.styleSheets.Add(styleSheet); + //} + //if (!EditorGUIUtility.isProSkin && styleSheetLight != null && !styleSheetLight.Equals(null)) + //{ + // styleSheetLight = AssetDatabase.LoadAssetAtPath(Style.k_uss_personal_overload); + // if (styleSheetLight != null && !styleSheetLight.Equals(null)) + // rootVisualElement.styleSheets.Add(styleSheetLight); + //} + } + + OnUpdateRequestedInternal?.Invoke(); + } } } diff --git a/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs b/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs index 59d57666f5b..08f04fb0eda 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs @@ -90,14 +90,24 @@ internal static void SaveConfig(string path = lastRenderingDataSavePath) InternalEditorUtility.SaveToSerializedFileAndForget(new[] { currentContext }, path, true); } - /// open the LookDev window + /// Open the LookDev window public static void Open() { - s_ViewDisplayer = EditorWindow.GetWindow(); - s_EnvironmentDisplayer = EditorWindow.GetWindow(); + var Window = EditorWindow.GetWindow(); + s_ViewDisplayer = Window; + s_EnvironmentDisplayer = Window; ConfigureLookDev(reloadWithTemporaryID: false); } + /// Close the LookDev window + public static void Close() + { + (s_ViewDisplayer as EditorWindow)?.Close(); + s_ViewDisplayer = null; + (s_EnvironmentDisplayer as EditorWindow)?.Close(); + s_EnvironmentDisplayer = null; + } + [Callbacks.DidReloadScripts] static void OnEditorReload() { @@ -131,7 +141,7 @@ static void WaitingSRPReloadForConfiguringRenderer(int maxAttempt, bool reloadWi () => WaitingSRPReloadForConfiguringRenderer(maxAttempt, reloadWithTemporaryID, ++attemptNumber); else { - (s_ViewDisplayer as EditorWindow)?.Close(); + Close(); throw new System.Exception("LookDev is not supported by this Scriptable Render Pipeline: " + (RenderPipelineManager.currentPipeline == null ? "No SRP in use" : RenderPipelineManager.currentPipeline.ToString())); @@ -148,8 +158,7 @@ static void ConfigureRenderer(bool reloadWithTemporaryID) static void LinkViewDisplayer() { - EditorApplication.playModeStateChanged += state => - (s_ViewDisplayer as EditorWindow)?.Close(); + EditorApplication.playModeStateChanged += state => Close(); s_ViewDisplayer.OnClosed += () => { From adf5c8f27271119935c42f4b9aa9118a92d97697 Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Tue, 24 Mar 2020 09:48:07 +0100 Subject: [PATCH 31/84] [Backport 8.x.x] Hdrp/fix default volume switch (#6336) * Fixed an issue where default volume would not update when switching profile. * Fixed an issue when setting the default volume for the first time where the hdrp asset would not be dirtied * Changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../RenderPipeline/Settings/EditorDefaultSettings.cs | 3 +++ .../Runtime/RenderPipeline/HDRenderPipeline.cs | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 61a6188fefd..26d073487af 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). - Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. - Fixed cubemap thumbnail generation at project load time. +- Fixed an issue where default volume would not update when switching profile. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/EditorDefaultSettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/EditorDefaultSettings.cs index 27aba1a3297..b08e0c09d33 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/EditorDefaultSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/EditorDefaultSettings.cs @@ -23,8 +23,11 @@ internal static VolumeProfile GetOrAssignDefaultVolumeProfile() internal static VolumeProfile GetOrAssignDefaultVolumeProfile(HDRenderPipelineAsset hdrpAsset) { if (hdrpAsset.defaultVolumeProfile == null || hdrpAsset.defaultVolumeProfile.Equals(null)) + { hdrpAsset.defaultVolumeProfile = hdrpAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile; + EditorUtility.SetDirty(hdrpAsset); + } return hdrpAsset.defaultVolumeProfile; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 20d58b31824..b7e12c2c334 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -55,6 +55,7 @@ internal static Volume GetOrCreateDefaultVolume() s_DefaultVolume.priority = float.MinValue; s_DefaultVolume.sharedProfile = defaultVolumeProfile; } + if ( // In case the asset was deleted or the reference removed s_DefaultVolume.sharedProfile == null || s_DefaultVolume.sharedProfile.Equals(null) @@ -65,7 +66,14 @@ internal static Volume GetOrCreateDefaultVolume() || !UnityEditor.AssetDatabase.Contains(s_DefaultVolume.sharedProfile) #endif ) + { s_DefaultVolume.sharedProfile = defaultVolumeProfile; + } + + if (s_DefaultVolume.sharedProfile != defaultVolumeProfile) + { + s_DefaultVolume.sharedProfile = defaultVolumeProfile; + } return s_DefaultVolume; } From 4a02d320b88bddd4c51b304111dc1074d2ff9356 Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Tue, 24 Mar 2020 09:51:41 +0100 Subject: [PATCH 32/84] [Backport 8.x.x] Fixed an issue where AO override would not override specular occlusion (#6339) * Manual cherry pick of 9162acb50898c948e35475bb1c0d58dbea4217b7 * Changelog Co-authored-by: sebastienlagarde --- .../CHANGELOG.md | 1 + .../Material/Eye/ShaderGraph/EyePass.template | 18 +++++++------- .../Fabric/ShaderGraph/FabricPass.template | 18 +++++++------- .../Hair/ShaderGraph/HairPass.template | 22 ++++++++--------- .../Lit/ShaderGraph/HDLitPass.template | 23 +++++++++--------- .../PBR/ShaderGraph/HDPBRPass.template | 6 ++--- .../ShaderGraph/StackLitPass.template | 8 +++---- .../Runtime/Debug/DebugDisplay.cs | 2 +- .../Material/LayeredLit/LayeredLitData.hlsl | 24 +++++++++---------- .../Runtime/Material/Lit/LitData.hlsl | 24 +++++++++---------- .../Material/TerrainLit/TerrainLitData.hlsl | 12 +++++----- 11 files changed, 79 insertions(+), 79 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 26d073487af..a64e114b00a 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. - Fixed cubemap thumbnail generation at project load time. - Fixed an issue where default volume would not update when switching profile. +- Fixed an issue where AO override would not override specular occlusion. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template index bae9ef75d1e..488c0cdbc4c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template @@ -250,15 +250,6 @@ $include("SharedCode.template.hlsl") bentNormalWS = surfaceData.irisNormalWS; // Use diffuse normal (iris) to fetch GI, unless users provide explicit bent normal (not affected by decals) $BentNormal: GetNormalWS(fragInputs, surfaceDescription.BentNormal, bentNormalWS, doubleSidedConstants); -#if defined(_SPECULAR_OCCLUSION_CUSTOM) - // Just use the value passed through via the slot (not active otherwise) -#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) - // If we have bent normal and ambient occlusion, process a specular occlusion - surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); -#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) - surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); -#endif - #ifdef DEBUG_DISPLAY if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) { @@ -269,6 +260,15 @@ $include("SharedCode.template.hlsl") // as it can modify attribute use for static lighting ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); #endif + +#if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) +#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); +#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); +#endif } void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricPass.template index 3b5cc699b5a..9983b17ebea 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricPass.template @@ -308,15 +308,6 @@ Pass surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); -#if defined(_SPECULAR_OCCLUSION_CUSTOM) - // Just use the value passed through via the slot (not active otherwise) -#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) - // If we have bent normal and ambient occlusion, process a specular occlusion - surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); -#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) - surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); -#endif - #if defined(DEBUG_DISPLAY) && !defined(SHADER_STAGE_RAY_TRACING) if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) { @@ -327,6 +318,15 @@ Pass // as it can modify attribute use for static lighting ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); #endif + +#if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) +#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); +#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); +#endif } void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template index bb9232e3c6d..d74a36907cd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template @@ -286,6 +286,17 @@ $include("SharedCode.template.hlsl") $BentNormal: GetNormalWS(fragInputs, surfaceDescription.BentNormal, bentNormalWS, doubleSidedConstants); +#ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); +#endif + #if defined(_SPECULAR_OCCLUSION_CUSTOM) // Just use the value passed through via the slot (not active otherwise) #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) @@ -298,17 +309,6 @@ $include("SharedCode.template.hlsl") #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); #endif - -#ifdef DEBUG_DISPLAY - if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) - { - // TODO: need to update mip info - } - - // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData - // as it can modify attribute use for static lighting - ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); -#endif } void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitPass.template index 029ac8721d2..32319cd3db4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitPass.template @@ -333,6 +333,17 @@ Pass surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); +#if defined(DEBUG_DISPLAY) && !defined(SHADER_STAGE_RAY_TRACING) + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); +#endif // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. // If user provide bent normal then we process a better term @@ -348,18 +359,6 @@ Pass #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); #endif - -#if defined(DEBUG_DISPLAY) && !defined(SHADER_STAGE_RAY_TRACING) - if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) - { - // TODO: need to update mip info - surfaceData.metallic = 0; - } - - // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData - // as it can modify attribute use for static lighting - ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); -#endif } void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template index 9e92e0271c0..a2f37b143d8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template @@ -195,9 +195,6 @@ $include("SharedCode.template.hlsl") surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); - // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion as PBR master node don't have any option - surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); - #ifdef DEBUG_DISPLAY if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) { @@ -209,6 +206,9 @@ $include("SharedCode.template.hlsl") // as it can modify attribute use for static lighting ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion as PBR master node don't have any option + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); } void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template index 6c5a9566a80..a22141de1c3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template @@ -515,10 +515,6 @@ $include("SharedCode.template.hlsl") float coatTextureFilteringVariance = 0.0; //$NormalTexturtextureFiltering: coatTextureFilteringVariance = DecodeVariance(surfaceDescription.CodedCoatNormalVarianceMeasure); - $SpecularAA: surfaceData.perceptualSmoothnessA = NormalFiltering(surfaceData.perceptualSmoothnessA, geometricVariance + textureFilteringVariance, surfaceDescription.SpecularAAThreshold); - $SpecularAA: surfaceData.perceptualSmoothnessB = NormalFiltering(surfaceData.perceptualSmoothnessB, geometricVariance + textureFilteringVariance, surfaceDescription.SpecularAAThreshold); - $SpecularAA: surfaceData.coatPerceptualSmoothness = NormalFiltering(surfaceData.coatPerceptualSmoothness, geometricVariance + coatTextureFilteringVariance, surfaceDescription.SpecularAAThreshold); - #if defined(DEBUG_DISPLAY) if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) { @@ -529,6 +525,10 @@ $include("SharedCode.template.hlsl") // as it can modify attributes used for static lighting ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); #endif + + $SpecularAA: surfaceData.perceptualSmoothnessA = NormalFiltering(surfaceData.perceptualSmoothnessA, geometricVariance + textureFilteringVariance, surfaceDescription.SpecularAAThreshold); + $SpecularAA: surfaceData.perceptualSmoothnessB = NormalFiltering(surfaceData.perceptualSmoothnessB, geometricVariance + textureFilteringVariance, surfaceDescription.SpecularAAThreshold); + $SpecularAA: surfaceData.coatPerceptualSmoothness = NormalFiltering(surfaceData.coatPerceptualSmoothness, geometricVariance + coatTextureFilteringVariance, surfaceDescription.SpecularAAThreshold); } void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index f27b847060f..20d469a4084 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -858,7 +858,7 @@ void RegisterLightingDebug() }); } - list.Add(new DebugUI.BoolField { displayName = "Override AmbientOcclusion", getter = () => data.lightingDebugSettings.overrideAmbientOcclusion, setter = value => data.lightingDebugSettings.overrideAmbientOcclusion = value, onValueChanged = RefreshLightingDebug }); + list.Add(new DebugUI.BoolField { displayName = "Override Ambient Occlusion", getter = () => data.lightingDebugSettings.overrideAmbientOcclusion, setter = value => data.lightingDebugSettings.overrideAmbientOcclusion = value, onValueChanged = RefreshLightingDebug }); if (data.lightingDebugSettings.overrideAmbientOcclusion) { list.Add(new DebugUI.Container diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitData.hlsl index bb6a929c12a..ab216729cbc 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitData.hlsl @@ -785,6 +785,18 @@ void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs p bentNormalWS = surfaceData.normalWS; #endif +#if defined(DEBUG_DISPLAY) && !defined(SHADER_STAGE_RAY_TRACING) + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + surfaceData.baseColor = GetTextureDataDebug(_DebugMipMapMode, layerTexCoord.base0.uv, _BaseColorMap0, _BaseColorMap0_TexelSize, _BaseColorMap0_MipInfo, surfaceData.baseColor); + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(input.tangentToWorld, surfaceData); +#endif + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. // If user provide bent normal then we process a better term #if (defined(_BENTNORMALMAP0) || defined(_BENTNORMALMAP1) || defined(_BENTNORMALMAP2) || defined(_BENTNORMALMAP3)) && defined(_SPECULAR_OCCLUSION_FROM_BENT_NORMAL_MAP) @@ -804,18 +816,6 @@ void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs p surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, input.tangentToWorld[2], _SpecularAAScreenSpaceVariance, _SpecularAAThreshold); #endif -#if defined(DEBUG_DISPLAY) && !defined(SHADER_STAGE_RAY_TRACING) - if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) - { - surfaceData.baseColor = GetTextureDataDebug(_DebugMipMapMode, layerTexCoord.base0.uv, _BaseColorMap0, _BaseColorMap0_TexelSize, _BaseColorMap0_MipInfo, surfaceData.baseColor); - surfaceData.metallic = 0; - } - - // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData - // as it can modify attribute use for static lighting - ApplyDebugToSurfaceData(input.tangentToWorld, surfaceData); -#endif - GetBuiltinData(input, V, posInput, surfaceData, alpha, bentNormalWS, depthOffset, builtinData); RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitData.hlsl index d6fe083be86..c7ea5698d82 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitData.hlsl @@ -259,6 +259,18 @@ void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs p bentNormalWS = surfaceData.normalWS; #endif +#if defined(DEBUG_DISPLAY) && !defined(SHADER_STAGE_RAY_TRACING) + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + surfaceData.baseColor = GetTextureDataDebug(_DebugMipMapMode, layerTexCoord.base.uv, _BaseColorMap, _BaseColorMap_TexelSize, _BaseColorMap_MipInfo, surfaceData.baseColor); + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(input.tangentToWorld, surfaceData); +#endif + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. // If user provide bent normal then we process a better term #if defined(_BENTNORMALMAP) && defined(_SPECULAR_OCCLUSION_FROM_BENT_NORMAL_MAP) @@ -281,18 +293,6 @@ void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs p surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, input.tangentToWorld[2], _SpecularAAScreenSpaceVariance, _SpecularAAThreshold); #endif -#if defined(DEBUG_DISPLAY) && !defined(SHADER_STAGE_RAY_TRACING) - if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) - { - surfaceData.baseColor = GetTextureDataDebug(_DebugMipMapMode, layerTexCoord.base.uv, _BaseColorMap, _BaseColorMap_TexelSize, _BaseColorMap_MipInfo, surfaceData.baseColor); - surfaceData.metallic = 0; - } - - // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData - // as it can modify attribute use for static lighting - ApplyDebugToSurfaceData(input.tangentToWorld, surfaceData); -#endif - // Caution: surfaceData must be fully initialize before calling GetBuiltinData GetBuiltinData(input, V, posInput, surfaceData, alpha, bentNormalWS, depthOffset, builtinData); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLitData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLitData.hlsl index d970c565ac0..dbadb893782 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLitData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLitData.hlsl @@ -228,12 +228,6 @@ void GetSurfaceAndBuiltinData(inout FragInputs input, float3 V, inout PositionIn float3 bentNormalWS = surfaceData.normalWS; - // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. - // Don't do spec occ from Ambient if there is no mask mask -#if defined(_MASKMAP) && !defined(_SPECULAR_OCCLUSION_NONE) - surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); -#endif - #ifdef DEBUG_DISPLAY if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) { @@ -245,5 +239,11 @@ void GetSurfaceAndBuiltinData(inout FragInputs input, float3 V, inout PositionIn ApplyDebugToSurfaceData(input.tangentToWorld, surfaceData); #endif + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // Don't do spec occ from Ambient if there is no mask mask +#if defined(_MASKMAP) && !defined(_SPECULAR_OCCLUSION_NONE) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); +#endif + GetBuiltinData(input, V, posInput, surfaceData, 1, bentNormalWS, 0, builtinData); } From 5e851ea103cd2c36c753960609fd5b70d161e17c Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Tue, 24 Mar 2020 09:54:19 +0100 Subject: [PATCH 33/84] [Backport 8.x.x] Fixed an issue where Volume inspector might not refresh correctly in some cases. (#6335) * Fixed an issue where Volume inspector might not refresh correctly in some cases. * changelog Co-authored-by: sebastienlagarde --- com.unity.render-pipelines.core/Editor/Volume/VolumeEditor.cs | 4 ++++ com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 2 files changed, 5 insertions(+) diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeEditor.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeEditor.cs index 859a43693c5..a9e96ed1b9d 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeEditor.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeEditor.cs @@ -187,7 +187,11 @@ public override void OnInspectorGUI() else { if (assetHasChanged || profileRef != m_ComponentList.asset) + { + serializedObject.ApplyModifiedProperties(); + serializedObject.Update(); RefreshEffectListEditor(profileRef); + } if (!multiEdit) { diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index a64e114b00a..9ffb6738616 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed cubemap thumbnail generation at project load time. - Fixed an issue where default volume would not update when switching profile. - Fixed an issue where AO override would not override specular occlusion. +- Fixed an issue where Volume inspector might not refresh correctly in some cases. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. From 7b46c5d3aeca99ffb061276b63cdb2fb60192951 Mon Sep 17 00:00:00 2001 From: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Date: Wed, 25 Mar 2020 13:00:34 +0100 Subject: [PATCH 34/84] Hdrp/fix material baked emission #5392 --- .../CHANGELOG.md | 25 ++++++++++ .../Editor/Material/PBR/HDPBRLit.cs | 6 +-- .../Material/UIBlocks/EmissionUIBlock.cs | 49 +++++++++++++++++-- .../Material/UIBlocks/ShaderGraphUIBlock.cs | 8 ++- 4 files changed, 76 insertions(+), 12 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9ffb6738616..53e0ba11f64 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -69,6 +69,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. - Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. - Utilities namespace is obsolete, moved its content to UnityEngine.Rendering (case 1204677) +- Hidden unsupported choice in emission in Materials ## [8.0.0] - 2020-05-25 @@ -561,6 +562,30 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Hide the Probes section in the Renderer editos because it was unused. - Moved BeginCameraRendering callback right before culling. - Changed the visibility of the Indirect Lighting Controller component to public. +<<<<<<< HEAD +======= +- Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. +- Improved behaviour of transmission color on transparent surfaces in path tracing. +- Light dimmer can now get values higher than one and was renamed to multiplier in the UI. +- Removed info box requesting volume component for Visual Environment and updated the documentation with the relevant information. +- Improved light selection oracle for light sampling in path tracing. +- Stripped ray tracing subsurface passes with ray tracing is not enabled. +- Remove LOD cross fade code for ray tracing shaders +- Removed legacy VR code +- Add range-based clipping to box lights (case 1178780) +- Improve area light culling (case 1085873) +- Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. +- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. +- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. +- Utilities namespace is obsolete, moved its content to UnityEngine.Rendering (case 1204677) +- Obsolete Utilities namespace was removed, instead use UnityEngine.Rendering (case 1204677) +- Moved most of the compute shaders to the multi_compile API instead of multiple kernels. +- Use multi_compile API for deferred compute shader with shadow mask. +- Remove the raytracing rendering queue system to make recursive raytraced material work when raytracing is disabled +- Changed a few resources used by ray tracing shaders to be global resources (using register space1) for improved CPU performance. +- All custom pass volumes are now executed for one injection point instead of the first one. +- Hidden unsupported choice in emission in Materials +>>>>>>> 4e749150f9... Hdrp/fix material baked emission (#5392) ## [7.1.1] - 2019-09-05 diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/HDPBRLit.cs b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/HDPBRLit.cs index 7fe5e89df34..8e793ffd2d4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/HDPBRLit.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/HDPBRLit.cs @@ -8,10 +8,8 @@ class HDPBRLitGUI : ShaderGUI public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props) { materialEditor.PropertiesDefaultGUI(props); - if (materialEditor.EmissionEnabledProperty()) - { - materialEditor.LightmapEmissionFlagsProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel, true, true); - } + + EmissionUIBlock.BakedEmissionEnabledProperty(materialEditor); // Make sure all selected materials are initialized. string materialTag = "MotionVector"; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs index 292ac8ea228..08eeee01db4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs @@ -3,6 +3,8 @@ using UnityEngine; using UnityEngine.Rendering.HighDefinition; using UnityEngine.Rendering; +using System.Reflection; +using System.Linq.Expressions; namespace UnityEditor.Rendering.HighDefinition { @@ -17,6 +19,17 @@ public enum Features All = ~0 } + static Func GetLightingSettingsOrDefaultsFallback; + + static EmissionUIBlock() + { + Type lightMappingType = typeof(Lightmapping); + var getLightingSettingsOrDefaultsFallbackInfo = lightMappingType.GetMethod("GetLightingSettingsOrDefaultsFallback", BindingFlags.Static | BindingFlags.NonPublic); + var getLightingSettingsOrDefaultsFallbackLambda = Expression.Lambda>(Expression.Call(null, getLightingSettingsOrDefaultsFallbackInfo)); + GetLightingSettingsOrDefaultsFallback = getLightingSettingsOrDefaultsFallbackLambda.Compile(); + } + + public class Styles { public const string header = "Emission Inputs"; @@ -31,6 +44,7 @@ public class Styles public static GUIContent UVEmissiveMappingText = new GUIContent("Emission UV mapping", ""); public static GUIContent texWorldScaleText = new GUIContent("World Scale", "Sets the tiling factor HDRP applies to Planar/Trilinear mapping."); + public static GUIContent bakedEmission = new GUIContent("Baked Emission", ""); } MaterialProperty emissiveColorLDR = null; @@ -145,12 +159,41 @@ void DrawEmissionGUI() // Emission for GI? if ((m_Features & Features.EnableEmissionForGI) != 0) { - if (materialEditor.EmissionEnabledProperty()) + BakedEmissionEnabledProperty(materialEditor); + } + } + + + public static bool BakedEmissionEnabledProperty(MaterialEditor materialEditor) + { + Material[] materials = Array.ConvertAll(materialEditor.targets, (UnityEngine.Object o) => { return (Material)o; }); + + // Calculate isMixed + bool enabled = materials[0].globalIlluminationFlags == MaterialGlobalIlluminationFlags.BakedEmissive; + bool isMixed = false; + for (int i = 1; i < materials.Length; i++) + { + if ((materials[i].globalIlluminationFlags == MaterialGlobalIlluminationFlags.BakedEmissive) != enabled) + { + isMixed = true; + break; + } + } + + // initial checkbox for enabling/disabling emission + EditorGUI.BeginChangeCheck(); + EditorGUI.showMixedValue = isMixed; + enabled = EditorGUILayout.Toggle(Styles.bakedEmission, enabled); + EditorGUI.showMixedValue = false; + if (EditorGUI.EndChangeCheck()) + { + foreach (Material mat in materials) { - // change the GI flag and fix it up with emissive as black if necessary - materialEditor.LightmapEmissionFlagsProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel, true, true); + mat.globalIlluminationFlags = enabled ? MaterialGlobalIlluminationFlags.BakedEmissive : MaterialGlobalIlluminationFlags.EmissiveIsBlack; } + return enabled; } + return !isMixed && enabled; } void DoEmissiveTextureProperty(MaterialProperty color) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs index 0648baabce4..12b758968ec 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs @@ -26,7 +26,8 @@ public enum Features protected static class Styles { - public static readonly string header = "Exposed Properties"; + public const string header = "Exposed Properties"; + public static readonly GUIContent bakedEmission = new GUIContent("Baked Emission", ""); } Expandable m_ExpandableBit; @@ -146,10 +147,7 @@ void PropertiesDefaultGUI(MaterialProperty[] properties) void DrawEmissionGI() { - if (materialEditor.EmissionEnabledProperty()) - { - materialEditor.LightmapEmissionFlagsProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel, true, true); - } + EmissionUIBlock.BakedEmissionEnabledProperty(materialEditor); } // Track additional velocity state. See SG-ADDITIONALVELOCITY-NOTE From 9ecc3c437d1da2613c7eeeed9a010d739c9e250a Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 13 Mar 2020 11:35:57 +0100 Subject: [PATCH 35/84] Fixed volume components lifespan in the clipboard #5869 --- com.unity.render-pipelines.core/CHANGELOG.md | 5 +++ .../Volume/VolumeComponentListEditor.cs | 34 +++++++++---------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 86f7fb6773f..07cd383246c 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed issue when LookDev window is opened and the CoreRP Package is updated to a newer version. +- Fixed copy/pasting of Volume Components when loading a new scene ## [8.0.0] - 2020-05-25 @@ -34,10 +35,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix LookDev EnvironmentLibrary tab when asset is deleted - Fix LookDev used Cubemap when asset is deleted - Fixed the definition of `rcp()` for GLES2. +<<<<<<< HEAD - Fix LookDev issue when adding a GameObject containing a Volume into the LookDev's view. - Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file - Fixed the texture curve being destroyed from another thread than main (case 1211754) - Fixed unreachable code in TextureXR.useTexArray +======= +- Fixed copy/pasting of Volume Components when loading a new scene +>>>>>>> 70f887c8f7... Fixed volume components lifespan in the clipboard (#5869) ### Changed - Restored usage of ENABLE_VR to fix compilation errors on some platforms. diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs index d54ced280a5..f487281dc3c 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs @@ -58,8 +58,6 @@ public sealed class VolumeComponentListEditor Dictionary m_EditorTypes; // Component type => Editor type List m_Editors; - static VolumeComponent s_ClipboardContent; - /// /// Creates a new instance of to use in an /// existing editor. @@ -416,33 +414,33 @@ internal void MoveComponent(int id, int offset) m_Editors[id] = prev; } - // Copy/pasting is simply done by creating an in memory copy of the selected component and - // copying over the serialized data to another; it doesn't use nor affect the OS clipboard static bool CanPaste(VolumeComponent targetComponent) { - return s_ClipboardContent != null - && s_ClipboardContent.GetType() == targetComponent.GetType(); + if (string.IsNullOrWhiteSpace(EditorGUIUtility.systemCopyBuffer)) + return false; + + string clipboard = EditorGUIUtility.systemCopyBuffer; + int separator = clipboard.IndexOf('|'); + + if (separator < 0) + return false; + + return targetComponent.GetType().AssemblyQualifiedName == clipboard.Substring(0, separator); } static void CopySettings(VolumeComponent targetComponent) { - if (s_ClipboardContent != null) - { - CoreUtils.Destroy(s_ClipboardContent); - s_ClipboardContent = null; - } - - s_ClipboardContent = (VolumeComponent)ScriptableObject.CreateInstance(targetComponent.GetType()); - EditorUtility.CopySerializedIfDifferent(targetComponent, s_ClipboardContent); + string typeName = targetComponent.GetType().AssemblyQualifiedName; + string typeData = JsonUtility.ToJson(targetComponent); + EditorGUIUtility.systemCopyBuffer = $"{typeName}|{typeData}"; } static void PasteSettings(VolumeComponent targetComponent) { - Assert.IsNotNull(s_ClipboardContent); - Assert.AreEqual(s_ClipboardContent.GetType(), targetComponent.GetType()); - + string clipboard = EditorGUIUtility.systemCopyBuffer; + string typeData = clipboard.Substring(clipboard.IndexOf('|') + 1); Undo.RecordObject(targetComponent, "Paste Settings"); - EditorUtility.CopySerializedIfDifferent(s_ClipboardContent, targetComponent); + JsonUtility.FromJsonOverwrite(typeData, targetComponent); } } } From 225f724db0f2b67c3b2fa7c8ddf463b5437e1ab9 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Tue, 24 Mar 2020 10:29:28 +0100 Subject: [PATCH 36/84] Hdrp/fix/particle light shadows #6111 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Lighting/Light/HDAdditionalLightData.cs | 6 +++--- .../Runtime/Lighting/Shadow/HDShadowUtils.cs | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 53e0ba11f64..ef4619b2d4c 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where default volume would not update when switching profile. - Fixed an issue where AO override would not override specular occlusion. - Fixed an issue where Volume inspector might not refresh correctly in some cases. +- Half fixed shuriken particle light that cast shadows (only the first one will be correct) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index c20ec99b1ad..8429e5d3130 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -1873,7 +1873,7 @@ internal int UpdateShadowRequest(HDCamera hdCamera, HDShadowManager manager, HDS // Assign all setting common to every lights - SetCommonShadowRequestSettings(shadowRequest, cameraPos, invViewProjection, shadowRequest.deviceProjectionYFlip * shadowRequest.view, viewportSize, lightIndex); + SetCommonShadowRequestSettings(shadowRequest, visibleLight, cameraPos, invViewProjection, shadowRequest.deviceProjectionYFlip * shadowRequest.view, viewportSize, lightIndex); } shadowRequest.atlasViewport = resolutionRequest.atlasViewport; @@ -1893,7 +1893,7 @@ internal int UpdateShadowRequest(HDCamera hdCamera, HDShadowManager manager, HDS return firstShadowRequestIndex; } - void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, Vector3 cameraPos, Matrix4x4 invViewProjection, Matrix4x4 viewProjection, Vector2 viewportSize, int lightIndex) + void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, VisibleLight visibleLight, Vector3 cameraPos, Matrix4x4 invViewProjection, Matrix4x4 viewProjection, Vector2 viewportSize, int lightIndex) { // zBuffer param to reconstruct depth position (for transmission) float f = legacyLight.range; @@ -1917,7 +1917,7 @@ void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, Vector3 camer if (lightType == HDLightType.Directional || lightType == HDLightType.Spot && spotLightShape == SpotLightShape.Box) shadowRequest.position = new Vector3(shadowRequest.view.m03, shadowRequest.view.m13, shadowRequest.view.m23); else - shadowRequest.position = (ShaderConfig.s_CameraRelativeRendering != 0) ? transform.position - cameraPos : transform.position; + shadowRequest.position = (ShaderConfig.s_CameraRelativeRendering != 0) ? visibleLight.GetPosition() - cameraPos : visibleLight.GetPosition(); shadowRequest.shadowToWorld = invViewProjection.transpose; shadowRequest.zClip = (lightType != HDLightType.Directional); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs index dc1bd7a93df..e3b684ac530 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs @@ -73,7 +73,7 @@ public static void ExtractDirectionalLightData(VisibleLight visibleLight, Vector splitData.shadowCascadeBlendCullingFactor = .6f; // get lightDir - lightDir = visibleLight.light.transform.forward; + lightDir = visibleLight.GetForward(); // TODO: At some point this logic should be moved to C#, then the parameters cullResults and lightIndex can be removed as well // For directional lights shadow data is extracted from the cullResults, so that needs to be somehow provided here. // Check ScriptableShadowsUtility.cpp ComputeDirectionalShadowMatricesAndCullingPrimitives(...) for details. @@ -230,7 +230,7 @@ static Matrix4x4 ExtractSpotLightMatrix(VisibleLight vl, float spotAngle, float splitData.cullingSphere.Set(0.0f, 0.0f, 0.0f, float.NegativeInfinity); splitData.cullingPlaneCount = 0; // get lightDir - lightDir = vl.light.transform.forward; + lightDir = vl.GetForward(); // calculate view Matrix4x4 scaleMatrix = Matrix4x4.identity; scaleMatrix.m22 = -1.0f; @@ -253,9 +253,9 @@ static Matrix4x4 ExtractPointLightMatrix(VisibleLight vl, uint faceIdx, float ne splitData.cullingSphere.Set(0.0f, 0.0f, 0.0f, float.NegativeInfinity); // get lightDir - lightDir = vl.light.transform.forward; + lightDir = vl.GetForward(); // calculate the view matrices - Vector3 lpos = vl.light.transform.position; + Vector3 lpos = vl.GetPosition(); view = kCubemapFaces[faceIdx]; Vector3 inverted_viewpos = kCubemapFaces[faceIdx].MultiplyPoint(-lpos); view.SetColumn(3, new Vector4(inverted_viewpos.x, inverted_viewpos.y, inverted_viewpos.z, 1.0f)); From 305a2536ffbb449a1ffd7b293c113d3ca193ea22 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 24 Mar 2020 09:49:16 +0100 Subject: [PATCH 37/84] Bugfix: uncached reflection probe cameras were reseting the debug mode #6245 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 +- .../Runtime/Utilities/CameraCache.cs | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ef4619b2d4c..d6a0e7460e3 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where AO override would not override specular occlusion. - Fixed an issue where Volume inspector might not refresh correctly in some cases. - Half fixed shuriken particle light that cast shadows (only the first one will be correct) +- Fixed issue with uncached reflection probe cameras reseting the debug mode (case 1224601) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index b7e12c2c334..2626d58a71b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1525,7 +1525,7 @@ void AddHDProbeRenderRequests( for (int j = 0; j < cameraSettings.Count; ++j) { - var camera = m_ProbeCameraCache.GetOrCreate((viewerTransform, visibleProbe, j), m_FrameCount); + var camera = m_ProbeCameraCache.GetOrCreate((viewerTransform, visibleProbe, j), m_FrameCount, CameraType.Reflection); var additionalCameraData = camera.GetComponent(); if (additionalCameraData == null) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs index 01efcc665f7..16cec78e9fe 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs @@ -23,11 +23,12 @@ class CameraCache: IDisposable /// /// This frame count is assigned to the returned camera to know the age of its last use. /// + /// The type of camera to create if one does not exists. /// /// The cached camera if the key was found, /// otherwise a new camera that was inserted in the cache during the call. /// - public Camera GetOrCreate(K key, int frameCount) + public Camera GetOrCreate(K key, int frameCount, CameraType cameraType = CameraType.Game) { if (m_Cache == null) throw new ObjectDisposedException(nameof(CameraCache)); @@ -35,6 +36,7 @@ public Camera GetOrCreate(K key, int frameCount) if (!m_Cache.TryGetValue(key, out var camera) || camera.camera == null || camera.camera.Equals(null)) { camera = (new GameObject().AddComponent(), frameCount); + camera.camera.cameraType = cameraType; m_Cache[key] = camera; } else From ce5e52787a0c14bb2fb844f18d74a796d8d13f2a Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Wed, 25 Mar 2020 18:50:33 +0000 Subject: [PATCH 38/84] Fix case in PBR sky where a camera below ground might invalidate result of a camera above #6272 --- .../CHANGELOG.md | 1 + .../PhysicallyBasedSky/PhysicallyBasedSky.cs | 18 +++++++++++ .../Runtime/Sky/SkyManager.cs | 32 +++++++++++++++---- .../Runtime/Sky/SkySettings.cs | 11 +++++++ 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index d6a0e7460e3..f7bddb9ab2a 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where Volume inspector might not refresh correctly in some cases. - Half fixed shuriken particle light that cast shadows (only the first one will be correct) - Fixed issue with uncached reflection probe cameras reseting the debug mode (case 1224601) +- Fixed issue with atmospheric fog turning black if a planar reflection probe is placed below ground level. (case 1226588) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs index ffc2a97f4ef..202f4be7312 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs @@ -348,6 +348,24 @@ internal int GetPrecomputationHashCode() return hash; } + /// + /// Returns the hash code of the sky parameters. + /// + /// The camera we want to use to compute the hash of the sky. + /// The hash code of the sky parameters. + public override int GetHashCode(Camera camera) + { + int hash = GetHashCode(); + Vector3 cameraLocation = camera.transform.position; + float r = Vector3.Distance(cameraLocation, GetPlanetCenterPosition(cameraLocation)); + float R = GetPlanetaryRadius(); + + bool isPbrSkyActive = r > R; // Disable sky rendering below the ground + + hash = hash * 23 + isPbrSkyActive.GetHashCode(); + return hash; + } + /// Returns the hash code of the parameters of the sky. /// The hash code of the parameters of the sky. public override int GetHashCode() diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index 447da6c071e..52bb03f685c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -643,12 +643,20 @@ bool IsCachedContextValid(SkyUpdateContext skyContext) return id != -1 && (skyContext.skySettings.GetSkyRendererType() == m_CachedSkyContexts[id].type) && (m_CachedSkyContexts[id].hash != 0); } - int ComputeSkyHash(SkyUpdateContext skyContext, Light sunLight, SkyAmbientMode ambientMode, bool staticSky = false) + int ComputeSkyHash(HDCamera camera, SkyUpdateContext skyContext, Light sunLight, SkyAmbientMode ambientMode, bool staticSky = false) { int sunHash = 0; if (sunLight != null) sunHash = GetSunLightHashCode(sunLight); - int skyHash = sunHash * 23 + skyContext.skySettings.GetHashCode(); + + // For planar reflections we want to use the parent position for hash. + Camera cameraForHash = camera.camera; + if (camera.camera.cameraType == CameraType.Reflection && camera.parentCamera != null) + { + cameraForHash = camera.parentCamera; + } + + int skyHash = sunHash * 23 + skyContext.skySettings.GetHashCode(cameraForHash); skyHash = skyHash * 23 + (staticSky ? 1 : 0); skyHash = skyHash * 23 + (ambientMode == SkyAmbientMode.Static ? 1 : 0); return skyHash; @@ -684,14 +692,24 @@ public void UpdateEnvironment( HDCamera hdCamera, m_BuiltinParameters.commandBuffer = cmd; m_BuiltinParameters.sunLight = sunLight; m_BuiltinParameters.pixelCoordToViewDirMatrix = hdCamera.mainViewConstants.pixelCoordToViewDirWS; - m_BuiltinParameters.worldSpaceCameraPos = hdCamera.mainViewConstants.worldSpaceCameraPos; + Vector3 worldSpaceCameraPos = hdCamera.mainViewConstants.worldSpaceCameraPos; + // For planar reflections we use the parent camera position for all the runtime computations. + // This is to avoid cases in which the probe camera is below ground and the parent is not, leading to + // in case of PBR sky to a black sky. All other parameters are left as is. + // This can introduce inaccuracies, but they should be acceptable if the distance parent camera - probe camera is + // small. + if (hdCamera.camera.cameraType == CameraType.Reflection && hdCamera.parentCamera != null) + { + worldSpaceCameraPos = hdCamera.parentCamera.transform.position; + } + m_BuiltinParameters.worldSpaceCameraPos = worldSpaceCameraPos; m_BuiltinParameters.viewMatrix = hdCamera.mainViewConstants.viewMatrix; m_BuiltinParameters.screenSize = m_CubemapScreenSize; m_BuiltinParameters.debugSettings = null; // We don't want any debug when updating the environment. m_BuiltinParameters.frameIndex = frameIndex; m_BuiltinParameters.skySettings = skyContext.skySettings; - int skyHash = ComputeSkyHash(skyContext, sunLight, ambientMode, staticSky); + int skyHash = ComputeSkyHash(hdCamera, skyContext, sunLight, ambientMode, staticSky); bool forceUpdate = updateRequired; // Acquire the rendering context, if the context was invalid or the hash has changed, this will request for an update. @@ -751,7 +769,7 @@ public void UpdateEnvironment( HDCamera hdCamera, #if UNITY_EDITOR // In the editor when we change the sky we want to make the GI dirty so when baking again the new sky is taken into account. // Changing the hash of the rendertarget allow to say that GI is dirty - renderingContext.skyboxCubemapRT.rt.imageContentsHash = new Hash128((uint)skyContext.skySettings.GetHashCode(), 0, 0, 0); + renderingContext.skyboxCubemapRT.rt.imageContentsHash = new Hash128((uint)skyContext.skySettings.GetHashCode(hdCamera.camera), 0, 0, 0); #endif } } @@ -837,7 +855,7 @@ public void PreRenderSky(HDCamera hdCamera, Light sunLight, RTHandle colorBuffer cmd); SkyAmbientMode ambientMode = hdCamera.volumeStack.GetComponent().skyAmbientMode.value; - int skyHash = ComputeSkyHash(skyContext, sunLight, ambientMode); + int skyHash = ComputeSkyHash(hdCamera, skyContext, sunLight, ambientMode); AcquireSkyRenderingContext(skyContext, skyHash); skyContext.skyRenderer.DoUpdate(m_BuiltinParameters); if (depthBuffer != BuiltinSkyParameters.nullRT && normalBuffer != BuiltinSkyParameters.nullRT) @@ -869,7 +887,7 @@ public void RenderSky(HDCamera hdCamera, Light sunLight, RTHandle colorBuffer, R cmd); SkyAmbientMode ambientMode = hdCamera.volumeStack.GetComponent().skyAmbientMode.value; - int skyHash = ComputeSkyHash(skyContext, sunLight, ambientMode); + int skyHash = ComputeSkyHash(hdCamera, skyContext, sunLight, ambientMode); AcquireSkyRenderingContext(skyContext, skyHash); skyContext.skyRenderer.DoUpdate(m_BuiltinParameters); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs index d7bbcbca572..73c790cad10 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs @@ -139,6 +139,17 @@ public abstract class SkySettings : VolumeComponent /// /// Returns the hash code of the sky parameters. /// + /// The camera we want to use to compute the hash of the sky. + /// The hash code of the sky parameters. + virtual public int GetHashCode(Camera camera) + { + // By default we don't need to consider the camera position. + return GetHashCode(); + } + + /// + /// Returns the hash code of the sky parameters. When used with PBR Sky please use the GetHashCode variant that takes a camera as parameter. + /// /// The hash code of the sky parameters. public override int GetHashCode() { From 58c81b6c11a1ca0d83864684a9bb0981e63e7bf5 Mon Sep 17 00:00:00 2001 From: skhiat <55133890+skhiat@users.noreply.github.com> Date: Tue, 24 Mar 2020 10:27:01 +0100 Subject: [PATCH 39/84] Hdrp/probe scale 1219246 (#6288) * Fix when scale down < 0 all direction of box Influence Volume * Update Change log --- .../CHANGELOG.md | 1 + .../Reflection/PlanarReflectionProbeEditor.cs | 7 +++---- .../Volume/InfluenceVolumeUI.Drawers.cs | 15 ++++++++++----- .../Volume/InfluenceVolumeUI.Handles.cs | 12 +++++++----- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f7bddb9ab2a..56a54a84a1b 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -141,6 +141,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added the Tint parameter to Sky Colored Fog. ### Fixed +- Fix when rescale probe all direction below zero (1219246) - Update documentation of HDRISky-Backplate, precise how to have Ambient Occlusion on the Backplate - Sorting, undo, labels, layout in the Lighting Explorer. - Fixed sky settings and materials in Shader Graph Samples package diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/PlanarReflectionProbeEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/PlanarReflectionProbeEditor.cs index 2824111b0aa..cbece4f9ae9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/PlanarReflectionProbeEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/PlanarReflectionProbeEditor.cs @@ -161,7 +161,7 @@ void OnOverlayGUI(Object target, SceneView sceneView) var previewWidth = k_PreviewHeight; var previewSize = new Rect(previewWidth, k_PreviewHeight + EditorGUIUtility.singleLineHeight + 2, 0, 0); - + if (Event.current.type == EventType.Layout || !firstDraw && Event.current.type == EventType.Repaint) { @@ -304,7 +304,7 @@ static void DrawCapturePositionGizmo(PlanarReflectionProbe probe) k_PreviewMaterial.SetPass(0); Graphics.DrawMeshNow(k_QuadMesh, Matrix4x4.TRS(mirrorPosition, mirrorRotation, Vector3.one * capturePointPreviewSize * 2)); } - + static void InitIcons() { s_MipMapLow = EditorGUIUtility.IconContent("PreTextureMipMapLow"); @@ -320,7 +320,6 @@ struct PlanarReflectionProbeUISettingsProvider : HDProbeUI.IProbeUISettingsProvi bool InfluenceVolumeUI.IInfluenceUISettingsProvider.drawNormal => false; bool InfluenceVolumeUI.IInfluenceUISettingsProvider.drawFace => false; - ProbeSettingsOverride HDProbeUI.IProbeUISettingsProvider.displayedCaptureSettings => new ProbeSettingsOverride { probe = ProbeSettingsFields.frustumFieldOfViewMode @@ -360,7 +359,7 @@ struct PlanarReflectionProbeUISettingsProvider : HDProbeUI.IProbeUISettingsProvi camera = CameraSettingsFields.none } }; - + Type HDProbeUI.IProbeUISettingsProvider.customTextureType => typeof(Texture2D); static readonly HDProbeUI.ToolBar[] k_Toolbars = { diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs index 43258ec6d7d..9e4443bbc2e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs @@ -17,7 +17,6 @@ public static void Draw(SerializedInfluenceVolume serialized, Editor { var provider = new TProvider(); - EditorGUILayout.PropertyField(serialized.shape, shapeContent); switch ((InfluenceShape)serialized.shape.intValue) { @@ -57,7 +56,7 @@ public static void SetInfluenceAdvancedControlSwitch(SerializedInfluenceVolume s static void Drawer_SectionShapeBox(SerializedInfluenceVolume serialized, Editor owner, bool drawOffset, bool drawNormal, bool drawFace) { bool advanced = serialized.editorAdvancedModeEnabled.boolValue; - + //small piece of init logic previously in the removed Drawer_InfluenceAdvancedSwitch s_BoxBaseHandle.monoHandle = false; s_BoxInfluenceHandle.monoHandle = !advanced; @@ -71,6 +70,13 @@ static void Drawer_SectionShapeBox(SerializedInfluenceVolume serialized, Editor EditorGUILayout.PropertyField(serialized.boxSize, boxSizeContent); if (EditorGUI.EndChangeCheck()) { + Vector3 localSize = serialized.boxSize.vector3Value; + for (int i = 0; i < 3; ++i) + { + localSize[i] = Mathf.Max(Mathf.Epsilon, localSize[i]); + } + serialized.boxSize.vector3Value = localSize; + Vector3 blendPositive = serialized.boxBlendDistancePositive.vector3Value; Vector3 blendNegative = serialized.boxBlendDistanceNegative.vector3Value; Vector3 blendNormalPositive = serialized.boxBlendNormalDistancePositive.vector3Value; @@ -112,7 +118,7 @@ static void Drawer_SectionShapeBox(SerializedInfluenceVolume serialized, Editor EditorGUILayout.EndHorizontal(); GUILayout.Space(EditorGUIUtility.standardVerticalSpacing); - + EditorGUILayout.PropertyField(serialized.editorAdvancedModeEnabled, manipulatonTypeContent); EditorGUILayout.BeginHorizontal(); @@ -152,7 +158,7 @@ static void Drawer_AdvancedBlendDistance(SerializedInfluenceVolume serialized, b SerializedProperty editorSimplifiedModeBlendDistance = isNormal ? serialized.editorSimplifiedModeBlendNormalDistance : serialized.editorSimplifiedModeBlendDistance; Vector3 bdp = blendDistancePositive.vector3Value; Vector3 bdn = blendDistanceNegative.vector3Value; - + //resync to be sure prefab revert will keep syncs if (serialized.editorAdvancedModeEnabled.boolValue) { @@ -218,7 +224,6 @@ static void Drawer_AdvancedBlendDistance(SerializedInfluenceVolume serialized, b static void Drawer_SectionShapeSphere(SerializedInfluenceVolume serialized, Editor owner, bool drawOffset, bool drawNormal) { - EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(serialized.sphereRadius, radiusContent); HDProbeUI.Drawer_ToolBarButton(HDProbeUI.ToolBar.InfluenceShape, owner, GUILayout.Width(28f), GUILayout.MinHeight(22f)); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs index 2c8d06372fc..6591265fc2d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs @@ -23,6 +23,12 @@ public static void DrawHandles_EditBase(SerializedInfluenceVolume serialized, Ed s_SphereBaseHandle.DrawHandle(); if (EditorGUI.EndChangeCheck()) { + Vector3 localSize = serialized.boxSize.vector3Value; + for (int i = 0; i < 3; ++i) + { + localSize[i] = Mathf.Max(Mathf.Epsilon, localSize[i]); + } + serialized.boxSize.vector3Value = localSize; float radius = s_SphereBaseHandle.radius; serialized.sphereRadius.floatValue = radius; serialized.sphereBlendDistance.floatValue = Mathf.Clamp(serialized.sphereBlendDistance.floatValue, 0, radius); @@ -101,7 +107,7 @@ static void DrawBoxHandle(SerializedInfluenceVolume serialized, Editor owner, Tr { using (new Handles.DrawingScope(Matrix4x4.TRS(Vector3.zero, transform.rotation, Vector3.one))) { - box.center = Quaternion.Inverse(transform.rotation) * transform.position; + box.center = Quaternion.Inverse(transform.rotation)*transform.position; box.size = serialized.boxSize.vector3Value; EditorGUI.BeginChangeCheck(); @@ -109,10 +115,6 @@ static void DrawBoxHandle(SerializedInfluenceVolume serialized, Editor owner, Tr box.DrawHandle(); if (EditorGUI.EndChangeCheck()) { - var newPosition = transform.rotation * box.center; - Undo.RecordObject(transform, "Moving Influence"); - transform.position = newPosition; - // Clamp blend distances var blendPositive = serialized.boxBlendDistancePositive.vector3Value; var blendNegative = serialized.boxBlendDistanceNegative.vector3Value; From 98c3f8f53cb893f70f771f8a766b15491b4040dd Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Thu, 26 Mar 2020 12:51:24 +0100 Subject: [PATCH 40/84] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 56a54a84a1b..ddb47ebeda6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -60,6 +60,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Half fixed shuriken particle light that cast shadows (only the first one will be correct) - Fixed issue with uncached reflection probe cameras reseting the debug mode (case 1224601) - Fixed issue with atmospheric fog turning black if a planar reflection probe is placed below ground level. (case 1226588) +- Fix when rescale probe all direction below zero (1219246) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. @@ -141,7 +142,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added the Tint parameter to Sky Colored Fog. ### Fixed -- Fix when rescale probe all direction below zero (1219246) - Update documentation of HDRISky-Backplate, precise how to have Ambient Occlusion on the Backplate - Sorting, undo, labels, layout in the Lighting Explorer. - Fixed sky settings and materials in Shader Graph Samples package From ed0969c63692393bc53534295e22ce5b655c1143 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Tue, 24 Mar 2020 09:04:12 +0000 Subject: [PATCH 41/84] Split set rendering feature set and API validity check #6301 --- .../CHANGELOG.md | 1 + .../RenderPipeline/HDRenderPipeline.cs | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ddb47ebeda6..25a610b55f0 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue with uncached reflection probe cameras reseting the debug mode (case 1224601) - Fixed issue with atmospheric fog turning black if a planar reflection probe is placed below ground level. (case 1226588) - Fix when rescale probe all direction below zero (1219246) +- Fixed issue with resources being accessed before initialization process has been performed completely. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 2626d58a71b..f528c77255c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -331,12 +331,7 @@ public HDRenderPipeline(HDRenderPipelineAsset asset, HDRenderPipelineAsset defau m_ValidAPI = true; - if (!SetRenderingFeatures()) - { - m_ValidAPI = false; - - return; - } + SetRenderingFeatures(); // The first thing we need to do is to set the defines that depend on the render pipeline settings m_RayTracingSupported = GatherRayTracingSupport(m_Asset.currentPlatformRenderPipelineSettings); @@ -359,6 +354,14 @@ public HDRenderPipeline(HDRenderPipelineAsset asset, HDRenderPipelineAsset defau ValidateResources(); #endif + // We need to call this after the resource initialization as we attempt to use them in checking the supported API. + if (!CheckAPIValidity()) + { + m_ValidAPI = false; + + return; + } + // Initial state of the RTHandle system. // Tells the system that we will require MSAA or not so that we can avoid wasteful render texture allocation. // TODO: Might want to initialize to at least the window resolution to avoid un-necessary re-alloc in the player @@ -648,7 +651,7 @@ void DestroyRenderTextures() RTHandles.Release(m_CameraSssDiffuseLightingMSAABuffer); } - bool SetRenderingFeatures() + void SetRenderingFeatures() { // Set sub-shader pipeline tag Shader.globalRenderPipeline = "HDRenderPipeline"; @@ -691,7 +694,10 @@ bool SetRenderingFeatures() Debug.LogError("High Definition Render Pipeline doesn't support Gamma mode, change to Linear mode (HDRP isn't set up properly. Go to Windows > RenderPipeline > HDRP Wizard to fix your settings)."); } #endif + } + bool CheckAPIValidity() + { GraphicsDeviceType unsupportedDeviceType; if (!IsSupportedPlatform(out unsupportedDeviceType)) { From 0dbea133a757f7e1016d02d3fcbf58cbe7f4297f Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Tue, 24 Mar 2020 05:00:54 -0400 Subject: [PATCH 42/84] Fix Render Texture with XR #6306 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 25a610b55f0..b073cab1d73 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue with atmospheric fog turning black if a planar reflection probe is placed below ground level. (case 1226588) - Fix when rescale probe all direction below zero (1219246) - Fixed issue with resources being accessed before initialization process has been performed completely. +- Fixed render texture with XR ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index f528c77255c..e1dc2e071b5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1782,7 +1782,7 @@ ref _cullingResults } // Render XR mirror view once all render requests have been completed - if (i == 0 && renderRequest.hdCamera.camera.cameraType == CameraType.Game) + if (i == 0 && renderRequest.hdCamera.camera.cameraType == CameraType.Game && renderRequest.hdCamera.camera.targetTexture == null) { m_XRSystem.RenderMirrorView(cmd); } From 91e4b0dc7a041fcc2b01c55a4cf37649a7f47d74 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Tue, 24 Mar 2020 04:40:41 -0400 Subject: [PATCH 43/84] Fix sRGB mismatch with XR SDK #6311 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/XR/XRSystem.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b073cab1d73..df08ea2f465 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -63,6 +63,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix when rescale probe all direction below zero (1219246) - Fixed issue with resources being accessed before initialization process has been performed completely. - Fixed render texture with XR +- Fixed sRGB mismatch with XR SDK ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs index 36fc9f4d668..9e52495229d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs @@ -76,7 +76,10 @@ internal static void XRSystemInit() SubsystemManager.GetInstances(displayList); for (int i = 0; i < displayList.Count; i++) + { displayList[i].disableLegacyRenderer = true; + displayList[i].sRGB = true; + } } #endif From acea9c4410762e59dca9311424bd06e058df13b1 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Tue, 24 Mar 2020 04:39:57 -0400 Subject: [PATCH 44/84] Fix XR single-pass with Mock HMD plugin #6313 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/XR/XRSystem.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index df08ea2f465..4f534787750 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed issue with resources being accessed before initialization process has been performed completely. - Fixed render texture with XR - Fixed sRGB mismatch with XR SDK +- Fixed XR single-pass with Mock HMD plugin ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs index 9e52495229d..4b89ae1d46c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs @@ -170,6 +170,7 @@ bool RefreshXrSdk() display = displayList[0]; display.disableLegacyRenderer = true; + display.textureLayout = XRDisplaySubsystem.TextureLayout.Texture2DArray; return display.running; } From 912653192ca1973d44e6b612396bf899bb50a552 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Tue, 24 Mar 2020 04:38:58 -0400 Subject: [PATCH 45/84] Fix XR culling with multiple cameras #6314 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 4f534787750..c647d5a96e5 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed render texture with XR - Fixed sRGB mismatch with XR SDK - Fixed XR single-pass with Mock HMD plugin +- Fixed XR culling with multiple cameras ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index e1dc2e071b5..625add2e1eb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1310,7 +1310,7 @@ protected override void Render(ScriptableRenderContext renderContext, Camera[] c { foreach (var req in renderRequests) { - if (req.hdCamera.xr.cullingPassId == xrPass.cullingPassId) + if (camera == req.hdCamera.camera && req.hdCamera.xr.cullingPassId == xrPass.cullingPassId) { UnsafeGenericPool.Release(cullingResults); cullingResults = req.cullingResults; From 86f417a853557efb8aec118e00bc898779364c41 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Tue, 24 Mar 2020 09:32:43 +0100 Subject: [PATCH 46/84] Add custom pass opaque rendering error message #6330 --- .../CHANGELOG.md | 1 + .../Documentation~/Custom-Pass.md | 2 ++ .../DrawRenderersCustomPassDrawer.cs | 36 +++++++++++++++++-- .../RenderPass/CustomPass/CustomPass.cs | 3 ++ 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index c647d5a96e5..ed1d3a844fd 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added an "enable" toggle to the SSR volume component. - Added support of cookie baking and add support on Disc light. - Added XR setting to control camera jitter for temporal effects +- Added an error message in the DrawRenderers custom pass when rendering opaque objects with an HDRP asset in DeferredOnly mode. ### Fixed - Fix Changelog diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md index ffdf3b73987..b5f7172e4d4 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md @@ -198,6 +198,8 @@ Here is the list of all the defines you can enable Note that you can also override the depth state of the objects in your pass. This is especially useful when you're rendering objects that are not in the camera culling mask (they are only rendered in the custom pass). Because in these objects, opaque ones will be rendered in `Depth Equal` test which only works if they already are in the depth buffer. In this case you may want to override the depth test to `Less Equal`. +**⚠️ Be careful when rendering Opaque objects if you're in deferred: All objects rendered within custom passes are rendered in Forward. It means that you'll need to set your HDRP settings Lit Shader Mode to 'Both' in case you encounter issues when building in release.** + ## Scripting API diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs index 0a95065fac7..63d835a7615 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs @@ -23,6 +23,7 @@ private class Styles public static float defaultLineSpace = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; public static float reorderableListHandleIndentWidth = 12; public static float indentSpaceInPixels = 16; + public static float helpBoxHeight = EditorGUIUtility.singleLineHeight * 2; public static GUIContent callback = new GUIContent("Event", "Chose the Callback position for this render pass object."); public static GUIContent enabled = new GUIContent("Enabled", "Enable or Disable the custom pass"); @@ -54,6 +55,7 @@ private class Styles public static string unlitShaderMessage = "HDRP Unlit shaders will force the shader passes to \"ForwardOnly\""; public static string hdrpLitShaderMessage = "HDRP Lit shaders are not supported in a custom pass"; + public static string opaqueObjectWithDeferred = "Your HDRP settings does not support ForwardOnly, some object might not render."; } //Headers and layout @@ -154,6 +156,23 @@ protected override void DoPassGUI(SerializedProperty customPass, Rect rect) } } + // Tel if we need to show a warning for rendering opaque object and we're in deferred. + bool ShowOpaqueObjectWarning() + { + // Only opaque objects are concerned + RenderQueueRange currentRange = CustomPass.GetRenderQueueRangeFromRenderQueueType((CustomPass.RenderQueueType)m_RenderQueue.intValue); + var allOpaque = HDRenderQueue.k_RenderQueue_AllOpaque; + bool customPassQueueContainsOpaqueObjects = currentRange.upperBound >= allOpaque.lowerBound && currentRange.lowerBound <= allOpaque.upperBound; + if (!customPassQueueContainsOpaqueObjects) + return false; + + // Only Deferred rendering + if (HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportedLitShaderMode != RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly) + return false; + + return true; + } + void DoFilters(ref Rect rect) { m_FilterFoldout.boolValue = EditorGUI.Foldout(rect, m_FilterFoldout.boolValue, Styles.filtersHeader, true); @@ -166,10 +185,17 @@ void DoFilters(ref Rect rect) // TODO: remove all this code when the fix for SerializedReference lands m_RenderQueue.intValue = (int)(CustomPass.RenderQueueType)EditorGUI.EnumPopup(rect, Styles.renderQueueFilter, (CustomPass.RenderQueueType)m_RenderQueue.intValue); rect.y += Styles.defaultLineSpace; + if (ShowOpaqueObjectWarning()) + { + Rect helpBoxRect = rect; + helpBoxRect.xMin += EditorGUI.indentLevel * Styles.indentSpaceInPixels; + helpBoxRect.height = Styles.helpBoxHeight; + EditorGUI.HelpBox(helpBoxRect, Styles.opaqueObjectWithDeferred, MessageType.Error); + rect.y += Styles.helpBoxHeight; + } //Layer mask EditorGUI.PropertyField(rect, m_LayerMask, Styles.layerMask); rect.y += Styles.defaultLineSpace; - //Shader pass list EditorGUI.indentLevel--; } } @@ -268,7 +294,13 @@ bool IsHDRPShader() protected override float GetPassHeight(SerializedProperty customPass) { - float height = Styles.defaultLineSpace * (m_FilterFoldout.boolValue ? m_FilterLines : 1); + float height = Styles.defaultLineSpace; + + if (m_FilterFoldout.boolValue) + { + height *= m_FilterLines; + height += ShowOpaqueObjectWarning() ? Styles.helpBoxHeight : 0; + } height += Styles.defaultLineSpace; // add line for overrides dropdown if (m_RendererFoldout.boolValue) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs index 1a5515ccd0a..8c9de63e61f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs @@ -375,6 +375,9 @@ protected RTHandle GetNormalBuffer() /// The custom pass render queue type. /// Returns a render queue range compatible with a ScriptableRenderContext.DrawRenderers. protected RenderQueueRange GetRenderQueueRange(CustomPass.RenderQueueType type) + => GetRenderQueueRangeFromRenderQueueType(type); + + internal static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(RenderQueueType type) { switch (type) { From 446ba01adbd5c0256a7d79c15f43535b07143e21 Mon Sep 17 00:00:00 2001 From: JordanL8 Date: Tue, 24 Mar 2020 08:59:05 +0000 Subject: [PATCH 47/84] Update Light-Component.md (#6332) --- .../Documentation~/Light-Component.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Light-Component.md b/com.unity.render-pipelines.high-definition/Documentation~/Light-Component.md index 8367bc33edd..f5029e94aaa 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Light-Component.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Light-Component.md @@ -184,13 +184,13 @@ These settings define the volumetric behavior of this Light. Alter these setting ### **Shadows** -Use the Shadows section to adjust the Shadows cast by this Light. HDRP currently does not support shadowing **Tube** Lights. Because of this, Unity does not expose the **Shadows** drop-down section in the Inspector when you select this **Type**. The Light **Types** that HDRP does support shadowing for (**Spot**, **Directional**, and **Point**) share almost all of their properties. +Use this section to adjust the Shadows cast by this Light. Note that Area Lights can't currently cast shadows for GameObjects that use a **StackLit** Material. -Unity exposes extra properties in the **Shadows** section depending on the **Mode** you set in the [General](#GeneralProperties) section. It also exposes extra properties depending on the **Filtering Quality** set in your Unity Project’s [HDRP Asset](HDRP-Asset.html). To change the **Filtering Quality** property, navigate to your Project’s **HDRP Asset > Shadows** and use the **Filtering Quality** drop-down to select the shadow filtering mode. Setting **Filtering Quality** to **High** exposes extra properties in the Light Inspector’s **Shadow** drop-down section. +Unity exposes extra properties in this section depending on the **Mode** you set in the [General](#GeneralProperties) section. Unity also exposes extra properties depending on the **Filtering Quality** set in your Unity Project’s [HDRP Asset](HDRP-Asset.html). -• For more information on shadow filtering in HDRP, see the documentation on [Shadow Filtering](Shadows-in-HDRP.html#ShadowFiltering). +• For more information on shadow filtering in HDRP, see [Shadow Filtering](Shadows-in-HDRP.html#ShadowFiltering). -• For a list of the the available filter quality presets in HDRP, see the [Filtering Qualities table](HDRP-Asset.html#FilteringQualities). +• For a list of the available filter quality presets in HDRP, see the [Filtering Qualities table](HDRP-Asset.html#FilteringQualities). #### Properties @@ -202,7 +202,7 @@ This section is only available in Realtime or Mixed light **Mode**. | -------------------------- | ------------------------------------------------------------ | | **Enable** | Enable the checkbox to let this Light cast shadows. | | **Update Mode** | Use the drop-down to select the mode that HDRP uses to determine when to update a shadow map.
For information on the modes available, see the [Shadows in HDRP documentation](Shadows-in-HDRP.html#ShadowUpdateMode). | -| **Resolution** | Set the resolution of this Light’s shadow maps. Use the drop-down to set the modeIf you enable , use the drop-down to select which quality mode to derive the resolution from. If you do not enable **Use Quality Settings**, set the resolution, measured in pixels, in the input field.A higher resolution increases the fidelity of shadows at the cost of GPU performance and memory usage, so if you experience any performance issues, try using a lower value. | +| **Resolution** | Set the resolution of this Light’s shadow maps. Use the drop-down to select which quality mode to derive the resolution from. If you do not enable **Use Quality Settings**, or you select **Custom**, set the resolution, measured in pixels, in the input field.
A higher resolution increases the fidelity of shadows at the cost of GPU performance and memory usage, so if you experience any performance issues, try using a lower value. | | **Near Plane** | The distance, in meters, from the Light that GameObjects begin to cast shadows. | | **Shadowmask Mode** | Defines how the shadowmask behaves for this Light. For detailed information on each **Shadowmask Mode**, see the documentation on [Shadowmasks](Shadows-in-HDRP.html#ShadowmaskModes). This property is only visible if you tet the **Mode**, under [General](#GeneralProperties), to **Mixed**. | | **Slope-Scale Depth Bias** | Use the slider to set the bias that HDRP adds to the distance in this Light's shadow map to avoid self intersection. This bias is proportional to the slope of the polygons represented in the shadow map.
This property only appears when you enable [more options](More-Options.html) for this section. | From 0f3337511df813c786b96a587117cf6a3933478c Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Thu, 26 Mar 2020 13:13:48 +0100 Subject: [PATCH 48/84] Update CHANGELOG.md --- com.unity.render-pipelines.core/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index e6abda1b770..1a05224fc0e 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -39,7 +39,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file - Fixed the texture curve being destroyed from another thread than main (case 1211754) - Fixed unreachable code in TextureXR.useTexArray -- Fixed copy/pasting of Volume Components when loading a new scene ### Changed - Restored usage of ENABLE_VR to fix compilation errors on some platforms. From 7ab67ddab53e57a428976bddecfc637aa9e08831 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Thu, 26 Mar 2020 13:19:32 +0100 Subject: [PATCH 49/84] Update TextureCurve.cs --- .../Runtime/Utilities/TextureCurve.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs b/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs index 8d9f83885f3..5a5513d49af 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs @@ -14,7 +14,7 @@ namespace UnityEngine.Rendering /// A wrapper around AnimationCurve to automatically bake it into a texture. ///
[Serializable] - public class TextureCurve + public class TextureCurve : IDisposable { const int k_Precision = 128; // Edit LutBuilder3D if you change this value const float k_Step = 1f / k_Precision; @@ -78,6 +78,7 @@ public TextureCurve(Keyframe[] keys, float zeroValue, bool loop, in Vector2 boun } /// + /// Finalizer. /// ~TextureCurve() {} @@ -255,4 +256,4 @@ public TextureCurveParameter(TextureCurve value, bool overrideState = false) // TODO: TextureCurve interpolation } -} \ No newline at end of file +} From 3fa39ef99c0f3b3715e18e02c901efda2047e82b Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Wed, 25 Mar 2020 23:37:10 +0100 Subject: [PATCH 50/84] fix merge issue --- .../Editor/Utilities/EditorMaterialQuality.cs | 1 + .../Runtime/Utilities/MaterialQuality.cs | 175 +----------------- .../RenderPipeline/HDRenderPipelineUI.cs | 1 + .../Settings/FrameSettingsUI.Drawers.cs | 3 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 1 + .../RenderPipeline/HDRenderPipeline.cs | 1 + .../RenderPipeline/HDRenderPipelineAsset.cs | 1 + .../RenderPipeline/Settings/FrameSettings.cs | 1 + 8 files changed, 10 insertions(+), 174 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs b/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs index 28c3c31ae9b..b61838e0793 100644 --- a/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs +++ b/com.unity.render-pipelines.core/Editor/Utilities/EditorMaterialQuality.cs @@ -1,4 +1,5 @@ using UnityEngine.Rendering; +using Utilities; namespace UnityEditor.Rendering.Utilities { diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs b/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs index 01c62081140..3975343b72c 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/MaterialQuality.cs @@ -1,183 +1,13 @@ using System; +using UnityEngine; +using UnityEngine.Rendering; -namespace UnityEngine.Rendering -{ - /// - /// Material quality flags. - /// - [Flags] - public enum MaterialQuality - { - /// Low Material Quality. - Low = 1 << 0, - /// Medium Material Quality. - Medium = 1 << 1, - /// High Material Quality. - High = 1 << 2 - } - - /// - /// Material Quality utility class. - /// - public static class MaterialQualityUtilities - { - /// - /// Keywords strings for Material Quality levels. - /// - public static string[] KeywordNames = - { - "MATERIAL_QUALITY_LOW", - "MATERIAL_QUALITY_MEDIUM", - "MATERIAL_QUALITY_HIGH", - }; - - /// - /// String representation of the MaterialQuality enum. - /// - public static string[] EnumNames = Enum.GetNames(typeof(MaterialQuality)); - - /// - /// Keywords for Material Quality levels. - /// - public static ShaderKeyword[] Keywords = - { - new ShaderKeyword(KeywordNames[0]), - new ShaderKeyword(KeywordNames[1]), - new ShaderKeyword(KeywordNames[2]), - }; - - /// - /// Returns the highest available quality level in a MaterialQuality bitfield. - /// - /// Input MaterialQuality bitfield. - /// The highest available quality level. - public static MaterialQuality GetHighestQuality(this MaterialQuality levels) - { - for (var i = Keywords.Length - 1; i >= 0; --i) - { - var level = (MaterialQuality) (1 << i); - if ((levels & level) != 0) - return level; - } - - return 0; - } - - /// - /// Returns the closest available quality level in a MaterialQuality bitfield. - /// - /// Available MaterialQuality bitfield. - /// Input MaterialQuality level. - /// The closest available quality level. - public static MaterialQuality GetClosestQuality(this MaterialQuality availableLevels, MaterialQuality requestedLevel) - { - // Special fallback when there are no available quality levels. Needs to match in the shader stripping code - if (availableLevels == 0) - return MaterialQuality.Low; - - // First we want to find the closest available quality level below the requested one. - int requestedLevelIndex = ToFirstIndex(requestedLevel); - MaterialQuality chosenQuality = (MaterialQuality)0; - for (int i = requestedLevelIndex; i >= 0; --i) - { - var level = FromIndex(i); - if ((level & availableLevels) != 0) - { - chosenQuality = level; - break; - } - } - - if (chosenQuality != 0) - return chosenQuality; - - // If none is found then we fallback to the closest above. - for (var i = requestedLevelIndex + 1; i < Keywords.Length; ++i) - { - var level = FromIndex(i); - var diff = Math.Abs(requestedLevel - level); - if ((level & availableLevels) != 0) - { - chosenQuality = level; - break; - } - } - - Debug.Assert(chosenQuality != 0); - return chosenQuality; - } - - /// - /// Set the global keyword for the provided MaterialQuality. - /// - /// MaterialQuality level to set the keyword for. - public static void SetGlobalShaderKeywords(this MaterialQuality level) - { - for (var i = 0; i < KeywordNames.Length; ++i) - { - if ((level & (MaterialQuality) (1 << i)) != 0) - Shader.EnableKeyword(KeywordNames[i]); - else - Shader.DisableKeyword(KeywordNames[i]); - } - } - - /// - /// Set the global keyword for the provided MaterialQuality. - /// - /// MaterialQuality level to set the keyword for. - /// Command Buffer used to setup the keyword. - public static void SetGlobalShaderKeywords(this MaterialQuality level, CommandBuffer cmd) - { - for (var i = 0; i < KeywordNames.Length; ++i) - { - if ((level & (MaterialQuality)(1 << i)) != 0) - cmd.EnableShaderKeyword(KeywordNames[i]); - else - cmd.DisableShaderKeyword(KeywordNames[i]); - } - } - - /// - /// Returns the index (in the MaterialQuality enum) of the first available level. - /// - /// MaterialQuality bitfield. - /// The index of the first available level. - public static int ToFirstIndex(this MaterialQuality level) - { - for (var i = 0; i < KeywordNames.Length; ++i) - { - if ((level & (MaterialQuality) (1 << i)) != 0) - return i; - } - - return -1; - } - - /// - /// Returns the enum equivalent of the index in the MaterialQuality enum list. - /// - /// Index of the material quality. - /// The equivalent enum. - public static MaterialQuality FromIndex(int index) => (MaterialQuality) (1 << index); - } -} - - -// TODO: Remove when breaking changes (introduced in 7.x.x) -// Namespace is invalid -// We will remove it in a future release but keep an obsolete version for compatibility. -// Instead, we should use 'UnityEngine.Rendering' namespace Utilities { - using UnityEngine; - using UnityEngine.Rendering; - /// /// Material quality flags. /// [Flags] - [Obsolete("Use UnityEngine.Rendering.MaterialQuality")] public enum MaterialQuality { /// Low Material Quality. @@ -191,7 +21,6 @@ public enum MaterialQuality /// /// Material Quality utility class. /// - [Obsolete("Use UnityEngine.Rendering.MaterialQualityUtilities")] public static class MaterialQualityUtilities { /// 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 51409175f00..bd41dd2e4e1 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -2,6 +2,7 @@ using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using System.Text; +using Utilities; using UnityEngine.Experimental.Rendering; using static UnityEngine.Rendering.HighDefinition.RenderPipelineSettings; diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs index 6901660a3c6..3a5972baca5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs @@ -1,7 +1,8 @@ using System; using UnityEngine; using UnityEngine.Rendering.HighDefinition; -using UnityEngine.Rendering; +using UnityEditor.Rendering; +using Utilities; namespace UnityEditor.Rendering.HighDefinition { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 2ec922ed688..6dad9dea362 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Utilities; using UnityEngine.Experimental.Rendering; using UnityEngine.Experimental.Rendering.RenderGraphModule; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 625add2e1eb..9abb63f19b9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -6,6 +6,7 @@ using UnityEngine.Experimental.GlobalIllumination; using UnityEngine.Experimental.Rendering; using UnityEngine.Experimental.Rendering.RenderGraphModule; +using Utilities; namespace UnityEngine.Rendering.HighDefinition { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs index de83731a0eb..d40e6bbfb3d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using UnityEngine.Serialization; +using Utilities; namespace UnityEngine.Rendering.HighDefinition { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index 774bc661c16..1bad98da64e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Reflection; using System.Linq; +using Utilities; namespace UnityEngine.Rendering.HighDefinition { From 373646ae7d2ceed2593f86409b60c49ee619546d Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Thu, 26 Mar 2020 13:23:13 +0100 Subject: [PATCH 51/84] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ae46478c18d..fa6f6d47bb7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -78,7 +78,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. - Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. - Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. -- Utilities namespace is obsolete, moved its content to UnityEngine.Rendering (case 1204677) - Hidden unsupported choice in emission in Materials ## [8.0.0] - 2020-05-25 From 67e24792406911bdc79dc7f77cc5ef51fd20157c Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Fri, 27 Mar 2020 14:20:39 +0100 Subject: [PATCH 52/84] - Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. (#6410) --- .../CHANGELOG.md | 1 + .../Raytracing/HDRaytracingRecursiveRenderer.cs | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index fa6f6d47bb7..2ab175248c7 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -67,6 +67,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed sRGB mismatch with XR SDK - Fixed XR single-pass with Mock HMD plugin - Fixed XR culling with multiple cameras +- Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs index 52eb12c4f0a..1ba075aa2e8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs @@ -139,14 +139,8 @@ void RaytracingRecursiveRender(HDCamera hdCamera, CommandBuffer cmd, ScriptableR cmd.SetGlobalFloat(HDShaderIDs._RaytracingPixelSpreadAngle, GetPixelSpreadAngle(hdCamera.camera.fieldOfView, hdCamera.actualWidth, hdCamera.actualHeight)); // LightLoop data - cmd.SetGlobalBuffer(HDShaderIDs._RaytracingLightCluster, lightCluster.GetCluster()); - cmd.SetGlobalBuffer(HDShaderIDs._LightDatasRT, lightCluster.GetLightDatas()); - cmd.SetGlobalVector(HDShaderIDs._MinClusterPos, lightCluster.GetMinClusterPos()); - cmd.SetGlobalVector(HDShaderIDs._MaxClusterPos, lightCluster.GetMaxClusterPos()); - cmd.SetGlobalInt(HDShaderIDs._LightPerCellCount, lightClusterSettings.maxNumLightsPercell.value); - cmd.SetGlobalInt(HDShaderIDs._PunctualLightCountRT, lightCluster.GetPunctualLightCount()); - cmd.SetGlobalInt(HDShaderIDs._AreaLightCountRT, lightCluster.GetAreaLightCount()); - + lightCluster.BindLightClusterData(cmd); + // Note: Just in case, we rebind the directional light data (in case they were not) cmd.SetGlobalBuffer(HDShaderIDs._DirectionalLightDatas, m_LightLoopLightData.directionalLightData); cmd.SetGlobalInt(HDShaderIDs._DirectionalLightCount, m_lightList.directionalLights.Count); From bbbc325882986f72c64d37356ac53e3825f75ac3 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Fri, 27 Mar 2020 17:09:06 +0000 Subject: [PATCH 53/84] First pass of light loop optimizations (still single threaded) (#6367) (#6424) * Saving 10% off the PrepareLightForGPU * 18% decrease in cost with this * Around 12% cost shaving off GetLightData * Around 6.5% win here * Faster View matrix flip * Missing *=-1 * About 7% win in preprocess light data * Another small batch * Small cleanup for first optimization pass * Tiny bit more cleanup * Address review points * Add comment * changelog # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md --- .../CHANGELOG.md | 1 + .../Lighting/Light/HDAdditionalLightData.cs | 7 +- .../Runtime/Lighting/LightLoop/LightLoop.cs | 70 ++++++++++++++----- 3 files changed, 60 insertions(+), 18 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index d2a4337540e..e58e090add4 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -81,6 +81,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. - Hidden unsupported choice in emission in Materials - All custom pass volumes are now executed for one injection point instead of the first one. +- Optimized PrepareLightsForGPU (cost reduced by over 25%) and PrepareGPULightData (around twice as fast now). ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index 7b894286946..b76c4ac2298 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -1440,7 +1440,10 @@ internal Light legacyLight { get { - TryGetComponent(out m_Light); + // Calling TryGetComponent only when needed is faster than letting the null check happen inside TryGetComponent + if (m_Light == null) + TryGetComponent(out m_Light); + return m_Light; } } @@ -1606,7 +1609,7 @@ internal void EvaluateShadowState(HDCamera hdCamera, in ProcessedLightData proce // When creating a new light, at the first frame, there is no AdditionalShadowData so we can't really render shadows m_WillRenderShadowMap &= shadowDimmer > 0; // If the shadow is too far away, we don't render it - m_WillRenderShadowMap &= type == HDLightType.Directional || processedLight.distanceToCamera < shadowFadeDistance; + m_WillRenderShadowMap &= processedLight.lightType == HDLightType.Directional || processedLight.distanceToCamera < shadowFadeDistance; // First we reset the ray tracing and screen space shadow data m_WillRenderScreenSpaceShadow = false; 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 29eeffc4079..e00440045ef 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 @@ -6,6 +6,14 @@ namespace UnityEngine.Rendering.HighDefinition { static class VisibleLightExtensionMethods { + public struct VisibleLightAxisAndPosition + { + public Vector3 Position; + public Vector3 Forward; + public Vector3 Up; + public Vector3 Right; + } + public static Vector3 GetPosition(this VisibleLight value) { return value.localToWorldMatrix.GetColumn(3); @@ -25,6 +33,17 @@ public static Vector3 GetRight(this VisibleLight value) { return value.localToWorldMatrix.GetColumn(0); } + + public static VisibleLightAxisAndPosition GetAxisAndPosition(this VisibleLight value) + { + var matrix = value.localToWorldMatrix; + VisibleLightAxisAndPosition output; + output.Position = matrix.GetColumn(3); + output.Forward = matrix.GetColumn(2); + output.Up = matrix.GetColumn(1); + output.Right = matrix.GetColumn(0); + return output; + } } //----------------------------------------------------------------------------- @@ -459,8 +478,15 @@ Matrix4x4 GetWorldToViewMatrix(HDCamera hdCamera, int viewIndex) { var viewMatrix = (hdCamera.xr.enabled ? hdCamera.xr.GetViewMatrix(viewIndex) : hdCamera.camera.worldToCameraMatrix); - // camera.worldToCameraMatrix is RHS and Unity's transforms are LHS, we need to flip it to work with transforms - return s_FlipMatrixLHSRHS * viewMatrix; + // camera.worldToCameraMatrix is RHS and Unity's transforms are LHS, we need to flip it to work with transforms. + // Note that this is equivalent to s_FlipMatrixLHSRHS * viewMatrix, but faster given that it doesn't need full matrix multiply + // However if for some reason s_FlipMatrixLHSRHS changes from Matrix4x4.Scale(new Vector3(1, 1, -1)), this need to change as well. + viewMatrix.m20 *= -1; + viewMatrix.m21 *= -1; + viewMatrix.m22 *= -1; + viewMatrix.m23 *= -1; + + return viewMatrix; } // Keep track of the maximum number of XR instanced views @@ -655,6 +681,9 @@ struct ScreenSpaceShadowData int m_DebugSelectedLightShadowIndex; int m_DebugSelectedLightShadowCount; + // Data needed for the PrepareGPULightdata + List m_WorldToViewMatrices = new List(ShaderConfig.s_XrMaxViews); + static MaterialPropertyBlock m_LightLoopDebugMaterialProperties = new MaterialPropertyBlock(); bool HasLightToCull() @@ -953,6 +982,13 @@ void LightLoopNewFrame(HDCamera hdCamera) } m_TextureCaches.NewFrame(); + + m_WorldToViewMatrices.Clear(); + int viewCount = hdCamera.viewCount; + for (int viewIndex = 0; viewIndex < viewCount; ++viewIndex) + { + m_WorldToViewMatrices.Add(GetWorldToViewMatrix(hdCamera, viewIndex)); + } } bool LightLoopNeedResize(HDCamera hdCamera, TileAndClusterData tileAndClusterData) @@ -1272,7 +1308,7 @@ bool EnoughScreenSpaceShadowSlots(GPULightType gpuLightType, int screenSpaceChan } internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSettings shadowSettings, VisibleLight light, Light lightComponent, - int lightIndex, int shadowIndex, ref Vector3 lightDimensions, ref int screenSpaceShadowIndex, ref int screenSpaceChannelSlot) + int lightIndex, int shadowIndex, BoolScalableSetting contactShadowsScalableSetting, ref Vector3 lightDimensions, ref int screenSpaceShadowIndex, ref int screenSpaceChannelSlot) { var processedData = m_ProcessedLightData[lightIndex]; var additionalLightData = processedData.additionalLightData; @@ -1281,11 +1317,13 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting var lightData = new LightData(); + var visibleLightAxisAndPosition = light.GetAxisAndPosition(); + lightData.lightLayers = additionalLightData.GetLightLayers(); lightData.lightType = gpuLightType; - lightData.positionRWS = light.GetPosition(); + lightData.positionRWS = visibleLightAxisAndPosition.Position; bool applyRangeAttenuation = additionalLightData.applyRangeAttenuation && (gpuLightType != GPULightType.ProjectorBox); @@ -1323,9 +1361,9 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting lightData.color = GetLightColor(light); - lightData.forward = light.GetForward(); - lightData.up = light.GetUp(); - lightData.right = light.GetRight(); + lightData.forward = visibleLightAxisAndPosition.Forward; + lightData.up = visibleLightAxisAndPosition.Up; + lightData.right = visibleLightAxisAndPosition.Right; lightDimensions.x = additionalLightData.shapeWidth; lightDimensions.y = additionalLightData.shapeHeight; @@ -1453,7 +1491,7 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting float shadowDistanceFade = HDUtils.ComputeLinearDistanceFade(processedData.distanceToCamera, Mathf.Min(shadowSettings.maxShadowDistance.value, additionalLightData.shadowFadeDistance)); lightData.shadowDimmer = shadowDistanceFade * additionalLightData.shadowDimmer; lightData.volumetricShadowDimmer = shadowDistanceFade * additionalLightData.volumetricShadowDimmer; - GetContactShadowMask(additionalLightData, HDAdditionalLightData.ScalableSettings.UseContactShadow(m_Asset), hdCamera, ref lightData.contactShadowMask, ref lightData.isRayTracedContactShadow); + GetContactShadowMask(additionalLightData, contactShadowsScalableSetting, hdCamera, ref lightData.contactShadowMask, ref lightData.isRayTracedContactShadow); // We want to have a colored penumbra if the flag is on and the color is not gray bool penumbraTint = additionalLightData.penumbraTint && ((additionalLightData.shadowTint.r != additionalLightData.shadowTint.g) || (additionalLightData.shadowTint.g != additionalLightData.shadowTint.b)); @@ -1534,10 +1572,9 @@ void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLig Vector3 positionWS = lightData.positionRWS; Vector3 positionVS = worldToView.MultiplyPoint(positionWS); - Matrix4x4 lightToView = worldToView * lightToWorld; - Vector3 xAxisVS = lightToView.GetColumn(0); - Vector3 yAxisVS = lightToView.GetColumn(1); - Vector3 zAxisVS = lightToView.GetColumn(2); + Vector3 xAxisVS = worldToView.MultiplyVector(lightToWorld.GetColumn(0)); + Vector3 yAxisVS = worldToView.MultiplyVector(lightToWorld.GetColumn(1)); + Vector3 zAxisVS = worldToView.MultiplyVector(lightToWorld.GetColumn(2)); // Fill bounds var bound = new SFiniteLightBound(); @@ -2051,7 +2088,7 @@ void PreprocessLightData(ref ProcessedLightData processedData, VisibleLight ligh processedData.additionalLightData = additionalLightData; processedData.lightType = additionalLightData.ComputeLightType(lightComponent); - processedData.distanceToCamera = (light.GetPosition() - hdCamera.camera.transform.position).magnitude; + processedData.distanceToCamera = (additionalLightData.transform.position - hdCamera.camera.transform.position).magnitude; // Evaluate the types that define the current light processedData.lightCategory = LightCategory.Count; @@ -2188,6 +2225,8 @@ void PrepareGPULightdata(CommandBuffer cmd, HDCamera hdCamera, CullingResults cu // The lightLoop is in charge, not the shadow pass. // For now we will still apply the maximum of shadow here but we don't apply the sorting by priority + slot allocation yet + BoolScalableSetting contactShadowScalableSetting = HDAdditionalLightData.ScalableSettings.UseContactShadow(m_Asset); + // 2. Go through all lights, convert them to GPU format. // Simultaneously create data for culling (LightVolumeData and SFiniteLightBound) @@ -2251,7 +2290,7 @@ void PrepareGPULightdata(CommandBuffer cmd, HDCamera hdCamera, CullingResults cu Vector3 lightDimensions = new Vector3(); // X = length or width, Y = height, Z = range (depth) // Punctual, area, projector lights - the rendering side. - GetLightData(cmd, hdCamera, hdShadowSettings, light, lightComponent, lightIndex, shadowIndex, ref lightDimensions, ref m_ScreenSpaceShadowIndex, ref m_ScreenSpaceShadowChannelSlot); + GetLightData(cmd, hdCamera, hdShadowSettings, light, lightComponent, lightIndex, shadowIndex, contactShadowScalableSetting, ref lightDimensions, ref m_ScreenSpaceShadowIndex, ref m_ScreenSpaceShadowChannelSlot); switch (lightCategory) { @@ -2269,8 +2308,7 @@ void PrepareGPULightdata(CommandBuffer cmd, HDCamera hdCamera, CullingResults cu // Then culling side. Must be call in this order as we pass the created Light data to the function for (int viewIndex = 0; viewIndex < hdCamera.viewCount; ++viewIndex) { - var worldToView = GetWorldToViewMatrix(hdCamera, viewIndex); - GetLightVolumeDataAndBound(lightCategory, gpuLightType, lightVolumeType, light, m_lightList.lights[m_lightList.lights.Count - 1], lightDimensions, worldToView, viewIndex); + GetLightVolumeDataAndBound(lightCategory, gpuLightType, lightVolumeType, light, m_lightList.lights[m_lightList.lights.Count - 1], lightDimensions, m_WorldToViewMatrices[viewIndex], viewIndex); } // We make the light position camera-relative as late as possible in order From d2c36b4a93bd0cd6a7e8fbc6e0ecc75419bf4262 Mon Sep 17 00:00:00 2001 From: vlad-andreev Date: Fri, 27 Mar 2020 14:37:47 +0100 Subject: [PATCH 54/84] Catch and handle NRefactory parser exceptions (#6392) Co-authored-by: vlad-andreev --- .../Editor/ShaderGenerator/CSharpToHLSL.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.core/Editor/ShaderGenerator/CSharpToHLSL.cs b/com.unity.render-pipelines.core/Editor/ShaderGenerator/CSharpToHLSL.cs index 5585be5d2b7..76391051c57 100644 --- a/com.unity.render-pipelines.core/Editor/ShaderGenerator/CSharpToHLSL.cs +++ b/com.unity.render-pipelines.core/Editor/ShaderGenerator/CSharpToHLSL.cs @@ -201,7 +201,16 @@ static void LoadTypes(string fileName) }*/ parser.Lexer.EvaluateConditionalCompilation = true; - parser.Parse(); + try + { + parser.Parse(); + } + catch + { + Debug.LogWarning($"Unable to parse {fileName}. Please not that C# 6.0 syntax is not yet supported by this tool."); + return; + } + try { var visitor = new NamespaceVisitor(); From 926dd5031fd25532492701af8262bcbdd95bb9b5 Mon Sep 17 00:00:00 2001 From: ChristianF-ARM <45175346+ChristianF-ARM@users.noreply.github.com> Date: Fri, 27 Mar 2020 12:19:45 +0100 Subject: [PATCH 55/84] Avoid negative input to sqrt() (#6397) - The calculation of `k` is not numerically robust when done in FP16 and might generate a negative value. - This can be observed as rendering artifacts on Mali drivers newer than Bifrost/Valhall R21. - This commit fixes this by by clamping `k` to [0, inf] before the `sqrt()`. - On Mali-G77 the clamp compiles down to a free output modifier on the previous instruction, so there's no performance impact. --- com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl index 690ff71ce13..f37502a6485 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl @@ -316,6 +316,7 @@ half rgb_2_yc(half3 rgb) half g = rgb.y; half b = rgb.z; half k = b * (b - g) + g * (g - r) + r * (r - b); + k = max(k, 0.0h); // Clamp to avoid precision issue causing k < 0, making sqrt(k) undefined #if defined(SHADER_API_SWITCH) half chroma = k == 0.0 ? 0.0 : sqrt(k); // Fix NaN on Nintendo Switch (should not happen in theory). #else From 9c1cddc4e1d7fbff5ab98c0c5c664ad9bacd2d99 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 27 Mar 2020 14:34:28 +0100 Subject: [PATCH 56/84] Refreshed the GUIDs for additional post processing data to avoid conflicts with PPv2 (#6394) --- .../Samples~/PostProcessingData/Lens Dirt.meta | 2 +- .../Samples~/PostProcessingData/Lens Dirt/LensDirt00.png.meta | 2 +- .../Samples~/PostProcessingData/Lens Dirt/LensDirt01.png.meta | 2 +- .../Samples~/PostProcessingData/Lens Dirt/LensDirt02.png.meta | 2 +- .../Samples~/PostProcessingData/Lens Dirt/LensDirt03.png.meta | 2 +- .../Samples~/PostProcessingData/Spectral LUTs.meta | 2 +- .../Spectral LUTs/SpectralLut_BlueRed.tga.meta | 2 +- .../Spectral LUTs/SpectralLut_GreenPurple.tga.meta | 2 +- .../Spectral LUTs/SpectralLut_PurpleGreen.tga.meta | 2 +- .../Spectral LUTs/SpectralLut_RedBlue.tga.meta | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt.meta index ab581c0e915..c894f68e3b7 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3467abbb714a12d4eb9e485eb6fc53fa +guid: 0c4052e2153589e42ba972a554e51b7f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt00.png.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt00.png.meta index 566c6551586..20a0b99d453 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt00.png.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt00.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 69e847bbff1cf5449a4ee0bbd045dbc9 +guid: 203b35c8eaa5f684c9d722891603d7cf TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt01.png.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt01.png.meta index 980dac3e854..c52ba616ebd 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt01.png.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt01.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3884f7a2d04ffe8409ad9200b275896f +guid: 4141aff1704350e42ac905767c717a85 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt02.png.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt02.png.meta index f90b1aa0604..b8901b945ca 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt02.png.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt02.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a2960ffde020f27409e070d92fb2e00b +guid: a82dab21d60c1df48b373e91bb1ef34b TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt03.png.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt03.png.meta index 127e22d485c..1c1d8c5d568 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt03.png.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Lens Dirt/LensDirt03.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7a051dbda2d7bc447bee412427cd311e +guid: db50366cdf0244c42acc950d5344a6ac TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs.meta index 6c9ec3cf7b8..f09486ab04c 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7dafb24e940e28540929b9bf2845daf6 +guid: 5e37df1a51347ec4bbfb30c02056b38a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_BlueRed.tga.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_BlueRed.tga.meta index f47c5b8dbd2..a856b3c5ec5 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_BlueRed.tga.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_BlueRed.tga.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 318cbcd94840f1d48aca4d86234dc2e7 +guid: 3f69bf5e1dbbde7468101fe9973c55f1 timeCreated: 1473255656 licenseType: Pro TextureImporter: diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_GreenPurple.tga.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_GreenPurple.tga.meta index 1bec2a91274..8995e8c4b34 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_GreenPurple.tga.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_GreenPurple.tga.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4a8f054acfbd08043a931cd22760758d +guid: f78fe2b7554b0db4da35740fdec502fb timeCreated: 1473255985 licenseType: Pro TextureImporter: diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_PurpleGreen.tga.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_PurpleGreen.tga.meta index 1077fda0943..9e07d2078d5 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_PurpleGreen.tga.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_PurpleGreen.tga.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 42183971d24cfe443a346e7ec6e83bbb +guid: bdb5cf94f679c1048ab24e3b1b9c97f8 timeCreated: 1473256088 licenseType: Pro TextureImporter: diff --git a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_RedBlue.tga.meta b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_RedBlue.tga.meta index fbe39ef6a60..3e0c885fe4a 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_RedBlue.tga.meta +++ b/com.unity.render-pipelines.high-definition/Samples~/PostProcessingData/Spectral LUTs/SpectralLut_RedBlue.tga.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ff5f3317371838d4fa16ac6c2acf2040 +guid: 83f20033bbfa9364a896ce61abed992c timeCreated: 1473255656 licenseType: Pro TextureImporter: From 6317ca36f77430d43c5bd5fa2db6df51c74cd6c9 Mon Sep 17 00:00:00 2001 From: JordanL8 Date: Mon, 30 Mar 2020 16:07:53 +0100 Subject: [PATCH 57/84] Added known issues page (#6447) --- .../Documentation~/Known-Issues.md | 15 +++++++++++++++ .../Documentation~/TableOfContents.md | 1 + 2 files changed, 16 insertions(+) create mode 100644 com.unity.render-pipelines.high-definition/Documentation~/Known-Issues.md diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Known-Issues.md b/com.unity.render-pipelines.high-definition/Documentation~/Known-Issues.md new file mode 100644 index 00000000000..de23133f805 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Documentation~/Known-Issues.md @@ -0,0 +1,15 @@ +# Known issues + +This page contains information on known about issues you may encounter while using HDRP. Each entry describes the issue and then details the steps to follow in order to resolve the issue. + +## Material array size + +If you upgrade your HDRP Project to a later version, you may encounter an error message similar to: + +``` +Property (_Env2DCaptureForward) exceeds previous array size (48 vs 6). Cap to previous size. + +UnityEditor.EditorApplication:Internal_CallGlobalEventHandler() +``` + +To fix this issue, restart the Unity editor. \ No newline at end of file diff --git a/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md b/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md index 198327288c4..ef71b2f9e67 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md @@ -155,3 +155,4 @@ * [Creating a Custom Post-Process Effect](Custom-Post-Process) * [Creating a Custom Render Pass](Custom-Pass) * [HDRP Glossary](Glossary) +* [Known Issues and How To Fix Them](Known-Issues) From 21f86dbd7b0873fdefaa4bcddac463cf4be9cc09 Mon Sep 17 00:00:00 2001 From: Tim Cannell Date: Sat, 28 Mar 2020 11:20:11 +0000 Subject: [PATCH 58/84] Platform/playstation #6380 --- .../StencilShowShader.shader | 2 +- .../StencilWriteShader.shader | 2 +- .../4060_CustomPostProcess/BluePP.shader | 2 +- .../4060_CustomPostProcess/GreenPP.shader | 2 +- .../4060_CustomPostProcess/RedPP.shader | 2 +- .../BeforeOpaqueDepthAndNormal.shader | 2 +- .../Outline/Outline.shader | 2 +- .../Renderers_Test.shader | 2 +- .../Resources/ProceduralSky.shader | 2 +- .../Runtime/Resources/ProceduralSky.shader | 2 +- .../Documentation~/Creating-a-Custom-Sky.md | 2 +- .../Documentation~/Custom-Pass.md | 2 +- .../Documentation~/Custom-Post-Process.md | 2 +- .../Decal/ShaderGraph/DecalPass.template | 2 +- .../DrawDiffusionProfile.shader | 2 +- .../DrawTransmittanceGraph.shader | 2 +- .../Material/Eye/ShaderGraph/EyePass.template | 2 +- .../Hair/ShaderGraph/HairPass.template | 2 +- .../PBR/ShaderGraph/HDPBRPass.template | 2 +- .../ShaderGraph/StackLitPass.template | 2 +- .../Unlit/ShaderGraph/UnlitPass.template | 2 +- .../CustomPostProcessingShader.template | 2 +- .../CustomPassFullScreenShader.template | 2 +- .../CustomPassRenderersShader.template | 2 +- .../Shaders/GUITextureBlit2SRGB.shader | 2 +- .../ShaderGraph/HDSubShaderUtilities.cs | 8 +++---- .../Core/CoreResources/EncodeBC6H.compute | 2 +- .../Core/CoreResources/GPUCopy.compute | 2 +- .../Runtime/Debug/DebugBlitQuad.shader | 2 +- .../Runtime/Debug/DebugColorPicker.shader | 2 +- .../Runtime/Debug/DebugDisplayLatlong.shader | 2 +- .../Runtime/Debug/DebugFullScreen.shader | 2 +- .../Debug/DebugViewMaterialGBuffer.shader | 2 +- .../Runtime/Debug/DebugViewTiles.shader | 2 +- .../OpaqueAtmosphericScattering.shader | 2 +- .../Runtime/Lighting/Deferred.shader | 2 +- .../Lighting/LightLoop/Deferred.compute | 2 +- .../Lighting/LightLoop/DeferredTile.shader | 4 ++-- .../LightLoop/builddispatchindirect.compute | 2 +- .../LightLoop/cleardispatchindirect.compute | 2 +- .../LightLoop/lightlistbuild-bigtile.compute | 2 +- .../lightlistbuild-clustered.compute | 2 +- .../Lighting/LightLoop/lightlistbuild.compute | 2 +- .../Lighting/LightLoop/materialflags.compute | 2 +- .../Lighting/LightLoop/scrbound.compute | 2 +- .../ScreenSpaceReflections.compute | 2 +- .../Lighting/Shadow/ContactShadows.compute | 2 +- .../Shadow/DebugDisplayHDShadowMap.shader | 2 +- .../Runtime/Lighting/Shadow/EVSMBlur.compute | 2 +- .../Lighting/Shadow/ScreenSpaceShadows.shader | 2 +- .../Lighting/Shadow/ShadowClear.shader | 2 +- .../VolumeVoxelization.compute | 2 +- .../VolumetricLighting.compute | 2 +- .../Runtime/Material/AxF/AxF.shader | 2 +- .../AxF/PreIntegratedFGD_CookTorrance.shader | 2 +- .../Material/AxF/PreIntegratedFGD_Ward.shader | 2 +- .../Decal/ClearPropertyMaskBuffer.compute | 2 +- .../Runtime/Material/Decal/Decal.shader | 2 +- .../Material/Decal/DecalNormalBuffer.shader | 2 +- .../Material/Fabric/CharlieConvolve.shader | 2 +- .../BuildProbabilityTables.compute | 2 +- .../ComputeGgxIblSampleData.compute | 2 +- .../GGXConvolution/GGXConvolve.shader | 2 +- .../FilterAreaLightCookies.shader | 2 +- .../Material/LayeredLit/LayeredLit.shader | 2 +- .../LayeredLit/LayeredLitTessellation.shader | 2 +- .../Runtime/Material/Lit/Lit.shader | 22 +++++++++---------- .../Material/Lit/LitTessellation.shader | 2 +- ...eIntegratedFGD_CharlieFabricLambert.shader | 2 +- .../preIntegratedFGD_GGXDisneyDiffuse.shader | 2 +- .../CombineLighting.shader | 2 +- .../SubsurfaceScattering.compute | 2 +- .../Material/TerrainLit/TerrainLit.shader | 2 +- .../TerrainLit/TerrainLit_Basemap.shader | 2 +- .../TerrainLit/TerrainLit_BasemapGen.shader | 2 +- .../Runtime/Material/Unlit/Unlit.shader | 14 ++++++------ .../Shaders/ApplyExposure.compute | 2 +- .../PostProcessing/Shaders/BloomBlur.compute | 2 +- .../Shaders/BloomPrefilter.compute | 2 +- .../Shaders/BloomUpsample.compute | 2 +- .../PostProcessing/Shaders/ClearBlack.shader | 2 +- .../Shaders/DepthOfFieldCoC.compute | 2 +- .../Shaders/DepthOfFieldCoCDilate.compute | 2 +- .../Shaders/DepthOfFieldCoCReproject.compute | 2 +- .../Shaders/DepthOfFieldCombine.compute | 2 +- .../Shaders/DepthOfFieldGather.compute | 2 +- .../Shaders/DepthOfFieldKernel.compute | 2 +- .../Shaders/DepthOfFieldMip.compute | 2 +- .../Shaders/DepthOfFieldMipSafe.compute | 2 +- .../Shaders/DepthOfFieldPrefilter.compute | 2 +- .../Shaders/DepthOfFieldTileMax.compute | 2 +- .../PostProcessing/Shaders/Exposure.compute | 2 +- .../PostProcessing/Shaders/FinalPass.shader | 2 +- .../Shaders/LutBuilder3D.compute | 2 +- .../Shaders/MotionBlurMotionVecPrep.compute | 2 +- .../Shaders/MotionBlurTilePass.compute | 2 +- .../Shaders/PaniniProjection.compute | 2 +- .../SubpixelMorphologicalAntialiasing.shader | 2 +- .../Shaders/TemporalAntiAliasing.shader | 2 +- .../PostProcessing/Shaders/UberPost.compute | 2 +- .../RenderPass/ColorPyramid.compute | 2 +- .../RenderPass/ColorPyramidPS.shader | 4 ++-- .../RenderPass/DepthPyramid.compute | 2 +- .../Distortion/ApplyDistortion.shader | 2 +- .../MSAA/AmbientOcclusionResolve.shader | 2 +- .../RenderPass/MSAA/ColorResolve.shader | 2 +- .../RenderPass/MSAA/DepthValues.shader | 2 +- .../Runtime/ShaderLibrary/Blit.shader | 2 +- .../ShaderLibrary/ClearStencilBuffer.shader | 2 +- .../ShaderLibrary/CopyDepthBuffer.shader | 2 +- .../ShaderLibrary/CopyStencilBuffer.shader | 2 +- .../ShaderLibrary/DownsampleDepth.shader | 2 +- .../ResolveStencilBuffer.compute | 2 +- .../ShaderLibrary/UpsampleTransparent.shader | 2 +- .../Runtime/ShaderLibrary/XRMirrorView.shader | 2 +- .../ShaderLibrary/XROcclusionMesh.shader | 2 +- .../Sky/AmbientProbeConvolution.compute | 2 +- .../Sky/GradientSky/GradientSky.shader | 2 +- .../Runtime/Sky/HDRISky/HDRISky.shader | 2 +- .../Sky/HDRISky/IntegrateHDRISky.shader | 2 +- .../GroundIrradiancePrecomputation.compute | 2 +- .../InScatteredRadiancePrecomputation.compute | 2 +- .../PhysicallyBasedSky.shader | 2 +- .../Resources/ProceduralSky.shader | 2 +- 124 files changed, 145 insertions(+), 145 deletions(-) diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilShowShader.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilShowShader.shader index bdc4f53b77a..4fddac06f1a 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilShowShader.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilShowShader.shader @@ -75,7 +75,7 @@ Shader "Custom/StencilShowShader" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //------------------------------------------------------------------------------------- // Variant diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilWriteShader.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilWriteShader.shader index 4083208bec2..d6eb76b74a3 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilWriteShader.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2208_And_2209_Reflection_Stencil/StencilWriteShader.shader @@ -75,7 +75,7 @@ Shader "Custom/StencilWriteShader" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //------------------------------------------------------------------------------------- // Variant diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/BluePP.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/BluePP.shader index 7ce665f3cf2..9d2b3557a88 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/BluePP.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/BluePP.shader @@ -3,7 +3,7 @@ HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/GreenPP.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/GreenPP.shader index 01e73a29bdc..81a56b25492 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/GreenPP.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/GreenPP.shader @@ -3,7 +3,7 @@ HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/RedPP.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/RedPP.shader index 94350494a62..73c98cdc85c 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/RedPP.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4060_CustomPostProcess/RedPP.shader @@ -3,7 +3,7 @@ HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader index f96aaea6f0b..a6ddd102650 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader @@ -5,7 +5,7 @@ #pragma vertex Vert #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.shader index 40f0717e26e..6a1b0ad56a1 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/Outline/Outline.shader @@ -5,7 +5,7 @@ #pragma vertex Vert #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers/Renderers_Test.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers/Renderers_Test.shader index cc344f0c30e..c24fa418b7e 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers/Renderers_Test.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9701_CustomPass_DrawRenderers/Renderers_Test.shader @@ -12,7 +12,7 @@ HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch // #pragma enable_d3d11_debug_symbols diff --git a/TestProjects/HDRP_Tests/Assets/Samples/High Definition RP/Procedural Sky/Runtime/ProceduralSky/Resources/ProceduralSky.shader b/TestProjects/HDRP_Tests/Assets/Samples/High Definition RP/Procedural Sky/Runtime/ProceduralSky/Resources/ProceduralSky.shader index 4e4580889cf..ea8c3f766fb 100644 --- a/TestProjects/HDRP_Tests/Assets/Samples/High Definition RP/Procedural Sky/Runtime/ProceduralSky/Resources/ProceduralSky.shader +++ b/TestProjects/HDRP_Tests/Assets/Samples/High Definition RP/Procedural Sky/Runtime/ProceduralSky/Resources/ProceduralSky.shader @@ -11,7 +11,7 @@ Shader "Hidden/HDRP/Sky/ProceduralSky" #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile _ _ENABLE_SUN_DISK diff --git a/TestProjects/VisualEffectGraph/Assets/Samples/High Definition RP/Procedural Sky/Runtime/Resources/ProceduralSky.shader b/TestProjects/VisualEffectGraph/Assets/Samples/High Definition RP/Procedural Sky/Runtime/Resources/ProceduralSky.shader index 4e4580889cf..ea8c3f766fb 100644 --- a/TestProjects/VisualEffectGraph/Assets/Samples/High Definition RP/Procedural Sky/Runtime/Resources/ProceduralSky.shader +++ b/TestProjects/VisualEffectGraph/Assets/Samples/High Definition RP/Procedural Sky/Runtime/Resources/ProceduralSky.shader @@ -11,7 +11,7 @@ Shader "Hidden/HDRP/Sky/ProceduralSky" #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile _ _ENABLE_SUN_DISK diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Creating-a-Custom-Sky.md b/com.unity.render-pipelines.high-definition/Documentation~/Creating-a-Custom-Sky.md index 35ed85d4180..a165bdddd69 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Creating-a-Custom-Sky.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Creating-a-Custom-Sky.md @@ -175,7 +175,7 @@ Shader "Hidden/HDRP/Sky/NewSky" #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md index 7201fa685cd..2e8d98ed523 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass.md @@ -465,7 +465,7 @@ Shader "Hidden/Outline" #pragma vertex Vert #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md index 034e97190f7..35148a1abb8 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md @@ -123,7 +123,7 @@ Shader "Hidden/Shader/GrayScale" #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template index b50790b66d5..83f59b5fb8a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template @@ -21,7 +21,7 @@ Pass HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#pragma enable_d3d11_debug_symbols #pragma multi_compile_instancing diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawDiffusionProfile.shader b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawDiffusionProfile.shader index 3b1a0cce06e..55fb717aa4c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawDiffusionProfile.shader +++ b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawDiffusionProfile.shader @@ -13,7 +13,7 @@ Shader "Hidden/HDRP/DrawDiffusionProfile" HLSLPROGRAM #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawTransmittanceGraph.shader b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawTransmittanceGraph.shader index d7001e31df2..79d6c477748 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawTransmittanceGraph.shader +++ b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DrawTransmittanceGraph.shader @@ -13,7 +13,7 @@ Shader "Hidden/HDRP/DrawTransmittanceGraph" HLSLPROGRAM #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template index 488c0cdbc4c..c52e62795e3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template @@ -21,7 +21,7 @@ Pass HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#pragma enable_d3d11_debug_symbols $splice(InstancingOptions) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template index d74a36907cd..9e9157bf35a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPass.template @@ -21,7 +21,7 @@ Pass HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#pragma enable_d3d11_debug_symbols $splice(InstancingOptions) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template index a2f37b143d8..45dfc823d19 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/PBR/ShaderGraph/HDPBRPass.template @@ -21,7 +21,7 @@ Pass HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#pragma enable_d3d11_debug_symbols $splice(InstancingOptions) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template index a22141de1c3..6b90ff304c6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitPass.template @@ -21,7 +21,7 @@ Pass HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#pragma enable_d3d11_debug_symbols $splice(InstancingOptions) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/UnlitPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/UnlitPass.template index fe56ba36d04..ff2dff20f11 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/UnlitPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/UnlitPass.template @@ -20,7 +20,7 @@ Pass HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#pragma enable_d3d11_debug_symbols //enable GPU instancing support diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/Templates/CustomPostProcessingShader.template b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/Templates/CustomPostProcessingShader.template index 07932889a5c..89995ffd034 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/Templates/CustomPostProcessingShader.template +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/Templates/CustomPostProcessingShader.template @@ -3,7 +3,7 @@ Shader "Hidden/Shader/#SCRIPTNAME#" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassFullScreenShader.template b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassFullScreenShader.template index 0e0fab3e791..0947ce622b6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassFullScreenShader.template +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassFullScreenShader.template @@ -5,7 +5,7 @@ Shader "FullScreen/#SCRIPTNAME#" #pragma vertex Vert #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassRenderersShader.template b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassRenderersShader.template index c05a7f05cc1..db7b9322e1e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassRenderersShader.template +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassRenderersShader.template @@ -12,7 +12,7 @@ Shader "Renderers/#SCRIPTNAME#" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch // #pragma enable_d3d11_debug_symbols diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/Shaders/GUITextureBlit2SRGB.shader b/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/Shaders/GUITextureBlit2SRGB.shader index d04fab88f68..ce8205d7e19 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/Shaders/GUITextureBlit2SRGB.shader +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipelineResources/Shaders/GUITextureBlit2SRGB.shader @@ -14,7 +14,7 @@ Shader "Hidden/GUITextureBlit2SRGB" { HLSLPROGRAM #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex vert #pragma fragment frag diff --git a/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDSubShaderUtilities.cs b/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDSubShaderUtilities.cs index fdfa25604b6..ab7f831c542 100644 --- a/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDSubShaderUtilities.cs +++ b/com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDSubShaderUtilities.cs @@ -1030,7 +1030,7 @@ public static void BuildRenderStatesFromPass( // Comment set of define for Forward Opaque pass in HDRP public static List s_ExtraDefinesForwardOpaque = new List() { - "#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch", + "#pragma only_renderers d3d11 playstation xboxone vulkan metal switch", "#pragma multi_compile _ DEBUG_DISPLAY", "#pragma multi_compile _ LIGHTMAP_ON", "#pragma multi_compile _ DIRLIGHTMAP_COMBINED", @@ -1043,7 +1043,7 @@ public static void BuildRenderStatesFromPass( public static List s_ExtraDefinesForwardTransparent = new List() { - "#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch", + "#pragma only_renderers d3d11 playstation xboxone vulkan metal switch", "#pragma multi_compile _ DEBUG_DISPLAY", "#pragma multi_compile _ LIGHTMAP_ON", "#pragma multi_compile _ DIRLIGHTMAP_COMBINED", @@ -1057,7 +1057,7 @@ public static void BuildRenderStatesFromPass( public static List s_ExtraDefinesForwardMaterialDepthOrMotion = new List() { - "#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch", + "#pragma only_renderers d3d11 playstation xboxone vulkan metal switch", "#define WRITE_NORMAL_BUFFER", "#pragma multi_compile _ WRITE_MSAA_DEPTH", HDLitSubShader.DefineRaytracingKeyword(RayTracingNode.RaytracingVariant.High) @@ -1065,7 +1065,7 @@ public static void BuildRenderStatesFromPass( public static List s_ExtraDefinesDepthOrMotion = new List() { - "#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch", + "#pragma only_renderers d3d11 playstation xboxone vulkan metal switch", "#pragma multi_compile _ WRITE_NORMAL_BUFFER", "#pragma multi_compile _ WRITE_MSAA_DEPTH", HDLitSubShader.DefineRaytracingKeyword(RayTracingNode.RaytracingVariant.High) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/EncodeBC6H.compute b/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/EncodeBC6H.compute index f6f2fd5960d..2f237707c8e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/EncodeBC6H.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/EncodeBC6H.compute @@ -2,7 +2,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/BC6H.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch TextureCube _Source; RWTexture2DArray _Target; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/GPUCopy.compute b/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/GPUCopy.compute index e6b2b342afe..2e9ada88b0c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/GPUCopy.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Core/CoreResources/GPUCopy.compute @@ -1,5 +1,5 @@ -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugBlitQuad.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugBlitQuad.shader index 4b94f0429a2..8ce7397e744 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugBlitQuad.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugBlitQuad.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/DebugBlitQuad" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugColorPicker.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugColorPicker.shader index 076a5c7f6ab..3b9362f22d0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugColorPicker.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugColorPicker.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/DebugColorPicker" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplayLatlong.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplayLatlong.shader index b72f5797b1c..6f46213e50f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplayLatlong.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplayLatlong.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/DebugDisplayLatlong" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader index f5bfaf2b24b..25df25c66a6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/DebugFullScreen" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewMaterialGBuffer.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewMaterialGBuffer.shader index cdfb24af2a7..88922d713ca 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewMaterialGBuffer.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewMaterialGBuffer.shader @@ -10,7 +10,7 @@ Shader "Hidden/HDRP/DebugViewMaterialGBuffer" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewTiles.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewTiles.shader index ef4b709dd3b..8e4e0262504 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewTiles.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugViewTiles.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/DebugViewTiles" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader index f8a787015e7..eb004e6f66f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader @@ -3,7 +3,7 @@ Shader "Hidden/HDRP/OpaqueAtmosphericScattering" HLSLINCLUDE #pragma target 4.5 #pragma editor_sync_compilation - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile _ DEBUG_DISPLAY diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Deferred.shader b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Deferred.shader index ec2a8c70d64..abe02eecc79 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Deferred.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Deferred.shader @@ -27,7 +27,7 @@ Shader "Hidden/HDRP/Deferred" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute index 3ce1088838d..8093814e7d7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/Deferred.compute @@ -114,7 +114,7 @@ CBUFFER_END #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStencilUsage.cs.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch //------------------------------------------------------------------------------------- // variable declaration diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/DeferredTile.shader b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/DeferredTile.shader index 5da59a25c6d..bc68896e4f4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/DeferredTile.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/DeferredTile.shader @@ -31,7 +31,7 @@ Shader "Hidden/HDRP/DeferredTile" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag @@ -293,7 +293,7 @@ Shader "Hidden/HDRP/DeferredTile" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute index ccd19ddc6a8..47bcfe684a3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/builddispatchindirect.compute @@ -1,6 +1,6 @@ #pragma kernel BuildDispatchIndirect BUILDINDIRECT=BuildDispatchIndirect IS_DRAWPROCEDURALINDIRECT=0 #pragma kernel BuildDrawProceduralIndirect BUILDINDIRECT=BuildDrawProceduralIndirect IS_DRAWPROCEDURALINDIRECT=1 -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute index bab8796f4e1..da9fe1e5db9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/cleardispatchindirect.compute @@ -1,6 +1,6 @@ #pragma kernel ClearDispatchIndirect #pragma kernel ClearDrawProceduralIndirect -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch RWBuffer g_DispatchIndirectBuffer : register( u0 ); // Indirect arguments have to be in a _buffer_, not a structured buffer diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute index f76aeab1863..cb5ece481ee 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-bigtile.compute @@ -7,7 +7,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightingConvexHullUtils.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/SortingComputeUtils.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightCullUtils.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define EXACT_EDGE_TESTS #define PERFORM_SPHERICAL_INTERSECTION_TESTS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute index efde294863a..316a47e0568 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild-clustered.compute @@ -26,7 +26,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/SortingComputeUtils.hlsl" #endif -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#define EXACT_EDGE_TESTS #define PERFORM_SPHERICAL_INTERSECTION_TESTS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute index 1b40aba6ded..cc0f35e5e18 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute @@ -26,7 +26,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/SortingComputeUtils.hlsl" #endif -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define FINE_PRUNING_ENABLED #define PERFORM_SPHERICAL_INTERSECTION_TESTS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute index 6b67169033d..1e6d0a2467b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/materialflags.compute @@ -13,7 +13,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define USE_MATERIAL_FEATURE_FLAGS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute index 6172d031181..2681070522f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/scrbound.compute @@ -10,7 +10,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightCullUtils.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch uniform int g_isOrthographic; uniform int g_iNrVisibLights; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute index b5e1b7f4d39..1da1c537015 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------------------------------- // #pragma enable_d3d11_debug_symbols -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel ScreenSpaceReflectionsTracing SSR_TRACE #pragma kernel ScreenSpaceReflectionsReprojection SSR_REPROJECT diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.compute index db865b23bd0..49960dd6b30 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.compute @@ -19,7 +19,7 @@ // More info on scalarization: https://flashypixels.wordpress.com/2018/11/10/intro-to-gpu-scalarization-part-2-scalarize-all-the-lights/ #define SCALARIZE_LIGHT_LOOP (defined(PLATFORM_SUPPORTS_WAVE_INTRINSICS) && !defined(LIGHTLOOP_DISABLE_TILE_AND_CLUSTER) && SHADERPASS == SHADERPASS_FORWARD) -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch // #pragma enable_d3d11_debug_symbols diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/DebugDisplayHDShadowMap.shader b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/DebugDisplayHDShadowMap.shader index 645704be139..84cdcae64b0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/DebugDisplayHDShadowMap.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/DebugDisplayHDShadowMap.shader @@ -2,7 +2,7 @@ Shader "Hidden/ScriptableRenderPipeline/DebugDisplayHDShadowMap" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/EVSMBlur.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/EVSMBlur.compute index adf892b8a4d..9de3847588e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/EVSMBlur.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/EVSMBlur.compute @@ -10,7 +10,7 @@ #pragma kernel CopyMoments -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch Texture2D _DepthTexture; RW_TEXTURE2D(float2, _InputTexture); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadows.shader b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadows.shader index 86e607c8a37..6857146ac21 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadows.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadows.shader @@ -5,7 +5,7 @@ Shader "Hidden/HDRP/ScreenSpaceShadows" #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowClear.shader b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowClear.shader index 9e8694e2641..72b80a6d10b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowClear.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ShadowClear.shader @@ -2,7 +2,7 @@ Shader "Hidden/ScriptableRenderPipeline/ShadowClear" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" ENDHLSL diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumeVoxelization.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumeVoxelization.compute index cdc875aa477..31b5211dcd0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumeVoxelization.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumeVoxelization.compute @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------------------------------- // #pragma enable_d3d11_debug_symbols -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel VolumeVoxelizationBruteforceMQ VolumeVoxelization=VolumeVoxelizationBruteforceMQ LIGHTLOOP_DISABLE_TILE_AND_CLUSTER VL_PRESET_MQ #pragma kernel VolumeVoxelizationTiledMQ VolumeVoxelization=VolumeVoxelizationTiledMQ VL_PRESET_MQ diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute index 287ed65d0e1..12e077504ca 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------------------------------- // #pragma enable_d3d11_debug_symbols -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel VolumetricLightingBruteforceMQ VolumetricLighting=VolumetricLightingBruteforceMQ LIGHTLOOP_DISABLE_TILE_AND_CLUSTER ENABLE_REPROJECTION=0 ENABLE_ANISOTROPY=0 VL_PRESET_MQ #pragma kernel VolumetricLightingTiledMQ VolumetricLighting=VolumetricLightingTiledMQ ENABLE_REPROJECTION=0 ENABLE_ANISOTROPY=0 VL_PRESET_MQ diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader index 65450fb74c7..802760a38b9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader @@ -122,7 +122,7 @@ Shader "HDRP/AxF" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //------------------------------------------------------------------------------------- // Variant diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_CookTorrance.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_CookTorrance.shader index 7dd9d0637d1..5dddd6a2842 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_CookTorrance.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_CookTorrance.shader @@ -14,7 +14,7 @@ Shader "Hidden/HDRP/PreIntegratedFGD_CookTorrance" #pragma vertex Vert #pragma fragment Frag #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define PREFER_HALF 0 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_Ward.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_Ward.shader index 71a688699fa..6fb76794379 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_Ward.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/PreIntegratedFGD_Ward.shader @@ -14,7 +14,7 @@ Shader "Hidden/HDRP/PreIntegratedFGD_Ward" #pragma vertex Vert #pragma fragment Frag #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define PREFER_HALF 0 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ClearPropertyMaskBuffer.compute b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ClearPropertyMaskBuffer.compute index 8fcdee00a6a..123c78c621b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ClearPropertyMaskBuffer.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ClearPropertyMaskBuffer.compute @@ -1,4 +1,4 @@ -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.shader index 97b81999057..7283396036d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.shader @@ -47,7 +47,7 @@ Shader "HDRP/Decal" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //#pragma enable_d3d11_debug_symbols //------------------------------------------------------------------------------------- diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalNormalBuffer.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalNormalBuffer.shader index 80d4f7d1895..5095638e184 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalNormalBuffer.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalNormalBuffer.shader @@ -11,7 +11,7 @@ Shader "Hidden/HDRP/Material/Decal/DecalNormalBuffer" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/CharlieConvolve.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/CharlieConvolve.shader index b8169c8ec66..d50d357565e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/CharlieConvolve.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/CharlieConvolve.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/CharlieConvolve" HLSLPROGRAM #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/BuildProbabilityTables.compute b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/BuildProbabilityTables.compute index 82d9522cde7..489c6a09460 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/BuildProbabilityTables.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/BuildProbabilityTables.compute @@ -8,7 +8,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch /* --- Input --- */ diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute index 35ee3556f23..de02fb64dcf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/ComputeGgxIblSampleData.compute @@ -3,7 +3,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #if defined(SHADER_API_MOBILE) || defined(SHADER_API_SWITCH) #define MAX_IBL_SAMPLE_CNT 34 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/GGXConvolve.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/GGXConvolve.shader index 585da0d6596..b549c305f12 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/GGXConvolve.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/GGXConvolve.shader @@ -13,7 +13,7 @@ Shader "Hidden/HDRP/GGXConvolve" HLSLPROGRAM #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile _ USE_MIS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LTCAreaLight/FilterAreaLightCookies.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/LTCAreaLight/FilterAreaLightCookies.shader index 6d17c387288..0e31addebf2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LTCAreaLight/FilterAreaLightCookies.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LTCAreaLight/FilterAreaLightCookies.shader @@ -2,7 +2,7 @@ Shader "CoreResources/FilterAreaLightCookies" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment frag diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader index ccb09e0ed70..48fb5ccf9de 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader @@ -369,7 +369,7 @@ Shader "HDRP/LayeredLit" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma shader_feature_local _ALPHATEST_ON #pragma shader_feature_local _DEPTHOFFSET_ON diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader index f3e4426c363..f78c798f205 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader @@ -379,7 +379,7 @@ Shader "HDRP/LayeredLitTessellation" HLSLINCLUDE #pragma target 5.0 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma shader_feature_local _ALPHATEST_ON #pragma shader_feature_local _DEPTHOFFSET_ON diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader index 2b887d2a9dc..4a2b5895c0c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader @@ -348,7 +348,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing #pragma instancing_options renderinglayer @@ -391,7 +391,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -440,7 +440,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -478,7 +478,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -517,7 +517,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -567,7 +567,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -614,7 +614,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -644,7 +644,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -678,7 +678,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -750,7 +750,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -816,7 +816,7 @@ Shader "HDRP/Lit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader index 7edd5db7c6b..5b2724df1d2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader @@ -236,7 +236,7 @@ Shader "HDRP/LitTessellation" HLSLINCLUDE #pragma target 5.0 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //------------------------------------------------------------------------------------- // Variant diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_CharlieFabricLambert.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_CharlieFabricLambert.shader index 2a1acb2cd3f..63d30fcba97 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_CharlieFabricLambert.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_CharlieFabricLambert.shader @@ -14,7 +14,7 @@ Shader "Hidden/HDRP/preIntegratedFGD_CharlieFabricLambert" #pragma vertex Vert #pragma fragment Frag #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define PREFER_HALF 0 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_GGXDisneyDiffuse.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_GGXDisneyDiffuse.shader index 4922bb2fb61..8ca287228f8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_GGXDisneyDiffuse.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/preIntegratedFGD_GGXDisneyDiffuse.shader @@ -14,7 +14,7 @@ Shader "Hidden/HDRP/preIntegratedFGD_GGXDisneyDiffuse" #pragma vertex Vert #pragma fragment Frag #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define PREFER_HALF 0 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ImageBasedLighting.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/CombineLighting.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/CombineLighting.shader index 17236488735..178f7ad994a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/CombineLighting.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/CombineLighting.shader @@ -10,7 +10,7 @@ Shader "Hidden/HDRP/CombineLighting" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch // #pragma enable_d3d11_debug_symbols #pragma vertex Vert diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScattering.compute b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScattering.compute index 7118884ad0e..936a590b03f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScattering.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScattering.compute @@ -5,7 +5,7 @@ //-------------------------------------------------------------------------------------------------- // #pragma enable_d3d11_debug_symbols -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel SubsurfaceScatteringMQ SubsurfaceScattering=SubsurfaceScatteringMQ SSS_ENABLE_NEAR_FIELD=0 #pragma kernel SubsurfaceScatteringHQ SubsurfaceScattering=SubsurfaceScatteringHQ SSS_ENABLE_NEAR_FIELD=1 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader index 1f73432c54f..4552cafcadd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader @@ -56,7 +56,7 @@ Shader "HDRP/TerrainLit" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch // Terrain builtin keywords #pragma shader_feature_local _TERRAIN_8_LAYERS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader index eefc2b20259..5c01c0cbdee 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader @@ -42,7 +42,7 @@ Shader "Hidden/HDRP/TerrainLit_Basemap" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma shader_feature_local _DISABLE_DECALS #pragma shader_feature_local _TERRAIN_INSTANCED_PERPIXEL_NORMAL diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_BasemapGen.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_BasemapGen.shader index d6dac6680e2..95ff0b3614a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_BasemapGen.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_BasemapGen.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/TerrainLit_BasemapGen" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define SURFACE_GRADIENT // Must use Surface Gradient as the normal map texture format is now RG floating point #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader index 1e4e0f53647..79e956e8c66 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader @@ -148,7 +148,7 @@ Shader "HDRP/Unlit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -196,7 +196,7 @@ Shader "HDRP/Unlit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -244,7 +244,7 @@ Shader "HDRP/Unlit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -290,7 +290,7 @@ Shader "HDRP/Unlit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -326,7 +326,7 @@ Shader "HDRP/Unlit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -364,7 +364,7 @@ Shader "HDRP/Unlit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing @@ -403,7 +403,7 @@ Shader "HDRP/Unlit" HLSLPROGRAM - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch //enable GPU instancing support #pragma multi_compile_instancing diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ApplyExposure.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ApplyExposure.compute index 5cb939db088..0dc06ab4412 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ApplyExposure.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ApplyExposure.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMain diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomBlur.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomBlur.compute index 6283f54301f..f6073342ab1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomBlur.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomBlur.compute @@ -3,7 +3,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMain MAIN=KMain #pragma kernel KMainDownsample MAIN=KMainDownsample DOWNSAMPLE diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomPrefilter.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomPrefilter.compute index 54c5c88583d..627a1294a87 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomPrefilter.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomPrefilter.compute @@ -3,7 +3,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomCommon.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMain diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomUpsample.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomUpsample.compute index a29375ee9aa..5cfe56c214b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomUpsample.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomUpsample.compute @@ -2,7 +2,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMainLowQ MAIN=KMainLowQ LOW_QUALITY #pragma kernel KMainHighQ MAIN=KMainHighQ HIGH_QUALITY diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ClearBlack.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ClearBlack.shader index f12b936300b..58460eb2081 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ClearBlack.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ClearBlack.shader @@ -3,7 +3,7 @@ Shader "Hidden/HDRP/ClearBlack" HLSLINCLUDE #pragma target 4.5 #pragma editor_sync_compilation - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute index 483f92eb7a5..24103a8d596 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoC.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMainPhysical #pragma kernel KMainManual diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCDilate.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCDilate.compute index 9535f976f39..01bd3790317 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCDilate.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCDilate.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMain diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute index 2796dbfc273..89a9052552a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCoCReproject.compute @@ -2,7 +2,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMain diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCombine.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCombine.compute index b267b1de7a3..7954badc06c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCombine.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCombine.compute @@ -2,7 +2,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMainNearFarLowQ MAIN=KMainNearFarLowQ LOW_QUALITY NEAR FAR #pragma kernel KMainNearLowQ MAIN=KMainNearLowQ LOW_QUALITY NEAR diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute index 6ddc24e0c0d..131772320c7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute @@ -2,7 +2,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" #include "DepthOfFieldCommon.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMainFar MAIN=KMainFar FAR #pragma kernel KMainFarTiles MAIN=KMainFarTiles FAR USE_TILES diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldKernel.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldKernel.compute index c33689812c1..7532d083783 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldKernel.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldKernel.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCommon.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KParametricBlurKernel MAIN=KParametricBlurKernel GROUP_SIZE=64 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMip.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMip.compute index 5a59686f834..1613d7d7b77 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMip.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMip.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMainColor MAIN=KMainColor CTYPE=float3 #pragma kernel KMainColorAlpha MAIN=KMainColorAlpha CTYPE=float4 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMipSafe.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMipSafe.compute index 4c6b8a5600e..a4379e9e656 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMipSafe.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldMipSafe.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMain MAIN=KMain #pragma kernel KMainAlpha MAIN=KMainAlpha ENABLE_ALPHA diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldPrefilter.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldPrefilter.compute index 5d1e841612d..174e198da2a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldPrefilter.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldPrefilter.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMainNearFar MAIN=KMainNearFar NEAR FAR #pragma kernel KMainNear MAIN=KMainNear NEAR diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute index 9174ec0f47c..2b0e724fbfd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute @@ -2,7 +2,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" #include "DepthOfFieldCommon.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KClear #pragma kernel KMainNearFar MAIN=KMainNearFar NEAR FAR diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/Exposure.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/Exposure.compute index d0c341ebb3e..05991e97cc5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/Exposure.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/Exposure.compute @@ -3,7 +3,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/PhysicalCamera.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KFixedExposure #pragma kernel KManualCameraExposure diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader index 0f440651f75..d6020747f36 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/FinalPass.shader @@ -4,7 +4,7 @@ Shader "Hidden/HDRP/FinalPass" #pragma target 4.5 #pragma editor_sync_compilation - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile_local _ FXAA #pragma multi_compile_local _ GRAIN diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/LutBuilder3D.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/LutBuilder3D.compute index 2acd611a5c9..da9ab06c2f6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/LutBuilder3D.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/LutBuilder3D.compute @@ -2,7 +2,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KBuild_NoTonemap MAIN=KBuild_NoTonemap TONEMAPPING_NONE #pragma kernel KBuild_NeutralTonemap MAIN=KBuild_NeutralTonemap TONEMAPPING_NEUTRAL diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute index f4f5038c71a..a6cc4248112 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurMotionVecPrep.compute @@ -2,7 +2,7 @@ #pragma kernel MotionVecPreppingCS MOTION_VEC_PREPPING -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define SKIP_PREPPING_IF_NOT_NEEDED defined(PLATFORM_SUPPORTS_WAVE_INTRINSICS) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurTilePass.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurTilePass.compute index 592cc63d568..00b075447dd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurTilePass.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/MotionBlurTilePass.compute @@ -8,7 +8,7 @@ #pragma kernel TileGenPass TILE_GEN_KERNEL_NAME=TileGenPass GEN_PASS #pragma kernel TileNeighbourhood TILE_NEIGHBOURHOOD_KERNEL_NAME=TileNeighbourhood NEIGHBOURHOOD_PASS -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define USE_WAVE_INTRINSICS defined(PLATFORM_SUPPORTS_WAVE_INTRINSICS) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/PaniniProjection.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/PaniniProjection.compute index 46e0b68d5f3..a4f1c6b84f0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/PaniniProjection.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/PaniniProjection.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMainGeneric MAIN=KMainGeneric GENERIC #pragma kernel KMainUnitDistance MAIN=KMainUnitDistance UNITDISTANCE diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/SubpixelMorphologicalAntialiasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/SubpixelMorphologicalAntialiasing.shader index b4f544290e6..00970be6749 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/SubpixelMorphologicalAntialiasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/SubpixelMorphologicalAntialiasing.shader @@ -8,7 +8,7 @@ Shader "Hidden/PostProcessing/SubpixelMorphologicalAntialiasing" HLSLINCLUDE -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile_local SMAA_PRESET_LOW SMAA_PRESET_MEDIUM SMAA_PRESET_HIGH ENDHLSL diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 9ed2596df37..82bff1125dc 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -12,7 +12,7 @@ Shader "Hidden/HDRP/TemporalAntialiasing" #pragma multi_compile_local _ ORTHOGRAPHIC #pragma multi_compile_local _ REDUCED_HISTORY_CONTRIB #pragma multi_compile_local _ ENABLE_ALPHA - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPost.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPost.compute index aabda26bc6b..714861745ea 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPost.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPost.compute @@ -5,7 +5,7 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPostFeatures.cs.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/BloomCommon.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KMain_Variant0 MAIN=KMain_Variant0 VARIANT=0 #pragma kernel KMain_Variant1 MAIN=KMain_Variant1 VARIANT=1 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramid.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramid.compute index 60916a16f03..bc9622d8b75 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramid.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramid.compute @@ -19,7 +19,7 @@ // Author: Bob Brown // -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KColorGaussian KERNEL_SIZE=8 MAIN_GAUSSIAN=KColorGaussian DISABLE_TEXTURE2D_X_ARRAY #pragma kernel KColorDownsample KERNEL_SIZE=8 MAIN_DOWNSAMPLE=KColorDownsample DISABLE_TEXTURE2D_X_ARRAY diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramidPS.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramidPS.shader index c48142b1a8f..2d3c0bad80b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramidPS.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramidPS.shader @@ -12,7 +12,7 @@ Shader "ColorPyramidPS" HLSLPROGRAM #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag #define DISABLE_TEXTURE2D_X_ARRAY 1 @@ -28,7 +28,7 @@ Shader "ColorPyramidPS" HLSLPROGRAM #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma vertex Vert #pragma fragment Frag #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/ColorPyramidPS.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DepthPyramid.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DepthPyramid.compute index faef32024cd..e04b738a4e1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DepthPyramid.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DepthPyramid.compute @@ -1,7 +1,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel KDepthDownsample8DualUav KERNEL_SIZE=8 KERNEL_NAME=KDepthDownsample8DualUav diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader index 6fd5921fd77..fd669c3c65f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader @@ -9,7 +9,7 @@ Shader "Hidden/HDRP/ApplyDistortion" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma editor_sync_compilation #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/AmbientOcclusionResolve.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/AmbientOcclusionResolve.shader index adb33cde564..77efe0dd4a3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/AmbientOcclusionResolve.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/AmbientOcclusionResolve.shader @@ -2,7 +2,7 @@ Shader "Hidden/HDRP/AOResolve" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" //#pragma enable_d3d11_debug_symbols diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader index 5404809c935..0db2490b910 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/ColorResolve.shader @@ -2,7 +2,7 @@ Shader "Hidden/HDRP/ColorResolve" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/DepthValues.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/DepthValues.shader index 219e122d14c..e3d3c2f7bba 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/DepthValues.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MSAA/DepthValues.shader @@ -2,7 +2,7 @@ Shader "Hidden/HDRP/DepthValues" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" // #pragma enable_d3d11_debug_symbols diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader index c55177f8125..20b3a47ba14 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/Blit.shader @@ -4,7 +4,7 @@ Shader "Hidden/HDRP/Blit" #pragma target 4.5 #pragma editor_sync_compilation - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile _ DISABLE_TEXTURE2D_X_ARRAY #pragma multi_compile _ BLIT_SINGLE_SLICE #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ClearStencilBuffer.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ClearStencilBuffer.shader index e0393849aa0..5ba4b5c9d3d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ClearStencilBuffer.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ClearStencilBuffer.shader @@ -8,7 +8,7 @@ Shader "Hidden/HDRP/ClearStencilBuffer" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader index 8b3bd03bb09..a6a74c576c0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader @@ -27,7 +27,7 @@ Shader "Hidden/HDRP/CopyDepthBuffer" HLSLPROGRAM #pragma target 4.5 #pragma editor_sync_compilation - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma fragment Frag #pragma vertex Vert //#pragma enable_d3d11_debug_symbols diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyStencilBuffer.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyStencilBuffer.shader index 398b57a5dd0..c15de359b38 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyStencilBuffer.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyStencilBuffer.shader @@ -9,7 +9,7 @@ Shader "Hidden/HDRP/CopyStencilBuffer" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch // #pragma enable_d3d11_debug_symbols #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader index b524860a502..fd1cc990d5b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader @@ -5,7 +5,7 @@ Shader "Hidden/HDRP/DownsampleDepth" #pragma target 4.5 #pragma editor_sync_compilation #pragma multi_compile_local MIN_DOWNSAMPLE CHECKERBOARD_DOWNSAMPLE - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute index 7069861cd18..2c2d60ab795 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute @@ -1,4 +1,4 @@ -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel MAIN KERNEL_NAME=MAIN NUM_SAMPLES=1 #pragma kernel MAIN_MSAA_2 KERNEL_NAME=MAIN_MSAA_2 NUM_SAMPLES=2 MSAA diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/UpsampleTransparent.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/UpsampleTransparent.shader index 1f54de4305f..5b99327ae47 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/UpsampleTransparent.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/UpsampleTransparent.shader @@ -5,7 +5,7 @@ Shader "Hidden/HDRP/UpsampleTransparent" #pragma target 4.5 #pragma editor_sync_compilation #pragma multi_compile_local BILINEAR NEAREST_DEPTH - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XRMirrorView.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XRMirrorView.shader index d03638d3f07..618dbd72594 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XRMirrorView.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XRMirrorView.shader @@ -6,7 +6,7 @@ Shader "Hidden/HDRP/XRMirrorView" HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch ENDHLSL // 0: TEXTURE2D diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XROcclusionMesh.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XROcclusionMesh.shader index 98ead163baa..05730dc8889 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XROcclusionMesh.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/XROcclusionMesh.shader @@ -2,7 +2,7 @@ Shader "Hidden/HDRP/XROcclusionMesh" { HLSLINCLUDE #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute b/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute index e4401d11779..99f6bf1bd5d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/AmbientProbeConvolution.compute @@ -3,7 +3,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Hammersley.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl" -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel AmbientProbeConvolution KERNEL_NAME=AmbientProbeConvolution diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.shader b/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.shader index cf02f4ae391..6c9f6999425 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.shader @@ -6,7 +6,7 @@ Shader "Hidden/HDRP/Sky/GradientSky" #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader index 71d91824264..960e636caf4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader @@ -6,7 +6,7 @@ Shader "Hidden/HDRP/Sky/HDRISky" #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #define LIGHTLOOP_DISABLE_TILE_AND_CLUSTER diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/IntegrateHDRISky.shader b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/IntegrateHDRISky.shader index e8ac82c86a7..2b2ac0af321 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/IntegrateHDRISky.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/IntegrateHDRISky.shader @@ -18,7 +18,7 @@ Shader "Hidden/HDRP/IntegrateHDRI" #pragma vertex Vert #pragma fragment Frag #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/GroundIrradiancePrecomputation.compute b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/GroundIrradiancePrecomputation.compute index 72ccc278ef7..ea44bb41abd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/GroundIrradiancePrecomputation.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/GroundIrradiancePrecomputation.compute @@ -1,5 +1,5 @@ // #pragma enable_d3d11_debug_symbols -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel MAIN_1 main=MAIN_1 SINGLE_SCATTERING #pragma kernel MAIN_S main=MAIN_S MULTIPLE_SCATTERING SRC_SS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute index e2a6ba08ea7..75d8cd3d558 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute @@ -1,5 +1,5 @@ // #pragma enable_d3d11_debug_symbols -#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma kernel MAIN_1 main=MAIN_1 SINGLE_SCATTERING #pragma kernel MAIN_S main=MAIN_S MULTIPLE_SCATTERING_GATHER SRC_SS diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.shader b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.shader index a2516149e74..299b583f8c1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.shader @@ -7,7 +7,7 @@ Shader "Hidden/HDRP/Sky/PbrSky" // #pragma enable_d3d11_debug_symbols #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Samples~/ProceduralSky/Runtime/ProceduralSky/Resources/ProceduralSky.shader b/com.unity.render-pipelines.high-definition/Samples~/ProceduralSky/Runtime/ProceduralSky/Resources/ProceduralSky.shader index 4e4580889cf..ea8c3f766fb 100644 --- a/com.unity.render-pipelines.high-definition/Samples~/ProceduralSky/Runtime/ProceduralSky/Resources/ProceduralSky.shader +++ b/com.unity.render-pipelines.high-definition/Samples~/ProceduralSky/Runtime/ProceduralSky/Resources/ProceduralSky.shader @@ -11,7 +11,7 @@ Shader "Hidden/HDRP/Sky/ProceduralSky" #pragma editor_sync_compilation #pragma target 4.5 - #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma multi_compile _ _ENABLE_SUN_DISK From 1e0901c90243c8ca70a4ae27f114f012f12b27e8 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Mon, 30 Mar 2020 14:51:50 +0200 Subject: [PATCH 59/84] Shadow cascade tooltip fix (when using the metric mode) #6448 --- .../CHANGELOG.md | 1 + .../Editor/Lighting/Shadow/HDShadowSettingsEditor.cs | 8 +++++++- .../Runtime/Lighting/Shadow/HDShadowSettings.cs | 12 ++++++------ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index e58e090add4..9b1ff2cc772 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -68,6 +68,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed XR single-pass with Mock HMD plugin - Fixed XR culling with multiple cameras - Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. +- Fixed shadow cascade tooltip when using the metric mode (case 1229232) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/HDShadowSettingsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/HDShadowSettingsEditor.cs index 3b2b41a2f57..b93e5b0aa5b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/HDShadowSettingsEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/HDShadowSettingsEditor.cs @@ -80,9 +80,15 @@ public override void OnInspectorGUI() { EditorGUI.indentLevel++; int cascadeCount = m_CascadeShadowSplitCount.value.intValue; + Debug.Assert(cascadeCount <= 4); // If we add support for more than 4 cascades, then we should add new entries in the next line + string[] cascadeOrder = { "first", "second", "third" }; + for (int i = 0; i < cascadeCount - 1; i++) { - PropertyField(m_CascadeShadowSplits[i], EditorGUIUtility.TrTextContent(string.Format("Split {0}", i + 1))); + string tooltipOverride = (unit == Unit.Metric) ? + $"Distance from the Camera (in meters) to the {cascadeOrder[i]} cascade split." : + $"Distance from the Camera (as a percentage of Max Distance) to the {cascadeOrder[i]} cascade split."; + PropertyField(m_CascadeShadowSplits[i], EditorGUIUtility.TrTextContent(string.Format("Split {0}", i + 1), tooltipOverride)); } if (HDRenderPipeline.s_UseCascadeBorders) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs index 6b78ebab3e6..24558080a76 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs @@ -57,14 +57,14 @@ public float[] cascadeShadowBorders /// Number of cascades HDRP uses for cascaded shadow maps. [Tooltip("Controls the number of cascades HDRP uses for cascaded shadow maps.")] public NoInterpClampedIntParameter cascadeShadowSplitCount = new NoInterpClampedIntParameter(4, 1, 4); - /// Position of the first cascade split as a percentage of Max Distance. - [Tooltip("Sets the position of the first cascade split as a percentage of Max Distance.")] + /// Position of the first cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized. + [Tooltip("Sets the position of the first cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized.")] public CascadePartitionSplitParameter cascadeShadowSplit0 = new CascadePartitionSplitParameter(0.05f); - /// Position of the second cascade split as a percentage of Max Distance. - [Tooltip("Sets the position of the second cascade split as a percentage of Max Distance.")] + /// Position of the second cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized. + [Tooltip("Sets the position of the second cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized.")] public CascadePartitionSplitParameter cascadeShadowSplit1 = new CascadePartitionSplitParameter(0.15f); - /// Sets the position of the third cascade split as a percentage of Max Distance. - [Tooltip("Position of the third cascade split as a percentage of Max Distance.")] + /// Sets the position of the third cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized. + [Tooltip("Sets the position of the third cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized.")] public CascadePartitionSplitParameter cascadeShadowSplit2 = new CascadePartitionSplitParameter(0.3f); /// Border size between the first and second cascade split. [Tooltip("Sets the border size between the first and second cascade split.")] From be0bac0595509e7c7dc1d011a4aae56eee8557e1 Mon Sep 17 00:00:00 2001 From: skhiat <55133890+skhiat@users.noreply.github.com> Date: Mon, 30 Mar 2020 17:25:05 +0200 Subject: [PATCH 60/84] Focus on Decal uses the extends of the projectors #6449 --- .../CHANGELOG.md | 1 + .../Editor/Material/Decal/DecalProjectorEditor.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9b1ff2cc772..fe43f25735d 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -69,6 +69,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed XR culling with multiple cameras - Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. - Fixed shadow cascade tooltip when using the metric mode (case 1229232) +- Fix when rescale probe all direction below zero (1219246) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs index 876c6320074..ab124573fa3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs @@ -135,6 +135,18 @@ private void OnDisable() private void OnDestroy() => DestroyImmediate(m_MaterialEditor); + public bool HasFrameBounds() + { + return true; + } + + public Bounds OnGetFrameBounds() + { + DecalProjector decalProjector = target as DecalProjector; + + return new Bounds(decalProjector.transform.position, handle.size); + } + public void UpdateMaterialEditor() { int validMaterialsCount = 0; From 2ca7f4d531ca7a91da2c4e528124f395ec9f323f Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Tue, 31 Mar 2020 12:04:55 +0200 Subject: [PATCH 61/84] [8.x.x Backport] Fixed how the area light influence volume is computed to match rasterization. (#6455) * - Fixed how the area light influence volume is computed to match rasterization. * Fix an issue with axis order Co-authored-by: sebastienlagarde --- .../CHANGELOG.md | 1 + .../Raytracing/HDRaytracingLightCluster.cs | 44 ++++++++++++++++--- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index fe43f25735d..b6bd01a5c9e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. - Fixed shadow cascade tooltip when using the metric mode (case 1229232) - Fix when rescale probe all direction below zero (1219246) +- Fixed how the area light influence volume is computed to match rasterization. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs index 8d55e3bfad3..a7952cffdd8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs @@ -69,6 +69,9 @@ internal class HDRaytracingLightCluster int envLightCount = 0; int totalLightCount = 0; int numLightsPerCell = 0; + Bounds bounds = new Bounds(); + Vector3 minBounds = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); + Vector3 maxBounds = new Vector3(-float.MaxValue, -float.MaxValue, -float.MaxValue); public HDRaytracingLightCluster() { @@ -239,6 +242,22 @@ void ResizeEnvLightDataBuffer(int numEnvLights) } } + void OOBBToAABBBounds(Vector3 centerWS, Vector3 extents, Vector3 up, Vector3 right, Vector3 forward, ref Bounds outBounds) + { + // Reset the bounds of the AABB + bounds.min = minBounds; + bounds.max = maxBounds; + // Push the 8 corners of the oobb into the AABB + bounds.Encapsulate(centerWS + right * extents.x + up * extents.y + forward * extents.z); + bounds.Encapsulate(centerWS + right * extents.x + up * extents.y - forward * extents.z); + bounds.Encapsulate(centerWS + right * extents.x - up * extents.y + forward * extents.z); + bounds.Encapsulate(centerWS + right * extents.x - up * extents.y - forward * extents.z); + bounds.Encapsulate(centerWS - right * extents.x + up * extents.y + forward * extents.z); + bounds.Encapsulate(centerWS - right * extents.x + up * extents.y - forward * extents.z); + bounds.Encapsulate(centerWS - right * extents.x - up * extents.y + forward * extents.z); + bounds.Encapsulate(centerWS - right * extents.x - up * extents.y - forward * extents.z); + } + void BuildGPULightVolumes(HDRayTracingLights rayTracingLights) { int totalNumLights = rayTracingLights.lightCount; @@ -270,20 +289,35 @@ void BuildGPULightVolumes(HDRayTracingLights rayTracingLights) // Reserve space in the cookie atlas m_RenderPipeline.ReserveCookieAtlasTexture(currentLight, light); + + // Grab the light range float lightRange = light.range; - m_LightVolumesCPUArray[realIndex].range = new Vector3(lightRange, lightRange, lightRange); - m_LightVolumesCPUArray[realIndex].position = currentLight.gameObject.transform.position; - m_LightVolumesCPUArray[realIndex].active = (currentLight.gameObject.activeInHierarchy ? 1 : 0); - m_LightVolumesCPUArray[realIndex].lightIndex = (uint)lightIdx; - + if (currentLight.type != HDLightType.Area) { + m_LightVolumesCPUArray[realIndex].range = new Vector3(lightRange, lightRange, lightRange); + m_LightVolumesCPUArray[realIndex].position = currentLight.gameObject.transform.position; + m_LightVolumesCPUArray[realIndex].active = (currentLight.gameObject.activeInHierarchy ? 1 : 0); + m_LightVolumesCPUArray[realIndex].lightIndex = (uint)lightIdx; m_LightVolumesCPUArray[realIndex].shape = 0; m_LightVolumesCPUArray[realIndex].lightType = 0; punctualLightCount++; } else { + // let's compute the oobb of the light influence volume first + Vector3 oobbDimensions = new Vector3(light.areaSize.x + 2 * lightRange, light.areaSize.y + 2 * lightRange, lightRange); // One-sided + Vector3 extents = 0.5f * oobbDimensions; + Vector3 oobbCenter = currentLight.gameObject.transform.position + extents.z * currentLight.gameObject.transform.forward; + + // Let's now compute an AABB that matches the previously defined OOBB + OOBBToAABBBounds(oobbCenter, extents, currentLight.gameObject.transform.up, currentLight.gameObject.transform.right, currentLight.gameObject.transform.forward, ref bounds); + + // Fill the volume data + m_LightVolumesCPUArray[realIndex].range = bounds.extents; + m_LightVolumesCPUArray[realIndex].position = bounds.center; + m_LightVolumesCPUArray[realIndex].active = (currentLight.gameObject.activeInHierarchy ? 1 : 0); + m_LightVolumesCPUArray[realIndex].lightIndex = (uint)lightIdx; m_LightVolumesCPUArray[realIndex].shape = 1; m_LightVolumesCPUArray[realIndex].lightType = 1; areaLightCount++; From 23e8ba64d4832a86afdbfc872346ee1e00b850e8 Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Wed, 1 Apr 2020 11:16:48 +0200 Subject: [PATCH 62/84] Fixed usage of light size data that are not available at runtime. (#6490) --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../RenderPipeline/Raytracing/HDRaytracingLightCluster.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b6bd01a5c9e..c8dbbbddcbe 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -71,6 +71,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed shadow cascade tooltip when using the metric mode (case 1229232) - Fix when rescale probe all direction below zero (1219246) - Fixed how the area light influence volume is computed to match rasterization. +- Fixed usage of light size data that are not available at runtime. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs index a7952cffdd8..0ccf1924f1d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs @@ -306,7 +306,7 @@ void BuildGPULightVolumes(HDRayTracingLights rayTracingLights) else { // let's compute the oobb of the light influence volume first - Vector3 oobbDimensions = new Vector3(light.areaSize.x + 2 * lightRange, light.areaSize.y + 2 * lightRange, lightRange); // One-sided + Vector3 oobbDimensions = new Vector3(currentLight.shapeWidth + 2 * lightRange, currentLight.shapeHeight + 2 * lightRange, lightRange); // One-sided Vector3 extents = 0.5f * oobbDimensions; Vector3 oobbCenter = currentLight.gameObject.transform.position + extents.z * currentLight.gameObject.transform.forward; From 06dbd25ac613a7d016809953fbde8fdf4e084421 Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Wed, 1 Apr 2020 12:21:09 +0200 Subject: [PATCH 63/84] Changed the diffusion profile warning on the material to an info and changed the message to be more precise. (#6481) --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Material/DiffusionProfile/DiffusionProfileMaterialUI.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index c8dbbbddcbe..fa9f9d8fe09 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -86,6 +86,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Hidden unsupported choice in emission in Materials - All custom pass volumes are now executed for one injection point instead of the first one. - Optimized PrepareLightsForGPU (cost reduced by over 25%) and PrepareGPULightData (around twice as fast now). +- Changed the diffusion profile warning on the material to an info and changed the message to be more precise. ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs index 93d1e87072c..726379b1193 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Rendering.HighDefinition { static class DiffusionProfileMaterialUI { - static GUIContent diffusionProfileNotInHDRPAsset = new GUIContent("You must add this diffusion profile in the HDRP asset to make it work", EditorGUIUtility.IconContent("console.warnicon").image); + static GUIContent diffusionProfileNotInHDRPAsset = new GUIContent("You must make sure that this diffusion profile is either referenced in the HDRP asset or in the Diffusion Profile Override to make it work.", EditorGUIUtility.IconContent("console.infoicon").image); public static bool IsSupported(MaterialEditor materialEditor) { From 283af98dbaf7b8feb4724071a02588f174f26d86 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Tue, 31 Mar 2020 19:37:53 +0200 Subject: [PATCH 64/84] Fix shadow tesselation culling (#6477) * Fix custom pass culling params * Fixed shadow tessellation culling * revert custom pass code --- .../Runtime/Lighting/Light/HDAdditionalLightData.cs | 6 +++--- .../Runtime/Lighting/Shadow/HDShadowAtlas.cs | 2 +- .../Runtime/RenderPipeline/HDStringConstants.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index b76c4ac2298..5cfdcca69e6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -1876,7 +1876,7 @@ internal int UpdateShadowRequest(HDCamera hdCamera, HDShadowManager manager, HDS // Assign all setting common to every lights - SetCommonShadowRequestSettings(shadowRequest, visibleLight, cameraPos, invViewProjection, shadowRequest.deviceProjectionYFlip * shadowRequest.view, viewportSize, lightIndex); + SetCommonShadowRequestSettings(shadowRequest, visibleLight, cameraPos, invViewProjection, viewportSize, lightIndex); } shadowRequest.atlasViewport = resolutionRequest.atlasViewport; @@ -1896,7 +1896,7 @@ internal int UpdateShadowRequest(HDCamera hdCamera, HDShadowManager manager, HDS return firstShadowRequestIndex; } - void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, VisibleLight visibleLight, Vector3 cameraPos, Matrix4x4 invViewProjection, Matrix4x4 viewProjection, Vector2 viewportSize, int lightIndex) + void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, VisibleLight visibleLight, Vector3 cameraPos, Matrix4x4 invViewProjection, Vector2 viewportSize, int lightIndex) { // zBuffer param to reconstruct depth position (for transmission) float f = legacyLight.range; @@ -1940,7 +1940,7 @@ void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, VisibleLight } // shadow clip planes (used for tessellation clipping) - GeometryUtility.CalculateFrustumPlanes(viewProjection, m_ShadowFrustumPlanes); + GeometryUtility.CalculateFrustumPlanes(shadowRequest.deviceProjectionYFlip * shadowRequest.view, m_ShadowFrustumPlanes); if (shadowRequest.frustumPlanes?.Length != 6) shadowRequest.frustumPlanes = new Vector4[6]; // Left, right, top, bottom, near, far. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs index d6156443640..888e9c60ad1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs @@ -534,7 +534,7 @@ static void RenderShadows( RenderShadowsParameters parameters, cmd.SetGlobalMatrix(HDShaderIDs._InvProjMatrix, shadowRequest.deviceProjectionYFlip.inverse); cmd.SetGlobalMatrix(HDShaderIDs._ViewProjMatrix, viewProjection); cmd.SetGlobalMatrix(HDShaderIDs._InvViewProjMatrix, viewProjection.inverse); - cmd.SetGlobalVectorArray(HDShaderIDs._ShadowClipPlanes, shadowRequest.frustumPlanes); + cmd.SetGlobalVectorArray(HDShaderIDs._ShadowFrustumPlanes, shadowRequest.frustumPlanes); // TODO: remove this execute when DrawShadows will use a CommandBuffer renderContext.ExecuteCommandBuffer(cmd); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 0e6fd148a51..39bc306fde8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -250,7 +250,7 @@ static class HDShaderIDs public static readonly int _DirectionalContactShadowSampleCount = Shader.PropertyToID("_SampleCount"); public static readonly int _MicroShadowOpacity = Shader.PropertyToID("_MicroShadowOpacity"); public static readonly int _DirectionalTransmissionMultiplier = Shader.PropertyToID("_DirectionalTransmissionMultiplier"); - public static readonly int _ShadowClipPlanes = Shader.PropertyToID("_ShadowClipPlanes"); + public static readonly int _ShadowFrustumPlanes = Shader.PropertyToID("_ShadowFrustumPlanes"); public static readonly int _StencilMask = Shader.PropertyToID("_StencilMask"); public static readonly int _StencilRef = Shader.PropertyToID("_StencilRef"); From 7d5589f2b00c2940c674a76b1b94a9ceb0c91591 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Date: Wed, 1 Apr 2020 07:50:58 -0400 Subject: [PATCH 65/84] Add option to disable XR rendering on the camera settings #6372 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs | 8 ++++++++ .../Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs | 1 + .../Editor/RenderPipeline/Camera/SerializedHDCamera.cs | 2 ++ .../Unity.RenderPipelines.HighDefinition.Editor.asmdef | 7 ++++++- .../RenderPipeline/Camera/HDAdditionalCameraData.cs | 4 ++++ .../Runtime/RenderPipeline/HDRenderPipeline.cs | 6 +++++- .../Runtime/RenderPipeline/XR/XRSystem.cs | 2 +- 8 files changed, 28 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index fa9f9d8fe09..b8f7d2b419b 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added support of cookie baking and add support on Disc light. - Added XR setting to control camera jitter for temporal effects - Added an error message in the DrawRenderers custom pass when rendering opaque objects with an HDRP asset in DeferredOnly mode. +- Added option to disable XR rendering on the camera settings. ### Fixed - Fix Changelog diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs index b4fe3f6cbbd..56f220191ce 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs @@ -147,6 +147,9 @@ static HDCameraUI() Expandable.Output, k_ExpandedState, CED.Group( +#if ENABLE_VR && ENABLE_XR_MANAGEMENT + Drawer_SectionXRRendering, +#endif #if ENABLE_MULTIPLE_DISPLAYS Drawer_SectionMultiDisplay, #endif @@ -512,6 +515,11 @@ static void Drawer_CameraWarnings(SerializedHDCamera p, Editor owner) } } + static void Drawer_SectionXRRendering(SerializedHDCamera p, Editor owner) + { + EditorGUILayout.PropertyField(p.xrRendering, xrRenderingContent); + } + #if ENABLE_MULTIPLE_DISPLAYS static void Drawer_SectionMultiDisplay(SerializedHDCamera p, Editor owner) { diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs index f07b7951c06..527ea9b2e5e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs @@ -57,6 +57,7 @@ static partial class HDCameraUI static readonly GUIContent viewportContent = EditorGUIUtility.TrTextContent("Viewport Rect", "Four values that indicate where on the screen HDRP draws this Camera view. Measured in Viewport Coordinates (values in the range of [0, 1])."); static readonly GUIContent depthContent = EditorGUIUtility.TrTextContent("Depth"); + static readonly GUIContent xrRenderingContent = EditorGUIUtility.TrTextContent("XR Rendering"); #if ENABLE_MULTIPLE_DISPLAYS static readonly GUIContent targetDisplayContent = EditorGUIUtility.TrTextContent("Target Display"); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs index 0834014153d..ca5efef5bbe 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs @@ -26,6 +26,7 @@ class SerializedHDCamera public SerializedProperty stopNaNs; public SerializedProperty clearColorMode; public SerializedProperty backgroundColorHDR; + public SerializedProperty xrRendering; public SerializedProperty passThrough; public SerializedProperty customRenderingSettings; public SerializedProperty clearDepth; @@ -71,6 +72,7 @@ public SerializedHDCamera(SerializedObject serializedObject) stopNaNs = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.stopNaNs); clearColorMode = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearColorMode); backgroundColorHDR = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.backgroundColorHDR); + xrRendering = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.xrRendering); passThrough = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.fullscreenPassthrough); customRenderingSettings = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.customRenderingSettings); clearDepth = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearDepth); diff --git a/com.unity.render-pipelines.high-definition/Editor/Unity.RenderPipelines.HighDefinition.Editor.asmdef b/com.unity.render-pipelines.high-definition/Editor/Unity.RenderPipelines.HighDefinition.Editor.asmdef index a60b36808c5..a2955e88f11 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Unity.RenderPipelines.HighDefinition.Editor.asmdef +++ b/com.unity.render-pipelines.high-definition/Editor/Unity.RenderPipelines.HighDefinition.Editor.asmdef @@ -25,6 +25,11 @@ "name": "com.unity.render-pipelines.high-definition", "expression": "0.0.0", "define": "HDRP_1_OR_NEWER" + }, + { + "name": "com.unity.xr.management", + "expression": "1.0.0", + "define": "ENABLE_XR_MANAGEMENT" } ] -} \ No newline at end of file +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs index d3aef0f64c8..9445ff5509d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs @@ -270,6 +270,9 @@ public enum SMAAQualityLevel /// Vertical flip mode. public FlipYMode flipYMode; + /// Enable XR rendering. + public bool xrRendering = true; + /// Skips rendering settings to directly render in fullscreen (Useful for video). [Tooltip("Skips rendering settings to directly render in fullscreen (Useful for video).")] public bool fullscreenPassthrough = false; @@ -470,6 +473,7 @@ public void CopyTo(HDAdditionalCameraData data) data.volumeAnchorOverride = volumeAnchorOverride; data.antialiasing = antialiasing; data.dithering = dithering; + data.xrRendering = xrRendering; physicalParameters.CopyTo(data.physicalParameters); data.renderingPathCustomFrameSettings = renderingPathCustomFrameSettings; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index f3ece248b2e..9aac85a718d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1787,7 +1787,11 @@ ref _cullingResults // Render XR mirror view once all render requests have been completed if (i == 0 && renderRequest.hdCamera.camera.cameraType == CameraType.Game && renderRequest.hdCamera.camera.targetTexture == null) { - m_XRSystem.RenderMirrorView(cmd); + HDAdditionalCameraData acd; + if (renderRequest.hdCamera.camera.TryGetComponent(out acd) && acd.xrRendering) + { + m_XRSystem.RenderMirrorView(cmd); + } } // Now that all cameras have been rendered, let's propagate the data required for screen space shadows diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs index 4b89ae1d46c..e7d5d48222d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs @@ -123,7 +123,7 @@ internal int GetMaxViews() continue; // Enable XR layout only for gameview camera - bool xrSupported = camera.cameraType == CameraType.Game && camera.targetTexture == null; + bool xrSupported = camera.cameraType == CameraType.Game && camera.targetTexture == null && HDUtils.TryGetAdditionalCameraDataOrDefault(camera).xrRendering; if (customLayout != null && customLayout(new XRLayout() { camera = camera, xrSystem = this })) { From aa12bc47e725c6413bda9e246086b50ce9bb8a62 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 31 Mar 2020 10:23:14 +0200 Subject: [PATCH 66/84] Move scene view camera settings to camera settings window #6390 --- .../CHANGELOG.md | 1 + .../Documentation~/TableOfContents.md | 1 + .../Upgrading-from-2019.3-to-2020.1.md | 7 +++ .../PostProcessing/PostProcessSystem.cs | 2 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 2 +- .../HDAdditionalSceneViewSettings.cs | 51 +++++++++++++++++++ .../HDAdditionalSceneViewSettings.cs.meta | 11 ++++ .../Utilities/HDRenderPipelinePreferences.cs | 33 ------------ 8 files changed, 73 insertions(+), 35 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.3-to-2020.1.md create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs.meta diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b8f7d2b419b..9e5a3cb3307 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -88,6 +88,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - All custom pass volumes are now executed for one injection point instead of the first one. - Optimized PrepareLightsForGPU (cost reduced by over 25%) and PrepareGPULightData (around twice as fast now). - Changed the diffusion profile warning on the material to an info and changed the message to be more precise. +- Moved scene view camera settings for HDRP from the preferences window to the scene view camera settings window. ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md b/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md index ef71b2f9e67..96ac363bab4 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md @@ -14,6 +14,7 @@ * [Material Upgrade](Material-Upgrade) * [2019.1 to 2019.2](Upgrading-from-2019.1-to-2019.2) * [2019.2 to 2019.3](Upgrading-from-2019.2-to-2019.3) + * [2019.3 to 2020.1](Upgrading-from-2019.3-to-2020.1) * Volume Framework * [Volumes](Volumes) * [Volume Profiles](Volume-Profile) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.3-to-2020.1.md b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.3-to-2020.1.md new file mode 100644 index 00000000000..8742701deb8 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.3-to-2020.1.md @@ -0,0 +1,7 @@ +# Upgrading HDRP from Unity 2019.3 to Unity 2020.1 + +In the High Definition Render Pipeline (HDRP), some features work differently between major versions of Unity. This document helps you upgrade HDRP from Unity 2019.3 to 2020.1. + +## Scene View Camera Settings + +From Unity 2020.1, the HDRP-specific settings of the scene view camera (anti-aliasing mode and stop NaNs) can be found in the same pop-up window as the standard scene camera settings, which are accessible by clicking the scene camera button on the toolbar of the scene window. These settings were previously in the HDRP preferences window (Edit > Preferences). diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs index 615d2af76bd..75bef7a57a5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs @@ -415,7 +415,7 @@ void PoolSource(ref RTHandle src, RTHandle dst) #if UNITY_EDITOR if (isSceneView) - stopNaNs = HDRenderPipelinePreferences.sceneViewStopNaNs; + stopNaNs = HDAdditionalSceneViewSettings.sceneViewStopNaNs; #endif if (stopNaNs) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 6dad9dea362..f935ef4e77a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -839,7 +839,7 @@ void UpdateAntialiasing() #if UNITY_EDITOR else if (camera.cameraType == CameraType.SceneView) { - var mode = HDRenderPipelinePreferences.sceneViewAntialiasing; + var mode = HDAdditionalSceneViewSettings.sceneViewAntialiasing; if (mode == AntialiasingMode.TemporalAntialiasing && !animateMaterials) antialiasing = AntialiasingMode.None; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs new file mode 100644 index 00000000000..f70ffb78d71 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs @@ -0,0 +1,51 @@ +namespace UnityEngine.Rendering.HighDefinition +{ +#if UNITY_EDITOR + using UnityEditor; + using AntialiasingMode = HDAdditionalCameraData.AntialiasingMode; + + [InitializeOnLoad] + static class HDAdditionalSceneViewSettings + { + static class Styles + { + public static readonly GUIContent AAMode = EditorGUIUtility.TrTextContent("Camera Anti-aliasing", "The anti-alising mode that will be used in the scene view camera."); + public static readonly GUIContent StopNaNs = EditorGUIUtility.TrTextContent("Camera Stop NaNs", "When enabled, any NaNs in the color buffer of the scene view camera will be suppressed."); + public static readonly string HelpBox = "Temporal Anti - aliasing in the Scene View is only supported when Animated Materials are enabled."; + } + + static AntialiasingMode s_SceneViewAntialiasing = AntialiasingMode.None; + + public static AntialiasingMode sceneViewAntialiasing + { + get => s_SceneViewAntialiasing; + set => s_SceneViewAntialiasing = value; + } + + static bool s_SceneViewStopNaNs = false; + + public static bool sceneViewStopNaNs + { + get => s_SceneViewStopNaNs; + set => s_SceneViewStopNaNs = value; + } + + static HDAdditionalSceneViewSettings() + { + SceneViewCameraWindow.additionalSettingsGui += DoAdditionalSettings; + } + + static void DoAdditionalSettings(SceneView sceneView) + { + EditorGUILayout.Space(); + EditorGUILayout.LabelField("HD Render Pipeline", EditorStyles.boldLabel); + + s_SceneViewAntialiasing = (AntialiasingMode)EditorGUILayout.EnumPopup(Styles.AAMode, s_SceneViewAntialiasing); + if (s_SceneViewAntialiasing == AntialiasingMode.TemporalAntialiasing) + EditorGUILayout.HelpBox(Styles.HelpBox, MessageType.Info); + + s_SceneViewStopNaNs = EditorGUILayout.Toggle(Styles.StopNaNs, s_SceneViewStopNaNs); + } + } +#endif +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs.meta b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs.meta new file mode 100644 index 00000000000..27faf403248 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDAdditionalSceneViewSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b35404f0872b6444b8669bb00132cfa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDRenderPipelinePreferences.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDRenderPipelinePreferences.cs index 0310736c51a..8670fb07bab 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDRenderPipelinePreferences.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDRenderPipelinePreferences.cs @@ -12,30 +12,6 @@ static class HDRenderPipelinePreferences { static bool m_Loaded = false; - static AntialiasingMode s_SceneViewAntialiasing; - public static AntialiasingMode sceneViewAntialiasing - { - get => s_SceneViewAntialiasing; - set - { - if (s_SceneViewAntialiasing == value) return; - s_SceneViewAntialiasing = value; - EditorPrefs.SetInt(Keys.sceneViewAntialiasing, (int)s_SceneViewAntialiasing); - } - } - - static bool s_SceneViewStopNaNs; - public static bool sceneViewStopNaNs - { - get => s_SceneViewStopNaNs; - set - { - if (s_SceneViewStopNaNs == value) return; - s_SceneViewStopNaNs = value; - EditorPrefs.SetBool(Keys.sceneViewStopNaNs, s_SceneViewStopNaNs); - } - } - static bool s_MatcapMixAlbedo; public static bool matcapViewMixAlbedo { @@ -105,13 +81,6 @@ static SettingsProvider PreferenceGUI() if (!m_Loaded) Load(); - sceneViewAntialiasing = (AntialiasingMode)EditorGUILayout.EnumPopup("Scene View Anti-aliasing", sceneViewAntialiasing); - - if (sceneViewAntialiasing == AntialiasingMode.TemporalAntialiasing) - EditorGUILayout.HelpBox("Temporal Anti-aliasing in the Scene View is only supported when Animated Materials are enabled.", MessageType.Info); - - sceneViewStopNaNs = EditorGUILayout.Toggle("Scene View Stop NaNs", sceneViewStopNaNs); - matcapViewMixAlbedo = EditorGUILayout.Toggle("Mix Albedo in the Matcap", matcapViewMixAlbedo); if(matcapViewMixAlbedo) matcapViewScale = EditorGUILayout.FloatField("Matcap intensity scale", matcapViewScale); @@ -134,8 +103,6 @@ static HDRenderPipelinePreferences() static void Load() { - s_SceneViewAntialiasing = (AntialiasingMode)EditorPrefs.GetInt(Keys.sceneViewAntialiasing, (int)AntialiasingMode.None); - s_SceneViewStopNaNs = EditorPrefs.GetBool(Keys.sceneViewStopNaNs, false); s_MatcapMixAlbedo = EditorPrefs.GetBool(Keys.matcapViewMixAlbedo, true); s_MatcapScale = EditorPrefs.GetFloat(Keys.matcapViewScale, 1.0f); s_LightColorNormalization = EditorPrefs.GetBool(Keys.lightColorNormalization, false); From 7801cf01ef9fe4daeda3c15d3448fe985529f754 Mon Sep 17 00:00:00 2001 From: JordanL8 Date: Tue, 31 Mar 2020 18:35:54 +0100 Subject: [PATCH 67/84] Corrected typo and changed links to .md (#6414) * Corrected typo and changed links to .md * Update Master-Node-Fabric.md --- .../Documentation~/Master-Node-Fabric.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md index 02be38b022d..52ec484c2af 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Master-Node-Fabric.md @@ -6,7 +6,7 @@ You can use the Fabric Material to render various types of fabric in the High De ## Creating and editing a Fabric Material -Fabric Materials use a Shader Graph Master Node which means you cannot edit any of its properties in the Inspector. Fabric Materials use a Shader Graph Master Node, so you need to use a specific process to create and edit a Material that uses it. For information on how to do this, see [Customizing HDRP materials with Shader Graph](Customizing-HDRP-materials-with-Shader-Graph.html). +Fabric Materials use a Shader Graph Master Node which means you cannot edit any of its properties in the Inspector. Fabric Materials use a Shader Graph Master Node, so you need to use a specific process to create and edit a Material that uses it. For information on how to do this, see [Customizing HDRP materials with Shader Graph](Customizing-HDRP-materials-with-Shader-Graph.md). When you apply the node to a Material, the **Surface Options** and **Exposed Properties** become available to edit in the Material’s Inspector. @@ -27,7 +27,7 @@ There are properties on the Master Node, and properties on each Material. Master -The following table describes the input ports on a Fabric Master Node, including the property type and Shader stage used for each port. For more information on Shader stages, see [Shader Stage]([https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html?subfolder=/manual/Shader-Stage.html](https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Shader-Stage.html)). +The following table describes the input ports on a Fabric Master Node, including the property type and Shader stage used for each port. For more information on Shader stages, see [Shader Stage](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html?subfolder=/manual/Shader-Stage.html). | **Property** | **Type** | **Stage** | **Description** | | ---------------------- | ----------------- | --------- | ------------------------------------------------------------ | @@ -37,11 +37,11 @@ The following table describes the input ports on a Fabric Master Node, including | **BaseColor** | Vector 3 | Fragment | The color of the Material. To assign an image, connect a sampled Texture2D to this Master Node. | | **SpecularOcclusion** | Vector 1 | Fragment | A multiplier for the intensity of specular global illumination. This port only appears when you set **Specular Occlusion Mode** to **Custom**. | | **Normal** | Vector 3 | Fragment | The normal of the point in tangent space. To handle this property, you should use multiple maps. One map for the base and one map for the fabric thread that adds the additional details. | -| **BentNormal** | Vector 3 | Fragment | The [bent normal](Glossary.html#BentNormalMap) of the point. | +| **BentNormal** | Vector 3 | Fragment | The [bent normal](Glossary.md#BentNormalMap) of the point. | | **Smoothness** | Vector 1 | Fragment | The appearance of the primary specular highlight. Every light ray that hits a smooth surface bounces off at predictable and consistent angles. For a perfectly smooth surface that reflects light like a mirror, set this to a value of 1. For a rougher surface, set this to a lower value. | | **AmbientOcclusion** | Vector1 | Fragment | A multiplier for the intensity of diffuse global illumination. Set this to **0** to remove all global illumination. | | **SpecularColor** | Vector3 | Fragment | The color of the specular highlight. To assign an image, connect a sampled Texture2D to this Master Node. | -| **Diffusion Profile** | Diffusion Profile | Fragment | Specifies which [Diffusion Profile](Diffusion-Profile.html) the Material uses for subsurface scattering and/or transmission. This port only appears when you enable **Subsurface Scattering** or **Transmission**. | +| **Diffusion Profile** | Diffusion Profile | Fragment | Specifies which [Diffusion Profile](Diffusion-Profile.md) the Material uses for subsurface scattering and/or transmission. This port only appears when you enable **Subsurface Scattering** or **Transmission**. | | **SubsurfaceMask** | Vector1 | Fragment | Indicates whether subsurface scattering should affect the shaded point. This port only appears when you enable the **Subsurface Scattering** setting. | | **Thickness** | Vector1 | Fragment | The thickness of the surface that HDRP uses to evaluate transmission. This port only appears when you enable the **Transmission** setting. | | **Tangent** | Vector3 | Fragment | The tangent of the point in tangent space. This is useful when the surface has a non-null anisotropy value. This port only appears when you set **Material Type** to **Silk**. | @@ -49,8 +49,8 @@ The following table describes the input ports on a Fabric Master Node, including | **Emission** | Vector 3 | Fragment | The Material's emission color value. The RGB values you assign should be between 0-255. The Intensity value should be within the range **-10** and **10**. | | **Alpha** | Vector 1 | Fragment | The Material's alpha value. The Material uses this for transparency and/or alpha clip. HDRP expects a range from **0** to **1**. This port only appears when you set **Material Type** to **Silk**. | | **AlphaClipThreshold** | Vector 1 | Fragment | The alpha value limit that HDRP uses to determine whether it should render each pixel of the Material. If the alpha value of the pixel is equal to or higher than this threshold then HDRP renders the pixel. If the value is lower than this threshold then HDRP does not render the pixel. This port only appears when you enable the **Alpha Clipping** setting. | -| **BakedGI** | Vector 3 | Fragment | Replaces the built-in diffuse global illumination (GI) solution with a value that you can set. This is for the front [face](Glossary.html#Face) of the Mesh only.This port only appears when you enable the **Override Baked GI** setting. | -| **BakedBackGI** | Vector3 | Fragment | Replaces the built-in diffuse GI solution with a value that you can set. This is for the back [face](Glossary.html#Face) of the Mesh only.This port only appears when you enable the **Override Baked GI** setting. | +| **BakedGI** | Vector 3 | Fragment | Replaces the built-in diffuse global illumination (GI) solution with a value that you can set. This is for the front [face](Glossary.md#Face) of the Mesh only.This port only appears when you enable the **Override Baked GI** setting. | +| **BakedBackGI** | Vector3 | Fragment | Replaces the built-in diffuse GI solution with a value that you can set. This is for the back [face](Glossary.md#Face) of the Mesh only.This port only appears when you enable the **Override Baked GI** setting. | | **DepthOffset** | Vector 1 | Fragment | The value that the Shader uses to increase the depth of the fragment by.. This port only appears when you enable the **Depth Offset setting**. | @@ -73,7 +73,7 @@ To view these properties, click the **Cog** in the top right of the Master Node. | **Alpha Clipping** | Enable or disable Alpha Clipping. This controls whether your Shader acts as a Cutout Shader or not. Cutout Shader is a Shader type that has both Opaque and Transparent parts. | | **Double-Sided** | Specifies whether HDRP renders both faces of the polygons in your geometry. You can also specify how HDRP interprets the normals for the back face. The options are:
• **Enabled**: HDRP renders both faces of polygons in your geometry.
• **Disabled**: HDRP does not render both faces of polygons in your geometry.
• **Flipped Normals**: The normal of the back face is 180° of the front facing normal. This also applies to the Material which means that it looks the same on both sides of the geometry.
• **Mirrored Normals**: The normal of the back face mirrors the front facing normal. This also applies to the Material which means that it inverts on the back face. This is useful when you want to keep the same shapes on both sides of the geometry, for example, for leaves. | | **Energy Conserving Specular** | Enable the checkbox to make HDRP reduce the diffuse color of the Material if the specular effect is more intense. This makes the lighting of the Material more consistent, which makes the Material look more physically accurate. | -| **Material Type** | Specifies the type of Material the fabric Shader represents. The options are:
• **Cotton Wool**: A variant inspired by the Imageworks’s cloth model.
• **Silk**: A fabric variant based on an anisotropic DinseyGGX BRDF Model. | +| **Material Type** | Specifies the type of Material the fabric Shader represents. The options are:
• **Cotton Wool**: A variant inspired by the Imageworks’s cloth model.
• **Silk**: A fabric variant based on an anisotropic GGX BRDF Model. | | **Subsurface Scattering** | Indicates whether the Material supports subsurface scattering. To disable subsurface scattering in specific regions of the Material, use the **Subsurface Mask**. | | **Transmission** | Indicates whether the Material supports transmission. | | **Receive Decals** | Indicates whether HDRP can draw decals on this Material’s surface. | From c5209000f24c6c0b0889c7cbd555b9e4805bf7e0 Mon Sep 17 00:00:00 2001 From: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Date: Wed, 1 Apr 2020 12:46:38 +0200 Subject: [PATCH 68/84] Hdrp /fix reset of HDAdditionalLightData #6453 --- .../CHANGELOG.md | 1 + .../Light/HDAdditionalLightData.Migration.cs | 22 +------------- .../Lighting/Light/HDAdditionalLightData.cs | 29 ++++++++++++++++++- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9e5a3cb3307..720d0c68c8e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -73,6 +73,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix when rescale probe all direction below zero (1219246) - Fixed how the area light influence volume is computed to match rasterization. - Fixed usage of light size data that are not available at runtime. +- Fixed light type resolution when performing a reset on HDAdditionalLightData (case 1220931) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Migration.cs index 254fc7ac9a7..5901520b37c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Migration.cs @@ -8,7 +8,7 @@ namespace UnityEngine.Rendering.HighDefinition { - public partial class HDAdditionalLightData : ISerializationCallbackReceiver, IVersionable + public partial class HDAdditionalLightData : IVersionable { enum Version { @@ -167,26 +167,6 @@ private static readonly MigrationDescription k_H ); #pragma warning restore 0618, 0612 - /// - /// Deserialization callback - /// - void ISerializationCallbackReceiver.OnAfterDeserialize() {} - - /// - /// Serialization callback - /// - void ISerializationCallbackReceiver.OnBeforeSerialize() - { - UpdateBounds(); - } - - void OnEnable() - { - if (shadowUpdateMode == ShadowUpdateMode.OnEnable) - m_ShadowMapRenderedSinceLastRequest = false; - SetEmissiveMeshRendererEnabled(true); - } - void Migrate() { k_HDLightMigrationSteps.Migrate(this); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index 5cfdcca69e6..13a317b27d4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -32,7 +32,7 @@ struct TimelineWorkaround [HelpURL(Documentation.baseURL + Documentation.version + Documentation.subURL + "Light-Component" + Documentation.endURL)] [RequireComponent(typeof(Light))] [ExecuteAlways] - public partial class HDAdditionalLightData : MonoBehaviour + public partial class HDAdditionalLightData : MonoBehaviour, ISerializationCallbackReceiver { internal static class ScalableSettings { @@ -2919,5 +2919,32 @@ ShadowMapType shadowMapType : type != HDLightType.Directional ? ShadowMapType.PunctualAtlas : ShadowMapType.CascadedDirectional; + + void OnEnable() + { + if (shadowUpdateMode == ShadowUpdateMode.OnEnable) + m_ShadowMapRenderedSinceLastRequest = false; + SetEmissiveMeshRendererEnabled(true); + } + + /// + /// Deserialization callback + /// + void ISerializationCallbackReceiver.OnAfterDeserialize() { } + + /// + /// Serialization callback + /// + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + // When reseting, Light component can be not available (will be called later in Reset) + if (m_Light == null || m_Light.Equals(null)) + return; + + UpdateBounds(); + } + + void Reset() + => UpdateBounds(); } } From f251095d7b228a8e4606aa84c1b3835e592b5c83 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Tue, 31 Mar 2020 14:01:21 +0200 Subject: [PATCH 69/84] Fix null error when leaving debug menu #6467 --- .../Runtime/Debug/DebugDisplay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 20d469a4084..303100ca701 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -1056,7 +1056,7 @@ void RegisterDecalsDebug() m_DebugDecalsAffectingTransparentItems = new DebugUI.Widget[] { new DebugUI.BoolField { displayName = "Display Atlas", getter = () => data.decalsDebugSettings.displayAtlas, setter = value => data.decalsDebugSettings.displayAtlas = value}, - new DebugUI.UIntField { displayName = "Mip Level", getter = () => data.decalsDebugSettings.mipLevel, setter = value => data.decalsDebugSettings.mipLevel = value, min = () => 0u, max = () => (uint)(RenderPipelineManager.currentPipeline as HDRenderPipeline).GetDecalAtlasMipCount() } + new DebugUI.UIntField { displayName = "Mip Level", getter = () => data.decalsDebugSettings.mipLevel, setter = value => data.decalsDebugSettings.mipLevel = value, min = () => 0u, max = () => (uint)(RenderPipelineManager.currentPipeline as HDRenderPipeline)?.GetDecalAtlasMipCount() } }; var panel = DebugManager.instance.GetPanel(k_PanelDecals, true); From 581d6db3976bf657ae4998e4883295ce83421565 Mon Sep 17 00:00:00 2001 From: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Date: Wed, 1 Apr 2020 12:38:45 +0200 Subject: [PATCH 70/84] Hdrp /fix drag area width at left of light intensity #6471 --- .../CHANGELOG.md | 1 + .../Editor/Lighting/HDLightUI.Skin.cs | 3 +++ .../Editor/Lighting/HDLightUI.cs | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 720d0c68c8e..637d94cf140 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -74,6 +74,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed how the area light influence volume is computed to match rasterization. - Fixed usage of light size data that are not available at runtime. - Fixed light type resolution when performing a reset on HDAdditionalLightData (case 1220931) +- Fixed drag area width at left of Light's intensity field in Inspector. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs index c7911055978..791fbe90800 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs @@ -50,6 +50,9 @@ sealed class Styles public readonly GUIContent areaIntensity = new GUIContent("Intensity (Lumen)", "Luminous power of the Light in Lumen."); public readonly GUIContent lightIntensity = new GUIContent("Intensity", "Sets the strength of the Light. Use the drop-down to select the light units to use."); + // in casse that you want to keep the indentation but have nothing to write + public readonly GUIContent empty = EditorGUIUtility.TrTextContent(" "); + public readonly GUIContent lightRadius = new GUIContent("Radius", "Sets the radius of the light source. This affects the falloff of diffuse lighting, the spread of the specular highlight, and the softness of Ray Traced shadows."); public readonly GUIContent affectDiffuse = new GUIContent("Affect Diffuse", "When disabled, HDRP does not calculate diffuse lighting for this Light. Does not increase performance as HDRP still calculates the diffuse lighting."); public readonly GUIContent affectSpecular = new GUIContent("Affect Specular", "When disabled, HDRP does not calculate specular lighting for this Light. Does not increase performance as HDRP still calculates the specular lighting."); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index 9f427379e68..e6e52bf3678 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -606,10 +606,10 @@ static void DrawLightIntensityGUILayout(SerializedHDLight serialized, Editor own Rect valueRect = lineRect; Rect labelRect = lineRect; labelRect.width = EditorGUIUtility.labelWidth; - valueRect.x += labelRect.width - indent + k_PrefixPaddingRight; + // We use PropertyField to draw the value to keep the handle at left of the field - // This will apply the indent again thus we need to remove it two time for alignment - valueRect.width -= labelRect.width + k_UnitWidth - indent - indent + k_PrefixPaddingRight + k_ValueUnitSeparator; + // This will apply the indent again thus we need to remove it time for alignment + valueRect.width += indent - k_ValueUnitSeparator - k_UnitWidth; Rect unitRect = valueRect; unitRect.x += valueRect.width - indent + k_ValueUnitSeparator; unitRect.width = k_UnitWidth + .5f; @@ -623,8 +623,8 @@ static void DrawLightIntensityGUILayout(SerializedHDLight serialized, Editor own } EditorGUI.EndProperty(); EditorGUI.EndProperty(); - - EditorGUI.PropertyField(valueRect, serialized.intensity, GUIContent.none); + + EditorGUI.PropertyField(valueRect, serialized.intensity, s_Styles.empty); DrawLightIntensityUnitPopup(unitRect, serialized, owner); if (EditorGUI.EndChangeCheck()) From 3246b8e51e048c1340e02758c6be6f25006cf2ac Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Wed, 1 Apr 2020 11:37:08 +0100 Subject: [PATCH 71/84] Fix issue with baked reflection probes constantly marked as dirty with auto-bake on #6473 --- .../CHANGELOG.md | 1 + .../Runtime/Utilities/CameraSettings.cs | 33 +++++++++++++++++++ .../Runtime/Utilities/ProbeSettings.cs | 3 +- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 637d94cf140..b4f1cc2f252 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -75,6 +75,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed usage of light size data that are not available at runtime. - Fixed light type resolution when performing a reset on HDAdditionalLightData (case 1220931) - Fixed drag area width at left of Light's intensity field in Inspector. +- Fix for issue that prevented scene from being completely saved when baked reflection probes are present and lighting is set to auto generate. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs index 606dbe3112e..742170e8ec3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs @@ -356,5 +356,38 @@ public static CameraSettings From(HDCamera hdCamera) [SerializeField][FormerlySerializedAs("frameSettings")][Obsolete("For data migration")] internal ObsoleteFrameSettings m_ObsoleteFrameSettings; #pragma warning restore 618 + + internal Hash128 GetHash() + { + var h = new Hash128(); + var h2 = new Hash128(); + + HashUtilities.ComputeHash128(ref bufferClearing, ref h); + HashUtilities.ComputeHash128(ref culling, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref customRenderingSettings, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref defaultFrameSettings, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref flipYMode, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref frustum, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref invertFaceCulling, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref probeLayerMask, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref probeRangeCompressionFactor, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref renderingPathCustomFrameSettings, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + HashUtilities.ComputeHash128(ref renderingPathCustomFrameSettingsOverrideMask, ref h2); + HashUtilities.AppendHash(ref h2, ref h); + int volumeHash = volumes.GetHashCode(); + h2 = new Hash128((ulong)volumeHash, 0); + HashUtilities.AppendHash(ref h2, ref h); + + return h; + } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs index faa360006dd..23499318e19 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs @@ -276,8 +276,9 @@ public Hash128 ComputeHash() HashUtilities.AppendHash(ref h2, ref h); HashUtilities.ComputeHash128(ref proxySettings, ref h2); HashUtilities.AppendHash(ref h2, ref h); - HashUtilities.ComputeHash128(ref cameraSettings, ref h2); + h2 = cameraSettings.GetHash(); HashUtilities.AppendHash(ref h2, ref h); + if (influence != null) { h2 = influence.ComputeHash(); From b445a2fac0b661c15806ff4ecf0d47556ad7a87e Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Wed, 1 Apr 2020 12:19:55 +0200 Subject: [PATCH 72/84] Fix custom pass depth copy #6484 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/RenderPipeline/HDRenderPipeline.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b4f1cc2f252..53633597a2f 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -76,6 +76,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed light type resolution when performing a reset on HDAdditionalLightData (case 1220931) - Fixed drag area width at left of Light's intensity field in Inspector. - Fix for issue that prevented scene from being completely saved when baked reflection probes are present and lighting is set to auto generate. +- Fixed the depth buffer copy made before custom pass after opaque and normal injection point. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 9aac85a718d..be8af6df0b4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -2012,7 +2012,11 @@ AOVRequestData aovRequest m_SharedRTManager.BindNormalBuffer(cmd); // After Depth and Normals/roughness including decals - RenderCustomPass(renderContext, cmd, hdCamera, customPassCullingResults, CustomPassInjectionPoint.AfterOpaqueDepthAndNormal); + bool depthBufferModified = RenderCustomPass(renderContext, cmd, hdCamera, customPassCullingResults, CustomPassInjectionPoint.AfterOpaqueDepthAndNormal); + + // If the depth was already copied in RenderDBuffer, we force the copy again because the custom pass modified the depth. + if (depthBufferModified) + m_IsDepthBufferCopyValid = false; // In both forward and deferred, everything opaque should have been rendered at this point so we can safely copy the depth buffer for later processing. GenerateDepthPyramid(hdCamera, cmd, FullScreenDebugMode.DepthPyramid); From 0d576eaf425b7f319c19309867cb68724c811b94 Mon Sep 17 00:00:00 2001 From: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Date: Wed, 1 Apr 2020 11:57:33 +0200 Subject: [PATCH 73/84] Hdrp /lookdev ui fixes #6491 --- com.unity.render-pipelines.core/CHANGELOG.md | 5 +++ .../Editor/LookDev/DisplayWindow.cs | 34 +++++++++++++++---- .../Editor/LookDev/DisplayWindow.uss | 3 +- .../Editor/LookDev/ToolbarRadio.cs | 20 ++++++++++- 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 1a05224fc0e..e3311fe474f 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -6,9 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Add tooltips in LookDev's toolbar. + ### Fixed - Fixed issue when LookDev window is opened and the CoreRP Package is updated to a newer version. - Fixed copy/pasting of Volume Components when loading a new scene +- Fix LookDev's camera button layout. +- Fix LookDev's layout vanishing on domain reload. ## [8.0.0] - 2020-05-25 diff --git a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs index 043b61a7aca..a616701a681 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs @@ -51,11 +51,21 @@ static partial class Style internal static readonly GUIContent k_WindowTitleAndIcon = EditorGUIUtility.TrTextContentWithIcon("Look Dev", CoreEditorUtils.LoadIcon(k_IconFolder, "LookDev", forceLowRes: true)); - internal static readonly Texture2D k_Layout1Icon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Layout1", forceLowRes: true); - internal static readonly Texture2D k_Layout2Icon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Layout2", forceLowRes: true); - internal static readonly Texture2D k_LayoutVerticalIcon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutVertical", forceLowRes: true); - internal static readonly Texture2D k_LayoutHorizontalIcon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutHorizontal", forceLowRes: true); - internal static readonly Texture2D k_LayoutStackIcon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutCustom", forceLowRes: true); + internal static readonly (Texture2D icon, string tooltip) k_Layout1Icon = + (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Layout1", forceLowRes: true), + "First view"); + internal static readonly (Texture2D icon, string tooltip) k_Layout2Icon = + (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Layout2", forceLowRes: true), + "Second view"); + internal static readonly (Texture2D icon, string tooltip) k_LayoutVerticalIcon = + (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutVertical", forceLowRes: true), + "Both views split vertically"); + internal static readonly (Texture2D icon, string tooltip) k_LayoutHorizontalIcon = + (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutHorizontal", forceLowRes: true), + "Both views split horizontally"); + internal static readonly (Texture2D icon, string tooltip) k_LayoutStackIcon = + (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutCustom", forceLowRes: true), + "Both views stacked"); internal static readonly Texture2D k_Camera1Icon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Camera1", forceLowRes: true); internal static readonly Texture2D k_Camera2Icon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Camera2", forceLowRes: true); @@ -66,6 +76,7 @@ static partial class Style internal static readonly Texture2D k_RenderdocIcon = CoreEditorUtils.LoadIcon(Style.k_IconFolder, "RenderDoc", forceLowRes: true); internal const string k_RenderDocLabel = " Content"; + internal const string k_CameraSyncTooltip = "Synchronize camera movement amongst views"; internal const string k_CameraMenuSync1On2 = "Align Camera 1 with Camera 2"; internal const string k_CameraMenuSync2On1 = "Align Camera 2 with Camera 1"; internal const string k_CameraMenuReset = "Reset Cameras"; @@ -269,6 +280,7 @@ void CreateToolbar() cameraMenu.variant = ToolbarMenu.Variant.Popup; var cameraToggle = new ToolbarToggle() { name = Style.k_CameraButtonName }; cameraToggle.value = LookDev.currentContext.cameraSynced; + cameraToggle.tooltip = Style.k_CameraSyncTooltip; //Note: when having Image on top of the Toggle nested in the Menu, RegisterValueChangedCallback is not called //cameraToggle.RegisterValueChangedCallback(evt => LookDev.currentContext.cameraSynced = evt.newValue); @@ -282,8 +294,8 @@ void CreateToolbar() cameraToggle.Add(new Image() { image = Style.k_Camera1Icon }); cameraToggle.Add(new Image() { image = Style.k_LinkIcon }); cameraToggle.Add(new Image() { image = Style.k_Camera2Icon }); - cameraMenu.Add(cameraToggle); cameraMenu.Add(cameraSeparator); + cameraMenu.Add(cameraToggle); cameraMenu.menu.AppendAction(Style.k_CameraMenuSync1On2, (DropdownMenuAction a) => LookDev.currentContext.SynchronizeCameraStates(ViewIndex.Second), DropdownMenuAction.AlwaysEnabled); @@ -386,9 +398,11 @@ void CreateViews() m_NoEnvironment1 = new Label(Style.k_DragAndDropEnvironment); m_NoEnvironment1.style.flexGrow = 1; m_NoEnvironment1.style.unityTextAlign = TextAnchor.MiddleCenter; + m_NoEnvironment1.style.whiteSpace = WhiteSpace.Normal; m_NoEnvironment2 = new Label(Style.k_DragAndDropEnvironment); m_NoEnvironment2.style.flexGrow = 1; m_NoEnvironment2.style.unityTextAlign = TextAnchor.MiddleCenter; + m_NoEnvironment2.style.whiteSpace = WhiteSpace.Normal; m_Views[(int)ViewIndex.First].Add(m_NoObject1); m_Views[(int)ViewIndex.First].Add(m_NoEnvironment1); m_Views[(int)ViewIndex.Second].Add(m_NoObject2); @@ -657,6 +671,14 @@ void OnGUI() // rootVisualElement.styleSheets.Add(styleSheetLight); //} } + else + { + //deal with missing style when domain reload... + if (!rootVisualElement.styleSheets.Contains(styleSheet)) + rootVisualElement.styleSheets.Add(styleSheet); + if (!EditorGUIUtility.isProSkin && !rootVisualElement.styleSheets.Contains(styleSheetLight)) + rootVisualElement.styleSheets.Add(styleSheetLight); + } OnUpdateRequestedInternal?.Invoke(); } diff --git a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.uss b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.uss index 6131c3cfdb5..2dd183f21ac 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.uss +++ b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.uss @@ -378,9 +378,8 @@ MultipleSourcePopupField > MultipleDifferentValue:hover #cameraMenu { - flex-direction: row; + flex-direction: row-reverse; padding: 0px; - padding-right: 16px; } #cameraButton diff --git a/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs b/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs index e9911623932..0d985d18e7d 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs @@ -57,11 +57,12 @@ public ToolbarRadio(string label = null, bool canDeselectAll = false) Add(new Label() { text = label }); } - public void AddRadio(string text = null, Texture2D icon = null) + public void AddRadio(string text = null, Texture2D icon = null, string tooltip = null) { var toggle = new ToolbarToggle(); toggle.RegisterValueChangedCallback(InnerValueChanged(radioLength)); toggle.SetValueWithoutNotify(radioLength == (m_CanDeselectAll ? -1 : 0)); + toggle.tooltip = tooltip; radios.Add(toggle); if (icon != null) { @@ -83,6 +84,11 @@ public void AddRadios(string[] labels) foreach (var label in labels) AddRadio(label); } + public void AddRadios((string text, string tooltip)[] labels) + { + foreach (var label in labels) + AddRadio(label.text, null, label.tooltip); + } public void AddRadios(Texture2D[] icons) { @@ -95,6 +101,18 @@ public void AddRadios((string text, Texture2D icon)[] labels) foreach (var label in labels) AddRadio(label.text, label.icon); } + + public void AddRadios((Texture2D icon, string tooltip)[] labels) + { + foreach (var label in labels) + AddRadio(null, label.icon, label.tooltip); + } + + public void AddRadios((string text, Texture2D icon, string tooltip)[] labels) + { + foreach (var label in labels) + AddRadio(label.text, label.icon, label.tooltip); + } EventCallback> InnerValueChanged(int radioIndex) { From c3df4e1c34631893c8577b26e785903f11956320 Mon Sep 17 00:00:00 2001 From: Jussi Knuuttila Date: Wed, 1 Apr 2020 13:11:04 +0300 Subject: [PATCH 74/84] Expose a debug constant in ShaderLab to make HDRP/Unlit SRP Batcher compatible again. #6496 --- .../Runtime/Material/Unlit/Unlit.shader | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader index 79e956e8c66..379370346b4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader @@ -87,6 +87,10 @@ Shader "HDRP/Unlit" _MainTex("Albedo", 2D) = "white" {} _Color("Color", Color) = (1,1,1,1) _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 + + // Debug constants must be exposed as properties so the shader is compatible + // with the SRP batcher + [HideInInspector] _UnlitColorMap_MipInfo("_UnlitColorMap_MipInfo", Vector) = (0, 0, 0, 0) } HLSLINCLUDE From 5c7d949e871bb8a396096d663904c3081ac2003a Mon Sep 17 00:00:00 2001 From: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Date: Wed, 1 Apr 2020 13:54:09 +0200 Subject: [PATCH 75/84] fix unused leftover (#6497) --- .../Editor/Lighting/HDLightUI.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index e6e52bf3678..af3526dd800 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -595,7 +595,6 @@ static void DrawLightIntensityGUILayout(SerializedHDLight serialized, Editor own { // Match const defined in EditorGUI.cs const int k_IndentPerLevel = 15; - const int k_PrefixPaddingRight = 2; const int k_ValueUnitSeparator = 2; const int k_UnitWidth = 100; From f6a0d334b1d3c64454a97cab807e1906350ad4a8 Mon Sep 17 00:00:00 2001 From: Antoine Lelievre Date: Wed, 1 Apr 2020 19:01:50 +0200 Subject: [PATCH 76/84] Fix custom pass test reference images (#6512) --- .../BeforeOpaqueDepthAndNormal.shader | 2 +- .../OSXEditor/Metal/9700_CustomPass_FullScreen.png | 4 ++-- .../Metal/9700_CustomPass_FullScreen.png.meta | 13 +++++++------ .../Direct3D11/9700_CustomPass_FullScreen.png | 4 ++-- .../Direct3D11/9700_CustomPass_FullScreen.png.meta | 5 +++-- .../Vulkan/9700_CustomPass_FullScreen.png | 4 ++-- .../Vulkan/9700_CustomPass_FullScreen.png.meta | 13 +++++++------ .../Direct3D11/9700_CustomPass_FullScreen.png | 4 ++-- .../Direct3D11/9700_CustomPass_FullScreen.png.meta | 13 +++++++------ 9 files changed, 33 insertions(+), 29 deletions(-) diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader index a6ddd102650..b4dc422945b 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9700_CustomPass_FullScreen/BeforeOpaqueDepthAndNormal.shader @@ -44,7 +44,7 @@ color = float4(CustomPassLoadCameraColor(varyings.positionCS.xy, 0), 1); // Add your custom pass code here - outputDepth = 0.06; + outputDepth = 0.063; // Fade value allow you to increase the strength of the effect while the camera gets closer to the custom pass volume float f = 1 - abs(_FadeValue * 2 - 1); diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png index 2d829f01b1d..bbfd7276b30 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7398b678981fdba10377301cfaf9e11a34cd1bb0904e9850ee64a3b04906c95 -size 18565 +oid sha256:51c8ae37b0675a74e1b9a64d0b01ced866952cd3c5ef6b7c12987023b38c26f3 +size 16594 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png.meta index c231d247732..497612f1b4a 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png.meta +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/9700_CustomPass_FullScreen.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: 4face8f6dc8ae1744b78b25e71dba914 +guid: ade29300eb1fff74cb3071356242afc8 TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 10 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 0 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,7 +20,7 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - isReadable: 1 + isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 @@ -38,7 +38,7 @@ TextureImporter: wrapU: -1 wrapV: -1 wrapW: -1 - nPOTScale: 0 + nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -59,13 +59,14 @@ TextureImporter: compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 + applyGammaDecoding: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png index 2d829f01b1d..bbfd7276b30 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7398b678981fdba10377301cfaf9e11a34cd1bb0904e9850ee64a3b04906c95 -size 18565 +oid sha256:51c8ae37b0675a74e1b9a64d0b01ced866952cd3c5ef6b7c12987023b38c26f3 +size 16594 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png.meta index 607ce5a0a03..97c808c1e95 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png.meta +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9700_CustomPass_FullScreen.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 090fdc9a5453ec645919a8e0e82d6434 +guid: 4e0f3f4bc856f0a4184170131a47322a TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 10 + serializedVersion: 11 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -59,6 +59,7 @@ TextureImporter: compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 + applyGammaDecoding: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png index 2d829f01b1d..bbfd7276b30 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7398b678981fdba10377301cfaf9e11a34cd1bb0904e9850ee64a3b04906c95 -size 18565 +oid sha256:51c8ae37b0675a74e1b9a64d0b01ced866952cd3c5ef6b7c12987023b38c26f3 +size 16594 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png.meta index ffe191f70a2..23d3ffc78e1 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png.meta +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/9700_CustomPass_FullScreen.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: 5dbfa273c689bd844a354cc9d4418a7b +guid: bbb17d8228d33684696b75d51fff9eab TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 10 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 0 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,7 +20,7 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - isReadable: 1 + isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 @@ -38,7 +38,7 @@ TextureImporter: wrapU: -1 wrapV: -1 wrapW: -1 - nPOTScale: 0 + nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -59,13 +59,14 @@ TextureImporter: compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 + applyGammaDecoding: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png index 2d829f01b1d..bbfd7276b30 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7398b678981fdba10377301cfaf9e11a34cd1bb0904e9850ee64a3b04906c95 -size 18565 +oid sha256:51c8ae37b0675a74e1b9a64d0b01ced866952cd3c5ef6b7c12987023b38c26f3 +size 16594 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png.meta index 8b63d93c0c0..db68a4c9f4a 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png.meta +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/9700_CustomPass_FullScreen.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: 38d2d82097255de479d7ab5f7d6be4b4 +guid: ca3eb713c936b8e44a799df4fb53b553 TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 10 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 0 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,7 +20,7 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - isReadable: 1 + isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 @@ -38,7 +38,7 @@ TextureImporter: wrapU: -1 wrapV: -1 wrapW: -1 - nPOTScale: 0 + nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -59,13 +59,14 @@ TextureImporter: compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 + applyGammaDecoding: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 From f09e664d1e1f77d1fdc863d6c1c3106a80729d1b Mon Sep 17 00:00:00 2001 From: anisunity <42026998+anisunity@users.noreply.github.com> Date: Fri, 3 Apr 2020 12:21:51 +0200 Subject: [PATCH 77/84] [8.x.x Backport] Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). (#6506) * - Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). * Small fix to avoid text overlapping Co-authored-by: Remi Chapelain --- .../CHANGELOG.md | 1 + .../Settings/SerializedScalableSetting.cs | 60 +++++++++++++------ 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 53633597a2f..d06da5c7d93 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -77,6 +77,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed drag area width at left of Light's intensity field in Inspector. - Fix for issue that prevented scene from being completely saved when baked reflection probes are present and lighting is set to auto generate. - Fixed the depth buffer copy made before custom pass after opaque and normal injection point. +- Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSetting.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSetting.cs index 29ffffe21c3..ddf918b1a6a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSetting.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSetting.cs @@ -136,29 +136,55 @@ ScalableSettingSchema schema static void MultiField(Rect position, GUIContent[] subLabels, T[] values) where T: struct { + // The number of slots we need to fit into this rectangle var length = values.Length; - var num = (position.width - (float) (length - 1) * 3f) / (float) length; - var position1 = new Rect(position) - { - width = num - }; - var labelWidth = EditorGUIUtility.labelWidth; + + // Let's compute the space allocated for every field including the label + var num = position.width / (float) length; + + // Reset the indentation var indentLevel = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; + + // Variable to keep track of the current pixel shift in the rectangle we were assigned for this whole section. + float pixelShift = 0; + + // Loop through the levels for (var index = 0; index < values.Length; ++index) { - EditorGUIUtility.labelWidth = CalcPrefixLabelWidth(subLabels[index], (GUIStyle) null); - if (typeof(T) == typeof(int)) - values[index] = (T)(object)EditorGUI.DelayedIntField(position1, subLabels[index], (int)(object)values[index]); - else if (typeof(T) == typeof(bool)) - values[index] = (T)(object)EditorGUI.Toggle(position1, subLabels[index], (bool)(object)values[index]); - else if (typeof(T) == typeof(float)) - values[index] = (T)(object)EditorGUI.FloatField(position1, subLabels[index], (float)(object)values[index]); - else - throw new ArgumentOutOfRangeException($"<{typeof(T)}> is not a supported type for multi field"); - position1.x += num + 4f; + // Let's first compute what is the width of the label of this scalable setting level + // We make sure that the label doesn't go beyond the space available for this scalable setting level + var labelWidth = Mathf.Clamp(CalcPrefixLabelWidth(subLabels[index], (GUIStyle)null), 0, num); + + // Draw the Label at the expected position + EditorGUI.LabelField(new Rect(position.x + pixelShift, position.y, labelWidth, position.height), subLabels[index]); + + // We need to remove from the position the label size that we've just drawn and shift by it's length + pixelShift += labelWidth; + + // The amount of space left for the field + float spaceLeft = num - labelWidth; + + // If at least two pixels are left to draw this field, draw it, otherwise, skip + if (spaceLeft > 2) + { + // Define the rectangle for the field + var fieldSlot = new Rect(position.x + pixelShift, position.y, num - labelWidth, position.height); + + // Draw the right field depending on its type. + if (typeof(T) == typeof(int)) + values[index] = (T)(object)EditorGUI.DelayedIntField(fieldSlot, (int)(object)values[index]); + else if (typeof(T) == typeof(bool)) + values[index] = (T)(object)EditorGUI.Toggle(fieldSlot, (bool)(object)values[index]); + else if (typeof(T) == typeof(float)) + values[index] = (T)(object)EditorGUI.FloatField(fieldSlot, (float)(object)values[index]); + else + throw new ArgumentOutOfRangeException($"<{typeof(T)}> is not a supported type for multi field"); + } + + // Shift by the slot that was left for the field + pixelShift += spaceLeft; } - EditorGUIUtility.labelWidth = labelWidth; EditorGUI.indentLevel = indentLevel; } From 182e74eddcbce4d7e3b8be947d151166c0df7113 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Tue, 7 Apr 2020 11:03:13 +0200 Subject: [PATCH 78/84] Fixed an usage of a a compute buffer not bound (1229964) (#27) Co-authored-by: Anis --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Lighting/LightLoop/LightLoop.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index d06da5c7d93..869f138b6c1 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix for issue that prevented scene from being completely saved when baked reflection probes are present and lighting is set to auto generate. - Fixed the depth buffer copy made before custom pass after opaque and normal injection point. - Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). +- Fixed an usage of a a compute buffer not bound (1229964) ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. 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 e00440045ef..253b45ecd8a 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 @@ -3150,7 +3150,8 @@ void BuildGPULightListsCommon(HDCamera hdCamera, CommandBuffer cmd) // Note we clear the whole content and not just the header since it is fast enough, happens only in one frame and is a bit more robust // to changes to the inner workings of the lists. // Also, we clear all the lists and to be resilient to changes in pipeline. - ClearLightList(hdCamera, cmd, resources.tileAndClusterData.bigTileLightList); + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.BigTilePrepass)) + ClearLightList(hdCamera, cmd, resources.tileAndClusterData.bigTileLightList); ClearLightList(hdCamera, cmd, resources.tileAndClusterData.lightList); ClearLightList(hdCamera, cmd, resources.tileAndClusterData.perVoxelOffset); From 69d5bee37112fbbf51f33b69515256838516edd2 Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Fri, 3 Apr 2020 12:16:21 +0200 Subject: [PATCH 79/84] Removed wrongly serialized fields in StaticLightingSky (#6441) --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Sky/StaticLightingSky.cs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 869f138b6c1..b6630eab7a1 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -79,6 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the depth buffer copy made before custom pass after opaque and normal injection point. - Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). - Fixed an usage of a a compute buffer not bound (1229964) +- Fixed an issue where unncessarily serialized members in StaticLightingSky component would change each time the scene is changed. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs index b8505b5cd66..d3aa6bb1293 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using UnityEngine.Serialization; @@ -15,8 +16,9 @@ class StaticLightingSky : MonoBehaviour int m_LastComputedHash; bool m_NeedUpdateStaticLightingSky; - // This one contain only property values from overridden properties in the original profile component - public SkySettings m_SkySettings; + [NonSerialized] + public SkySettings m_SkySettings; // This one contain only property values from overridden properties in the original profile component + [NonSerialized] public SkySettings m_SkySettingsFromProfile; public SkySettings skySettings From 7a231fc09a78c0774ed98a718b20c6a484167b33 Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Fri, 3 Apr 2020 12:15:39 +0200 Subject: [PATCH 80/84] Fix issues in the post process system with RenderTexture being invalid in some cases. Causing rendering problems. #6480 --- .../CHANGELOG.md | 1 + .../PostProcessing/PostProcessSystem.cs | 40 ++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b6630eab7a1..dd9378288d0 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -503,6 +503,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed alpha clipping test (comparison was '>', now '>=') - Fixed preview camera (eg. shader graph preview) when path tracing is on - Fixed issue with unclear naming of debug menu for decals. +- Fix issues in the post process system with RenderTexture being invalid in some cases, causing rendering problems. ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs index 75bef7a57a5..4629f347a0e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs @@ -133,6 +133,15 @@ private enum SMAAStage HDRenderPipeline m_HDInstance; + void FillEmptyExposureTexture() + { + var tex = new Texture2D(1, 1, TextureFormat.RGHalf, false, true); + tex.SetPixel(0, 0, new Color(1f, ColorUtils.ConvertExposureToEV100(1f), 0f, 0f)); + tex.Apply(); + Graphics.Blit(tex, m_EmptyExposureTexture); + CoreUtils.Destroy(tex); + } + public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) { m_Resources = defaultResources; @@ -206,11 +215,7 @@ public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources // TODO: Write a version that uses structured buffer instead of texture to do atomic as Metal doesn't support atomics on textures. m_MotionBlurSupportsScattering = m_MotionBlurSupportsScattering && (SystemInfo.graphicsDeviceType != GraphicsDeviceType.Metal); - var tex = new Texture2D(1, 1, TextureFormat.RGHalf, false, true); - tex.SetPixel(0, 0, new Color(1f, ColorUtils.ConvertExposureToEV100(1f), 0f, 0f)); - tex.Apply(); - Graphics.Blit(tex, m_EmptyExposureTexture); - CoreUtils.Destroy(tex); + FillEmptyExposureTexture(); // Initialize our target pool to ease RT management m_Pool = new TargetPool(); @@ -287,6 +292,23 @@ public void Cleanup() m_FarBokehTileList = null; } + // In some cases, the internal buffer of render textures might be invalid. + // Usually when using these textures with API such as SetRenderTarget, they are recreated internally. + // This is not the case when these textures are used exclusively with Compute Shaders. So to make sure they work in this case, we recreate them here. + void CheckRenderTexturesValidity() + { + if (!m_EmptyExposureTexture.rt.IsCreated()) + FillEmptyExposureTexture(); + + HDUtils.CheckRTCreated(m_InternalLogLut.rt); + HDUtils.CheckRTCreated(m_TempTexture1024.rt); + HDUtils.CheckRTCreated(m_TempTexture32.rt); + if (m_KeepAlpha) + { + HDUtils.CheckRTCreated(m_AlphaTexture.rt); + } + } + public void BeginFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline hdInstance) { m_HDInstance = hdInstance; @@ -336,6 +358,8 @@ public void BeginFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline hdIn m_DitheringFS = frameSettings.IsEnabled(FrameSettingsField.Dithering); m_AntialiasingFS = frameSettings.IsEnabled(FrameSettingsField.Antialiasing); + CheckRenderTexturesValidity(); + // Handle fixed exposure & disabled pre-exposure by forcing an exposure multiplier of 1 if (!m_ExposureControlFS) { @@ -2644,7 +2668,11 @@ public RTHandle Get(in Vector2 scaleFactor, GraphicsFormat format, bool mipmap = var hashCode = ComputeHashCode(scaleFactor.x, scaleFactor.y, (int)format, mipmap); if (m_Targets.TryGetValue(hashCode, out var stack) && stack.Count > 0) - return stack.Pop(); + { + var tex = stack.Pop(); + HDUtils.CheckRTCreated(tex.rt); + return tex; + } var rt = RTHandles.Alloc( scaleFactor, TextureXR.slices, DepthBits.None, colorFormat: format, dimension: TextureXR.dimension, From 1a7ff0a2a290b47d8d14cfcde008c0233029a66d Mon Sep 17 00:00:00 2001 From: JulienIgnace-Unity Date: Fri, 3 Apr 2020 12:14:50 +0200 Subject: [PATCH 81/84] Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. #6493 --- .../Editor/Volume/VolumeComponentListEditor.cs | 15 ++++++++++----- .../Runtime/Volume/VolumeProfile.cs | 18 ++++++++++++++++++ .../CHANGELOG.md | 1 + .../Settings/DefaultSettingsPanel.cs | 14 +++++++++++--- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs index f487281dc3c..21a110079a0 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs @@ -16,24 +16,24 @@ namespace UnityEditor.Rendering /// in the inspector: /// /// using UnityEngine.Rendering; - /// + /// /// [CustomEditor(typeof(VolumeProfile))] /// public class CustomVolumeProfileEditor : Editor /// { /// VolumeComponentListEditor m_ComponentList; - /// + /// /// void OnEnable() /// { /// m_ComponentList = new VolumeComponentListEditor(this); /// m_ComponentList.Init(target as VolumeProfile, serializedObject); /// } - /// + /// /// void OnDisable() /// { /// if (m_ComponentList != null) /// m_ComponentList.Clear(); /// } - /// + /// /// public override void OnInspectorGUI() /// { /// serializedObject.Update(); @@ -58,6 +58,8 @@ public sealed class VolumeComponentListEditor Dictionary m_EditorTypes; // Component type => Editor type List m_Editors; + int m_CurrentHashCode; + /// /// Creates a new instance of to use in an /// existing editor. @@ -195,9 +197,12 @@ public void OnGUI() if (asset == null) return; - if (asset.isDirty) + // Even if the asset is not dirty, the list of component may have been changed by another inspector. + // In this case, only the hash will tell us that we need to refresh. + if (asset.isDirty || asset.GetHashCode() != m_CurrentHashCode) { RefreshEditors(); + m_CurrentHashCode = asset.GetHashCode(); asset.isDirty = false; } diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs index 9b354b47598..198a44af7ac 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs @@ -279,5 +279,23 @@ public bool TryGetAllSubclassOf(Type type, List result) return count != result.Count; } + + + /// + /// A custom hashing function that Unity uses to compare the state of parameters. + /// + /// A computed hash code for the current instance. + public override int GetHashCode() + { + unchecked + { + int hash = 17; + + for (int i = 0; i < components.Count; i++) + hash = hash * 23 + components[i].GetHashCode(); + + return hash; + } + } } } diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index dd9378288d0..4c4d44fe37a 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). - Fixed an usage of a a compute buffer not bound (1229964) - Fixed an issue where unncessarily serialized members in StaticLightingSky component would change each time the scene is changed. +- Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs index 1018c140941..b244d14d284 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs @@ -45,6 +45,7 @@ public class Styles ReorderableList m_BeforeTransparentCustomPostProcesses; ReorderableList m_BeforePostProcessCustomPostProcesses; ReorderableList m_AfterPostProcessCustomPostProcesses; + int m_CurrentVolumeProfileHash; public void OnGUI(string searchContext) { @@ -207,6 +208,13 @@ void Draw_VolumeInspector() } EditorGUILayout.EndHorizontal(); + // The state of the profile can change without the asset reference changing so in this case we need to reset the editor. + if (m_CurrentVolumeProfileHash != asset.GetHashCode() && m_CachedDefaultVolumeProfileEditor != null) + { + m_CurrentVolumeProfileHash = asset.GetHashCode(); + m_CachedDefaultVolumeProfileEditor = null; + } + Editor.CreateCachedEditor(asset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedDefaultVolumeProfileEditor); EditorGUIUtility.labelWidth -= 18; bool oldEnabled = GUI.enabled; @@ -230,13 +238,13 @@ void Draw_VolumeInspector() hdrpAsset.defaultLookDevProfile = newLookDevAsset; EditorUtility.SetDirty(hdrpAsset); } - + if (GUILayout.Button(EditorGUIUtility.TrTextContent("New", "Create a new Volume Profile for default in your default resource folder (defined in Wizard)"), GUILayout.Width(38), GUILayout.Height(18))) { DefaultVolumeProfileCreator.CreateAndAssign(DefaultVolumeProfileCreator.Kind.LookDev); } EditorGUILayout.EndHorizontal(); - + Editor.CreateCachedEditor(lookDevAsset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedLookDevVolumeProfileEditor); EditorGUIUtility.labelWidth -= 18; oldEnabled = GUI.enabled; @@ -311,7 +319,7 @@ static string GetDefaultName(Kind kind) } return defaultName; } - + public static void CreateAndAssign(Kind kind) { var assetCreator = ScriptableObject.CreateInstance(); From 65d0145670b73cb78b7ada01d30f9a3f8493e7a0 Mon Sep 17 00:00:00 2001 From: JordanL8 Date: Thu, 2 Apr 2020 11:15:43 +0100 Subject: [PATCH 82/84] Hdrp/docs/glossary f number (#6523) * Update Glossary.md * Update Glossary.md --- .../Documentation~/Glossary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Glossary.md b/com.unity.render-pipelines.high-definition/Documentation~/Glossary.md index 93c340fad87..65bbdd53b8e 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Glossary.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Glossary.md @@ -40,7 +40,7 @@ A face refers to one side of a piece of geometry. The front face is the side of #### f-number: -The ratio of the focal length to the diameter of the camera lens. +The ratio of the focal length to the diameter of the camera lens. HDRP technically uses [t-number](https://en.wikipedia.org/wiki/F-number#T-stop), but since Cameras in Unity are optically perfect, f-number and t-number are identical. From 942b3198b09b881c56a0c9141e39304373114533 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Wed, 8 Apr 2020 00:15:55 +0200 Subject: [PATCH 83/84] path validation when creating new volume profile (#36) --- .../Editor/Volume/VolumeProfileFactory.cs | 16 +- .../CHANGELOG.md | 724 ++++++++++-------- 2 files changed, 403 insertions(+), 337 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileFactory.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileFactory.cs index c9eba822995..cf00102a263 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileFactory.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileFactory.cs @@ -56,12 +56,22 @@ public static VolumeProfile CreateVolumeProfile(Scene scene, string targetName) { var scenePath = Path.GetDirectoryName(scene.path); var extPath = scene.name; - var profilePath = scenePath + "/" + extPath; + var profilePath = scenePath + Path.DirectorySeparatorChar + extPath; if (!AssetDatabase.IsValidFolder(profilePath)) - AssetDatabase.CreateFolder(scenePath, extPath); + { + var directories = profilePath.Split(Path.DirectorySeparatorChar); + string rootPath = ""; + foreach (var directory in directories) + { + var newPath = rootPath + directory; + if (!AssetDatabase.IsValidFolder(newPath)) + AssetDatabase.CreateFolder(rootPath.TrimEnd(Path.DirectorySeparatorChar), directory); + rootPath = newPath + Path.DirectorySeparatorChar; + } + } - path = profilePath + "/"; + path = profilePath + Path.DirectorySeparatorChar; } path += targetName + " Profile.asset"; diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 4c4d44fe37a..d3abf8be222 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,18 +6,58 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Add XR setting to control camera jitter for temporal effects #6259 +- Added an error message in the DrawRenderers custom pass when rendering opaque objects with an HDRP asset in DeferredOnly mode. + +### Fixed +- Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. +- Fixed an issue where default volume would not update when switching profile. +- Fixed an issue where AO override would not override specular occlusion. +- Fixed an issue where Volume inspector might not refresh correctly in some cases. +- Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. +- Fixed issue with uncached reflection probe cameras reseting the debug mode (case 1224601) +- Fixed issue with atmospheric fog turning black if a planar reflection probe is placed below ground level. (case 1226588) +- Fix when rescale probe all direction below zero (1219246) +- Fixed issue with resources being accessed before initialization process has been performed completely. +- Fixed render texture with XR +- Fixed sRGB mismatch with XR SDK +- Fixed XR single-pass with Mock HMD plugin +- Fixed XR culling with multiple cameras +- Fixed shadow cascade tooltip when using the metric mode (case 1229232) +- Focus on Decal uses the extends of the projectors +- Fixed how the area light influence volume is computed to match rasterization. +- Fixed usage of light size data that are not available at runtime. +- Fixed light type resolution when performing a reset on HDAdditionalLightData (case 1220931) +- Fixed drag area width at left of Light's intensity field in Inspector. +- Fix for issue that prevented scene from being completely saved when baked reflection probes are present and lighting is set to auto generate. +- Fixed the depth buffer copy made before custom pass after opaque and normal injection point. +- Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). +- Fixed an usage of a a compute buffer not bound (1229964) +- Fixed an issue where unncessarily serialized members in StaticLightingSky component would change each time the scene is changed. +- Fix issues in the post process system with RenderTexture being invalid in some cases, causing rendering problems. +- Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. +- Fixed path validation when creating new volume profile (case 1229933) + +### Changed +- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. +- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. +- Utilities namespace is obsolete, moved its content to UnityEngine.Rendering (case 1204677) +- All custom pass volumes are now executed for one injection point instead of the first one. +- Optimized PrepareLightsForGPU (cost reduced by over 25%) and PrepareGPULightData (around twice as fast now). +- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. +- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. + +## [7.3.0] - 2020-03-11 + ### Added - Added the exposure sliders to the planar reflection probe preview - Added a warning and workaround instructions that appear when you enable XR single-pass after the first frame with the XR SDK. - Added an "enable" toggle to the SSR volume component. -- Added support of cookie baking and add support on Disc light. -- Added XR setting to control camera jitter for temporal effects -- Added an error message in the DrawRenderers custom pass when rendering opaque objects with an HDRP asset in DeferredOnly mode. -- Added option to disable XR rendering on the camera settings. ### Fixed -- Fix Changelog - Fixed issue with AssetPostprocessors dependencies causing models to be imported twice when upgrading the package version. +- Fix player build DX12 - Fix issue with AO being misaligned when multiple view are visible. - Fix issue that caused the clamp of camera rotation motion for motion blur to be ineffective. - Fixed culling of lights with XR SDK @@ -41,100 +81,36 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed invalid game view rendering when disabling all cameras in the scene (case 1105163) - Fixed infinite reload loop while displaying Light's Shadow's Link Light Layer in Inspector of Prefab Asset. - Fixed the cookie atlas size and planar atlas size being too big after an upgrade of the HDRP asset. -- Fix player build DX12 +- Fixed alpha clipping test (comparison was '>', now '>=') +- Fixed preview camera (eg. shader graph preview) when path tracing is on +- Fixed DXR player build - Fixed compilation issue with linux vulkan and raytrace shader - Fixed the HDRP asset migration code not being called after an upgrade of the package - Fixed draw renderers custom pass out of bound exception - Fixed an issue with emissive light meshes not being in the RAS. - Fixed a warning due to StaticLightingSky when reloading domain in some cases. - Fixed the MaxLightCount being displayed when the light volume debug menu is on ColorAndEdge. +- Fix an exception in case two LOD levels are using the same mesh renderer. - Fixed error in the console when switching shader to decal in the material UI. - Fixed z-fighting in scene view when scene lighting is off (case 1203927) -- Fixed issue that prevented cubemap thumbnails from rendering. -- Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. -- Fix some typos in the debug menu. +- Fixed some typos in debug menu (case 1224594) - Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). -- Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. - Fixed cubemap thumbnail generation at project load time. -- Fixed an issue where default volume would not update when switching profile. -- Fixed an issue where AO override would not override specular occlusion. -- Fixed an issue where Volume inspector might not refresh correctly in some cases. - Half fixed shuriken particle light that cast shadows (only the first one will be correct) -- Fixed issue with uncached reflection probe cameras reseting the debug mode (case 1224601) -- Fixed issue with atmospheric fog turning black if a planar reflection probe is placed below ground level. (case 1226588) -- Fix when rescale probe all direction below zero (1219246) -- Fixed issue with resources being accessed before initialization process has been performed completely. -- Fixed render texture with XR -- Fixed sRGB mismatch with XR SDK -- Fixed XR single-pass with Mock HMD plugin -- Fixed XR culling with multiple cameras -- Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. -- Fixed shadow cascade tooltip when using the metric mode (case 1229232) -- Fix when rescale probe all direction below zero (1219246) -- Fixed how the area light influence volume is computed to match rasterization. -- Fixed usage of light size data that are not available at runtime. -- Fixed light type resolution when performing a reset on HDAdditionalLightData (case 1220931) -- Fixed drag area width at left of Light's intensity field in Inspector. -- Fix for issue that prevented scene from being completely saved when baked reflection probes are present and lighting is set to auto generate. -- Fixed the depth buffer copy made before custom pass after opaque and normal injection point. -- Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). -- Fixed an usage of a a compute buffer not bound (1229964) -- Fixed an issue where unncessarily serialized members in StaticLightingSky component would change each time the scene is changed. -- Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. ### Changed - Renamed the cubemap used for diffuse convolution to a more explicit name for the memory profiler. - Light dimmer can now get values higher than one and was renamed to multiplier in the UI. - Removed info box requesting volume component for Visual Environment and updated the documentation with the relevant information. -- Removed legacy VR code - Add range-based clipping to box lights (case 1178780) - Improve area light culling (case 1085873) -- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. -- Renamed "Environment" to "Reflection Probes" in tile/cluster debug menu. - Light Hierarchy debug mode can now adjust Debug Exposure for visualizing high exposure scenes. -- Hidden unsupported choice in emission in Materials -- All custom pass volumes are now executed for one injection point instead of the first one. -- Optimized PrepareLightsForGPU (cost reduced by over 25%) and PrepareGPULightData (around twice as fast now). - Changed the diffusion profile warning on the material to an info and changed the message to be more precise. -- Moved scene view camera settings for HDRP from the preferences window to the scene view camera settings window. -## [8.0.0] - 2020-05-25 +## [7.2.0] - 2020-02-10 ### Added -- Ray tracing support for VR single-pass -- Added sharpen filter shader parameter and UI for TemporalAA to control image quality instead of hardcoded value -- Added frame settings option for custom post process and custom passes as well as custom color buffer format option. -- Add check in wizard on SRP Batcher enabled. -- Added default implementations of OnPreprocessMaterialDescription for FBX, Obj, Sketchup and 3DS file formats. -- Added custom pass fade radius -- Added after post process injection point for custom passes -- Added basic alpha compositing support - Alpha is available afterpostprocess when using FP16 buffer format. -- Added falloff distance on Reflection Probe and Planar Reflection Probe -- Added Backplate projection from the HDRISky -- Added Shadow Matte in UnlitMasterNode, which only received shadow without lighting -- Added hability to name LightLayers in HDRenderPipelineAsset -- Added a range compression factor for Reflection Probe and Planar Reflection Probe to avoid saturation of colors. -- Added path tracing support for directional, point and spot lights, as well as emission from Lit and Unlit. -- Added non temporal version of SSAO. -- Added more detailed ray tracing stats in the debug window -- Added Disc area light (bake only) -- Added a warning in the material UI to prevent transparent + subsurface-scattering combination. -- Added XR single-pass setting into HDRP asset -- Added a penumbra tint option for lights -- Added support for depth copy with XR SDK -- Added debug setting to Render Pipeline Debug Window to list the active XR views -- Added an option to filter the result of the volumetric lighting (off by default). -- Added a transmission multiplier for directional lights -- Added XR single-pass test mode to Render Pipeline Debug Window -- Added debug setting to Render Pipeline Window to list the active XR views -- Added a new refraction mode for the Lit shader (thin). Which is a box refraction with small thickness values -- Added the code to support Barn Doors for Area Lights based on a shaderconfig option. -- Added HDRPCameraBinder property binder for Visual Effect Graph -- Added "Celestial Body" controls to the Directional Light -- Added new parameters to the Physically Based Sky -- Added Reflections to the DXR Wizard - Added the possibility to have ray traced colored and semi-transparent shadows on directional lights. -- Added a check in the custom post process template to throw an error if the default shader is not found. - Exposed the debug overlay ratio in the debug menu. - Added a separate frame settings for tonemapping alongside color grading. - Added the receive fog option in the material UI for ShaderGraphs. @@ -143,7 +119,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added Contrast Adaptive Sharpen (CAS) Upscaling effect. - Added APIs to update probe settings at runtime. - Added documentation for the rayTracingSupported method in HDRP -- Added user-selectable format for the post processing passes. +- Added user-selectable format for the post processing passes. - Added support for alpha channel in some post-processing passes (DoF, TAA, Uber). - Added warnings in FrameSettings inspector when using DXR and atempting to use Asynchronous Execution. - Exposed Stencil bits that can be used by the user. @@ -156,7 +132,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added the alpha clip enabled toggle to the material UI for all HDRP shader graphs. - Added Material Samples to explain how to use the lit shader features - Added an initial implementation of ray traced sub surface scattering -- Added AssetPostprocessors and Shadergraphs to handle Arnold Standard Surface and 3DsMax Physical material import from FBX. +- Added AssetPostprocessors and Shadergraphs to handle Arnold Standard Surface and 3DsMax Physical material import from FBX. - Added support for Smoothness Fade start work when enabling ray traced reflections. - Added Contact shadow, Micro shadows and Screen space refraction API documentation. - Added script documentation for SSR, SSAO (ray tracing), GI, Light Cluster, RayTracingSettings, Ray Counters, etc. @@ -166,223 +142,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Update documentation of HDRISky-Backplate, precise how to have Ambient Occlusion on the Backplate -- Sorting, undo, labels, layout in the Lighting Explorer. -- Fixed sky settings and materials in Shader Graph Samples package -- Fix/workaround a probable graphics driver bug in the GTAO shader. -- Fixed Hair and PBR shader graphs double sided modes -- Fixed an issue where updating an HDRP asset in the Quality setting panel would not recreate the pipeline. -- Fixed issue with point lights being considered even when occupying less than a pixel on screen (case 1183196) -- Fix a potential NaN source with iridescence (case 1183216) -- Fixed issue of spotlight breaking when minimizing the cone angle via the gizmo (case 1178279) -- Fixed issue that caused decals not to modify the roughness in the normal buffer, causing SSR to not behave correctly (case 1178336) -- Fixed lit transparent refraction with XR single-pass rendering -- Removed extra jitter for TemporalAA in VR -- Fixed ShaderGraph time in main preview -- Fixed issue on some UI elements in HDRP asset not expanding when clicking the arrow (case 1178369) -- Fixed alpha blending in custom post process -- Fixed the modification of the _AlphaCutoff property in the material UI when exposed with a ShaderGraph parameter. -- Fixed HDRP test `1218_Lit_DiffusionProfiles` on Vulkan. -- Fixed an issue where building a player in non-dev mode would generate render target error logs every frame -- Fixed crash when upgrading version of HDRP -- Fixed rendering issues with material previews -- Fixed NPE when using light module in Shuriken particle systems (1173348). -- Refresh cached shadow on editor changes -- Fixed light supported units caching (1182266) -- Fixed an issue where SSAO (that needs temporal reprojection) was still being rendered when Motion Vectors were not available (case 1184998) -- Fixed a nullref when modifying the height parameters inside the layered lit shader UI. -- Fixed Decal gizmo that become white after exiting play mode -- Fixed Decal pivot position to behave like a spotlight -- Fixed an issue where using the LightingOverrideMask would break sky reflection for regular cameras -- Fix DebugMenu FrameSettingsHistory persistency on close -- Fix DensityVolume, ReflectionProbe aned PlanarReflectionProbe advancedControl display -- Fix DXR scene serialization in wizard -- Fixed an issue where Previews would reallocate History Buffers every frame -- Fixed the SetLightLayer function in HDAdditionalLightData setting the wrong light layer -- Fix error first time a preview is created for planar -- Fixed an issue where SSR would use an incorrect roughness value on ForwardOnly (StackLit, AxF, Fabric, etc.) materials when the pipeline is configured to also allow deferred Lit. -- Fixed issues with light explorer (cases 1183468, 1183269) -- Fix dot colors in LayeredLit material inspector -- Fix undo not resetting all value when undoing the material affectation in LayerLit material -- Fix for issue that caused gizmos to render in render textures (case 1174395) -- Fixed the light emissive mesh not updated when the light was disabled/enabled -- Fixed light and shadow layer sync when setting the HDAdditionalLightData.lightlayersMask property -- Fixed a nullref when a custom post process component that was in the HDRP PP list is removed from the project -- Fixed issue that prevented decals from modifying specular occlusion (case 1178272). -- Fixed exposure of volumetric reprojection -- Fixed multi selection support for Scalable Settings in lights -- Fixed font shaders in test projects for VR by using a Shader Graph version -- Fixed refresh of baked cubemap by incrementing updateCount at the end of the bake (case 1158677). -- Fixed issue with rectangular area light when seen from the back -- Fixed decals not affecting lightmap/lightprobe -- Fixed zBufferParams with XR single-pass rendering -- Fixed moving objects not rendered in custom passes -- Fixed abstract classes listed in the + menu of the custom pass list -- Fixed custom pass that was rendered in previews -- Fixed precision error in zero value normals when applying decals (case 1181639) -- Fixed issue that triggered No Scene Lighting view in game view as well (case 1156102) -- Assign default volume profile when creating a new HDRP Asset -- Fixed fov to 0 in planar probe breaking the projection matrix (case 1182014) -- Fixed bugs with shadow caching -- Reassign the same camera for a realtime probe face render request to have appropriate history buffer during realtime probe rendering. -- Fixed issue causing wrong shading when normal map mode is Object space, no normal map is set, but a detail map is present (case 1143352) -- Fixed issue with decal and htile optimization -- Fixed TerrainLit shader compilation error regarding `_Control0_TexelSize` redefinition (case 1178480). -- Fixed warning about duplicate HDRuntimeReflectionSystem when configuring play mode without domain reload. -- Fixed an editor crash when multiple decal projectors were selected and some had null material -- Added all relevant fix actions to FixAll button in Wizard -- Moved FixAll button on top of the Wizard -- Fixed an issue where fog color was not pre-exposed correctly -- Fix priority order when custom passes are overlapping -- Fix cleanup not called when the custom pass GameObject is destroyed -- Replaced most instances of GraphicsSettings.renderPipelineAsset by GraphicsSettings.currentRenderPipeline. This should fix some parameters not working on Quality Settings overrides. -- Fixed an issue with Realtime GI not working on upgraded projects. -- Fixed issue with screen space shadows fallback texture was not set as a texture array. -- Fixed Pyramid Lights bounding box -- Fixed terrain heightmap default/null values and epsilons -- Fixed custom post-processing effects breaking when an abstract class inherited from `CustomPostProcessVolumeComponent` -- Fixed XR single-pass rendering in Editor by using ShaderConfig.s_XrMaxViews to allocate matrix array -- Multiple different skies rendered at the same time by different cameras are now handled correctly without flickering -- Fixed flickering issue happening when different volumes have shadow settings and multiple cameras are present. -- Fixed issue causing planar probes to disappear if there is no light in the scene. -- Fixed a number of issues with the prefab isolation mode (Volumes leaking from the main scene and reflection not working properly) -- Fixed an issue with fog volume component upgrade not working properly -- Fixed Spot light Pyramid Shape has shadow artifacts on aspect ratio values lower than 1 -- Fixed issue with AO upsampling in XR -- Fixed camera without HDAdditionalCameraData component not rendering -- Removed the macro ENABLE_RAYTRACING for most of the ray tracing code -- Fixed prefab containing camera reloading in loop while selected in the Project view -- Fixed issue causing NaN wheh the Z scale of an object is set to 0. -- Fixed DXR shader passes attempting to render before pipeline loaded -- Fixed black ambient sky issue when importing a project after deleting Library. -- Fixed issue when upgrading a Standard transparent material (case 1186874) -- Fixed area light cookies not working properly with stack lit -- Fixed material render queue not updated when the shader is changed in the material inspector. -- Fixed a number of issues with full screen debug modes not reseting correctly when setting another mutually exclusive mode -- Fixed compile errors for platforms with no VR support -- Fixed an issue with volumetrics and RTHandle scaling (case 1155236) -- Fixed an issue where sky lighting might be updated uselessly -- Fixed issue preventing to allow setting decal material to none (case 1196129) -- Fixed XR multi-pass decals rendering -- Fixed several fields on Light Inspector that not supported Prefab overrides -- Fixed EOL for some files -- Fixed scene view rendering with volumetrics and XR enabled -- Fixed decals to work with multiple cameras -- Fixed optional clear of GBuffer (Was always on) -- Fixed render target clears with XR single-pass rendering -- Fixed HDRP samples file hierarchy -- Fixed Light units not matching light type -- Fixed QualitySettings panel not displaying HDRP Asset -- Fixed black reflection probes the first time loading a project -- Fixed y-flip in scene view with XR SDK -- Fixed Decal projectors do not immediately respond when parent object layer mask is changed in editor. -- Fixed y-flip in scene view with XR SDK -- Fixed a number of issues with Material Quality setting -- Fixed the transparent Cull Mode option in HD unlit master node settings only visible if double sided is ticked. -- Fixed an issue causing shadowed areas by contact shadows at the edge of far clip plane if contact shadow length is very close to far clip plane. -- Fixed editing a scalable settings will edit all loaded asset in memory instead of targetted asset. -- Fixed Planar reflection default viewer FOV -- Fixed flickering issues when moving the mouse in the editor with ray tracing on. -- Fixed the ShaderGraph main preview being black after switching to SSS in the master node settings -- Fixed custom fullscreen passes in VR -- Fixed camera culling masks not taken in account in custom pass volumes -- Fixed object not drawn in custom pass when using a DrawRenderers with an HDRP shader in a build. -- Fixed injection points for Custom Passes (AfterDepthAndNormal and BeforePreRefraction were missing) -- Fixed a enum to choose shader tags used for drawing objects (DepthPrepass or Forward) when there is no override material. -- Fixed lit objects in the BeforePreRefraction, BeforeTransparent and BeforePostProcess. -- Fixed the None option when binding custom pass render targets to allow binding only depth or color. -- Fixed custom pass buffers allocation so they are not allocated if they're not used. -- Fixed the Custom Pass entry in the volume create asset menu items. -- Fixed Prefab Overrides workflow on Camera. -- Fixed alignment issue in Preset for Camera. -- Fixed alignment issue in Physical part for Camera. -- Fixed FrameSettings multi-edition. -- Fixed a bug happening when denoising multiple ray traced light shadows -- Fixed minor naming issues in ShaderGraph settings -- VFX: Removed z-fight glitches that could appear when using deferred depth prepass and lit quad primitives -- VFX: Preserve specular option for lit outputs (matches HDRP lit shader) -- Fixed an issue with Metal Shader Compiler and GTAO shader for metal -- Fixed resources load issue while upgrading HDRP package. -- Fix LOD fade mask by accounting for field of view -- Fixed spot light missing from ray tracing indirect effects. -- Fixed a UI bug in the diffusion profile list after fixing them from the wizard. -- Fixed the hash collision when creating new diffusion profile assets. -- Fixed a light leaking issue with box light casting shadows (case 1184475) -- Fixed Cookie texture type in the cookie slot of lights (Now displays a warning because it is not supported). -- Fixed a nullref that happens when using the Shuriken particle light module -- Fixed alignment in Wizard -- Fixed text overflow in Wizard's helpbox -- Fixed Wizard button fix all that was not automatically grab all required fixes -- Fixed VR tab for MacOS in Wizard -- Fixed local config package workflow in Wizard -- Fixed issue with contact shadows shifting when MSAA is enabled. -- Fixed EV100 in the PBR sky -- Fixed an issue In URP where sometime the camera is not passed to the volume system and causes a null ref exception (case 1199388) -- Fixed nullref when releasing HDRP with custom pass disabled -- Fixed performance issue derived from copying stencil buffer. -- Fixed an editor freeze when importing a diffusion profile asset from a unity package. -- Fixed an exception when trying to reload a builtin resource. -- Fixed the light type intensity unit reset when switching the light type. -- Fixed compilation error related to define guards and CreateLayoutFromXrSdk() -- Fixed documentation link on CustomPassVolume. -- Fixed player build when HDRP is in the project but not assigned in the graphic settings. -- Fixed an issue where ambient probe would be black for the first face of a baked reflection probe -- VFX: Fixed Missing Reference to Visual Effect Graph Runtime Assembly -- Fixed an issue where rendering done by users in EndCameraRendering would be executed before the main render loop. -- Fixed Prefab Override in main scope of Volume. -- Fixed alignment issue in Presset of main scope of Volume. -- Fixed persistence of ShowChromeGizmo and moved it to toolbar for coherency in ReflectionProbe and PlanarReflectionProbe. -- Fixed Alignement issue in ReflectionProbe and PlanarReflectionProbe. -- Fixed Prefab override workflow issue in ReflectionProbe and PlanarReflectionProbe. -- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in ReflectionProbe and PlanarReflectionProbe. -- Fixed Prefab override workflow issue in DensityVolume. -- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in DensityVolume. -- Fix light limit counts specified on the HDRP asset -- Fixed Quality Settings for SSR, Contact Shadows and Ambient Occlusion volume components -- Fixed decalui deriving from hdshaderui instead of just shaderui -- Use DelayedIntField instead of IntField for scalable settings -- Fixed init of debug for FrameSettingsHistory on SceneView camera -- Added a fix script to handle the warning 'referenced script in (GameObject 'SceneIDMap') is missing' -- Fix Wizard load when none selected for RenderPipelineAsset - Fixed TerrainLitGUI when per-pixel normal property is not present. -- Fixed rendering errors when enabling debug modes with custom passes -- Fix an issue that made PCSS dependent on Atlas resolution (not shadow map res) -- Fixing a bug whith histories when n>4 for ray traced shadows -- Fixing wrong behavior in ray traced shadows for mesh renderers if their cast shadow is shadow only or double sided -- Only tracing rays for shadow if the point is inside the code for spotlight shadows -- Only tracing rays if the point is inside the range for point lights -- Fixing ghosting issues when the screen space shadow indexes change for a light with ray traced shadows -- Fixed an issue with stencil management and Xbox One build that caused corrupted output in deferred mode. -- Fixed a mismatch in behavior between the culling of shadow maps and ray traced point and spot light shadows -- Fixed recursive ray tracing not working anymore after intermediate buffer refactor. -- Fixed ray traced shadow denoising not working (history rejected all the time). -- Fixed shader warning on xbox one -- Fixed cookies not working for spot lights in ray traced reflections, ray traced GI and recursive rendering -- Fixed an inverted handling of CoatSmoothness for SSR in StackLit. -- Fixed missing distortion inputs in Lit and Unlit material UI. -- Fixed issue that propagated NaNs across multiple frames through the exposure texture. -- Fixed issue with Exclude from TAA stencil ignored. -- Fixed ray traced reflection exposure issue. -- Fixed issue with TAA history not initialising corretly scale factor for first frame -- Fixed issue with stencil test of material classification not using the correct Mask (causing false positive and bad performance with forward material in deferred) -- Fixed issue with History not reset when chaning antialiasing mode on camera -- Fixed issue with volumetric data not being initialized if default settings have volumetric and reprojection off. -- Fixed ray tracing reflection denoiser not applied in tier 1 -- Fixed the vibility of ray tracing related methods. -- Fixed the diffusion profile list not saved when clicking the fix button in the material UI. -- Fixed crash when pushing bounce count higher than 1 for ray traced GI or reflections -- Fixed PCSS softness scale so that it better match ray traced reference for punctual lights. -- Fixed exposure management for the path tracer -- Fixed AxF material UI containing two advanced options settings. -- Fixed an issue where cached sky contexts were being destroyed wrongly, breaking lighting in the LookDev -- Fixed issue that clamped PCSS softness too early and not after distance scale. -- Fixed fog affect transparent on HD unlit master node -- Fixed custom post processes re-ordering not saved. -- Fixed NPE when using scalable settings -- Fixed an issue where PBR sky precomputation was reset incorrectly in some cases causing bad performance. - Fixed a bug due to depth history begin overriden too soon -- Fixed CustomPassSampleCameraColor scale issue when called from Before Transparent injection point. -- Fixed corruption of AO in baked probes. -- Fixed issue with upgrade of projects that still had Very High as shadow filtering quality. - Fixed issue that caused Distortion UI to appear in Lit. - Fixed several issues with decal duplicating when editing them. - Fixed initialization of volumetric buffer params (1204159) @@ -418,7 +179,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed shader warning in AO code. - Fixed a warning in simpledenoiser.compute - Fixed tube and rectangle light culling to use their shape instead of their range as a bounding box. -- Fixed caused by using gather on a UINT texture in motion blur. +- Fixed caused by using gather on a UINT texture in motion blur. - Fix issue with ambient occlusion breaking when dynamic resolution is active. - Fixed some possible NaN causes in Depth of Field. - Fixed Custom Pass nullref due to the new Profiling Sample API changes @@ -501,49 +262,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue with MipRatio debug mode showing _DebugMatCapTexture not being set. - Fixed missing initialization of input params in Blit for VR. - Fix Inf source in LTC for area lights. -- Fixed alpha clipping test (comparison was '>', now '>=') -- Fixed preview camera (eg. shader graph preview) when path tracing is on -- Fixed issue with unclear naming of debug menu for decals. -- Fix issues in the post process system with RenderTexture being invalid in some cases, causing rendering problems. ### Changed -- Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled -- Rename Emission Radius to Radius in UI in Point, Spot -- Angular Diameter parameter for directional light is no longuer an advanced property -- DXR: Remove Light Radius and Angular Diamater of Raytrace shadow. Angular Diameter and Radius are used instead. -- Remove MaxSmoothness parameters from UI for point, spot and directional light. The MaxSmoothness is now deduce from Radius Parameters -- DXR: Remove the Ray Tracing Environement Component. Add a Layer Mask to the ray Tracing volume components to define which objects are taken into account for each effect. -- Removed second cubemaps used for shadowing in lookdev -- Disable Physically Based Sky below ground -- Increase max limit of area light and reflection probe to 128 -- Change default texture for detailmap to grey -- Optimize Shadow RT load on Tile based architecture platforms. -- Improved quality of SSAO. -- Moved RequestShadowMapRendering() back to public API. -- Update HDRP DXR Wizard with an option to automatically clone the hdrp config package and setup raytracing to 1 in shaders file. -- Added SceneSelection pass for TerrainLit shader. -- Simplified Light's type API regrouping the logic in one place (Check type in HDAdditionalLightData) -- The support of LOD CrossFade (Dithering transition) in master nodes now required to enable it in the master node settings (Save variant) -- Improved shadow bias, by removing constant depth bias and substituting it with slope-scale bias. -- Fix the default stencil values when a material is created from a SSS ShaderGraph. -- Tweak test asset to be compatible with XR: unlit SG material for canvas and double-side font material -- Slightly tweaked the behaviour of bloom when resolution is low to reduce artifacts. -- Hidden fields in Light Inspector that is not relevant while in BakingOnly mode. -- Changed parametrization of PCSS, now softness is derived from angular diameter (for directional lights) or shape radius (for point/spot lights) and min filter size is now in the [0..1] range. -- Moved the copy of the geometry history buffers to right after the depth mip chain generation. -- Rename "Luminance" to "Nits" in UX for physical light unit -- Rename FrameSettings "SkyLighting" to "SkyReflection" -- Reworked XR automated tests -- The ray traced screen space shadow history for directional, spot and point lights is discarded if the light transform has changed. -- Changed the behavior for ray tracing in case a mesh renderer has both transparent and opaque submeshes. -- Improve history buffer management -- Replaced PlayerSettings.virtualRealitySupported with XRGraphics.tryEnable. -- Remove redundant FrameSettings RealTimePlanarReflection -- Improved a bit the GC calls generated during the rendering. -- Material update is now only triggered when the relevant settings are touched in the shader graph master nodes -- Changed the way Sky Intensity (on Sky volume components) is handled. It's now a combo box where users can choose between Exposure, Multiplier or Lux (for HDRI sky only) instead of both multiplier and exposure being applied all the time. Added a new menu item to convert old profiles. -- Change how method for specular occlusions is decided on inspector shader (Lit, LitTesselation, LayeredLit, LayeredLitTessellation) -- Unlocked SSS, SSR, Motion Vectors and Distortion frame settings for reflections probes. - Hide unused LOD settings in Quality Settings legacy window. - Reduced the constrained distance for temporal reprojection of ray tracing denoising - Removed shadow near plane from the Directional Light Shadow UI. @@ -591,6 +311,342 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Moved BeginCameraRendering callback right before culling. - Changed the visibility of the Indirect Lighting Controller component to public. +## [7.1.8] - 2020-01-20 + +### Fixed +- Fixed white and dark flashes on scenes with very high or very low exposure when Automatic Exposure is being used. +- Fixed memory leak in Sky when in matcap mode. + +### Changed +- On Xbox and PS4 you will also need to download the com.unity.render-pipeline.platform (ps4 or xboxone) package from the appropriate platform developer forum + +## [7.1.7] - 2019-12-11 + +### Added +- Added a check in the custom post process template to throw an error if the default shader is not found. + +### Fixed +- Fixed rendering errors when enabling debug modes with custom passes +- Fix an issue that made PCSS dependent on Atlas resolution (not shadow map res) +- Fixing a bug whith histories when n>4 for ray traced shadows +- Fixing wrong behavior in ray traced shadows for mesh renderers if their cast shadow is shadow only or double sided +- Only tracing rays for shadow if the point is inside the code for spotlight shadows +- Only tracing rays if the point is inside the range for point lights +- Fixing ghosting issues when the screen space shadow indexes change for a light with ray traced shadows +- Fixed an issue with stencil management and Xbox One build that caused corrupted output in deferred mode. +- Fixed a mismatch in behavior between the culling of shadow maps and ray traced point and spot light shadows +- Fixed recursive ray tracing not working anymore after intermediate buffer refactor. +- Fixed ray traced shadow denoising not working (history rejected all the time). +- Fixed shader warning on xbox one +- Fixed cookies not working for spot lights in ray traced reflections, ray traced GI and recursive rendering +- Fixed an inverted handling of CoatSmoothness for SSR in StackLit. +- Fixed missing distortion inputs in Lit and Unlit material UI. +- Fixed issue that propagated NaNs across multiple frames through the exposure texture. +- Fixed issue with Exclude from TAA stencil ignored. +- Fixed ray traced reflection exposure issue. +- Fixed issue with TAA history not initialising corretly scale factor for first frame +- Fixed issue with stencil test of material classification not using the correct Mask (causing false positive and bad performance with forward material in deferred) +- Fixed issue with History not reset when chaning antialiasing mode on camera +- Fixed issue with volumetric data not being initialized if default settings have volumetric and reprojection off. +- Fixed ray tracing reflection denoiser not applied in tier 1 +- Fixed the vibility of ray tracing related methods. +- Fixed the diffusion profile list not saved when clicking the fix button in the material UI. +- Fixed crash when pushing bounce count higher than 1 for ray traced GI or reflections +- Fixed PCSS softness scale so that it better match ray traced reference for punctual lights. +- Fixed exposure management for the path tracer +- Fixed AxF material UI containing two advanced options settings. +- Fixed an issue where cached sky contexts were being destroyed wrongly, breaking lighting in the LookDev +- Fixed issue that clamped PCSS softness too early and not after distance scale. +- Fixed fog affect transparent on HD unlit master node +- Fixed custom post processes re-ordering not saved. +- Fixed NPE when using scalable settings +- Fixed an issue where PBR sky precomputation was reset incorrectly in some cases causing bad performance. +- Fixed a bug in dxr due to depth history begin overriden too soon +- Fixed CustomPassSampleCameraColor scale issue when called from Before Transparent injection point. +- Fixed corruption of AO in baked probes. +- Fixed issue with upgrade of projects that still had Very High as shadow filtering quality. +- Removed shadow near plane from the Directional Light Shadow UI. +- Fixed performance issue with performances of custom pass culling. + +## [7.1.6] - 2019-11-22 + +### Added +- Added Backplate projection from the HDRISky +- Added Shadow Matte in UnlitMasterNode, which only received shadow without lighting +- Added support for depth copy with XR SDK +- Added debug setting to Render Pipeline Debug Window to list the active XR views +- Added an option to filter the result of the volumetric lighting (off by default). +- Added a transmission multiplier for directional lights +- Added XR single-pass test mode to Render Pipeline Debug Window +- Added debug setting to Render Pipeline Window to list the active XR views +- Added a new refraction mode for the Lit shader (thin). Which is a box refraction with small thickness values +- Added the code to support Barn Doors for Area Lights based on a shaderconfig option. +- Added HDRPCameraBinder property binder for Visual Effect Graph +- Added "Celestial Body" controls to the Directional Light +- Added new parameters to the Physically Based Sky +- Added Reflections to the DXR Wizard + +### Fixed +- Fixed y-flip in scene view with XR SDK +- Fixed Decal projectors do not immediately respond when parent object layer mask is changed in editor. +- Fixed y-flip in scene view with XR SDK +- Fixed a number of issues with Material Quality setting +- Fixed the transparent Cull Mode option in HD unlit master node settings only visible if double sided is ticked. +- Fixed an issue causing shadowed areas by contact shadows at the edge of far clip plane if contact shadow length is very close to far clip plane. +- Fixed editing a scalable settings will edit all loaded asset in memory instead of targetted asset. +- Fixed Planar reflection default viewer FOV +- Fixed flickering issues when moving the mouse in the editor with ray tracing on. +- Fixed the ShaderGraph main preview being black after switching to SSS in the master node settings +- Fixed custom fullscreen passes in VR +- Fixed camera culling masks not taken in account in custom pass volumes +- Fixed object not drawn in custom pass when using a DrawRenderers with an HDRP shader in a build. +- Fixed injection points for Custom Passes (AfterDepthAndNormal and BeforePreRefraction were missing) +- Fixed a enum to choose shader tags used for drawing objects (DepthPrepass or Forward) when there is no override material. +- Fixed lit objects in the BeforePreRefraction, BeforeTransparent and BeforePostProcess. +- Fixed the None option when binding custom pass render targets to allow binding only depth or color. +- Fixed custom pass buffers allocation so they are not allocated if they're not used. +- Fixed the Custom Pass entry in the volume create asset menu items. +- Fixed Prefab Overrides workflow on Camera. +- Fixed alignment issue in Preset for Camera. +- Fixed alignment issue in Physical part for Camera. +- Fixed FrameSettings multi-edition. +- Fixed a bug happening when denoising multiple ray traced light shadows +- Fixed minor naming issues in ShaderGraph settings +- Fixed an issue with Metal Shader Compiler and GTAO shader for metal +- Fixed resources load issue while upgrading HDRP package. +- Fixed LOD fade mask by accounting for field of view +- Fixed spot light missing from ray tracing indirect effects. +- Fixed a UI bug in the diffusion profile list after fixing them from the wizard. +- Fixed the hash collision when creating new diffusion profile assets. +- Fixed a light leaking issue with box light casting shadows (case 1184475) +- Fixed Cookie texture type in the cookie slot of lights (Now displays a warning because it is not supported). +- Fixed a nullref that happens when using the Shuriken particle light module +- Fixed alignment in Wizard +- Fixed text overflow in Wizard's helpbox +- Fixed Wizard button fix all that was not automatically grab all required fixes +- Fixed VR tab for MacOS in Wizard +- Fixed local config package workflow in Wizard +- Fixed issue with contact shadows shifting when MSAA is enabled. +- Fixed EV100 in the PBR sky +- Fixed an issue In URP where sometime the camera is not passed to the volume system and causes a null ref exception (case 1199388) +- Fixed nullref when releasing HDRP with custom pass disabled +- Fixed performance issue derived from copying stencil buffer. +- Fixed an editor freeze when importing a diffusion profile asset from a unity package. +- Fixed an exception when trying to reload a builtin resource. +- Fixed the light type intensity unit reset when switching the light type. +- Fixed compilation error related to define guards and CreateLayoutFromXrSdk() +- Fixed documentation link on CustomPassVolume. +- Fixed player build when HDRP is in the project but not assigned in the graphic settings. +- Fixed an issue where ambient probe would be black for the first face of a baked reflection probe +- VFX: Fixed Missing Reference to Visual Effect Graph Runtime Assembly +- Fixed an issue where rendering done by users in EndCameraRendering would be executed before the main render loop. +- Fixed Prefab Override in main scope of Volume. +- Fixed alignment issue in Presset of main scope of Volume. +- Fixed persistence of ShowChromeGizmo and moved it to toolbar for coherency in ReflectionProbe and PlanarReflectionProbe. +- Fixed Alignement issue in ReflectionProbe and PlanarReflectionProbe. +- Fixed Prefab override workflow issue in ReflectionProbe and PlanarReflectionProbe. +- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in ReflectionProbe and PlanarReflectionProbe. +- Fixed Prefab override workflow issue in DensityVolume. +- Fixed empty MoreOptions and moved AdvancedManipulation in a dedicated location for coherency in DensityVolume. +- Fix light limit counts specified on the HDRP asset +- Fixed Quality Settings for SSR, Contact Shadows and Ambient Occlusion volume components +- Fixed decalui deriving from hdshaderui instead of just shaderui +- Use DelayedIntField instead of IntField for scalable settings + +### Changed +- Reworked XR automated tests +- The ray traced screen space shadow history for directional, spot and point lights is discarded if the light transform has changed. +- Changed the behavior for ray tracing in case a mesh renderer has both transparent and opaque submeshes. +- Improve history buffer management +- Replaced PlayerSettings.virtualRealitySupported with XRGraphics.tryEnable. +- Remove redundant FrameSettings RealTimePlanarReflection +- Improved a bit the GC calls generated during the rendering. +- Material update is now only triggered when the relevant settings are touched in the shader graph master nodes +- Changed the way Sky Intensity (on Sky volume components) is handled. It's now a combo box where users can choose between Exposure, Multiplier or Lux (for HDRI sky only) instead of both multiplier and exposure being applied all the time. Added a new menu item to convert old profiles. +- Change how method for specular occlusions is decided on inspector shader (Lit, LitTesselation, LayeredLit, LayeredLitTessellation) +- Unlocked SSS, SSR, Motion Vectors and Distortion frame settings for reflections probes. + +## [7.1.5] - 2019-11-15 + +### Fixed +- Fixed black reflection probes the first time loading a project + +## [7.1.4] - 2019-11-13 + +### Added +- Added XR single-pass setting into HDRP asset +- Added a penumbra tint option for lights + +### Fixed +- Fixed EOL for some files +- Fixed scene view rendering with volumetrics and XR enabled +- Fixed decals to work with multiple cameras +- Fixed optional clear of GBuffer (Was always on) +- Fixed render target clears with XR single-pass rendering +- Fixed HDRP samples file hierarchy +- Fixed Light units not matching light type +- Fixed QualitySettings panel not displaying HDRP Asset + +### Changed +- Changed parametrization of PCSS, now softness is derived from angular diameter (for directional lights) or shape radius (for point/spot lights) and min filter size is now in the [0..1] range. +- Moved the copy of the geometry history buffers to right after the depth mip chain generation. +- Rename "Luminance" to "Nits" in UX for physical light unit +- Rename FrameSettings "SkyLighting" to "SkyReflection" + +## [7.1.3] - 2019-11-04 + +### Added +- Ray tracing support for VR single-pass +- Added sharpen filter shader parameter and UI for TemporalAA to control image quality instead of hardcoded value +- Added frame settings option for custom post process and custom passes as well as custom color buffer format option. +- Add check in wizard on SRP Batcher enabled. +- Added default implementations of OnPreprocessMaterialDescription for FBX, Obj, Sketchup and 3DS file formats. +- Added custom pass fade radius +- Added after post process injection point for custom passes +- Added basic alpha compositing support - Alpha is available afterpostprocess when using FP16 buffer format. +- Added falloff distance on Reflection Probe and Planar Reflection Probe +- Added hability to name LightLayers in HDRenderPipelineAsset +- Added a range compression factor for Reflection Probe and Planar Reflection Probe to avoid saturation of colors. +- Added path tracing support for directional, point and spot lights, as well as emission from Lit and Unlit. +- Added non temporal version of SSAO. +- Added more detailed ray tracing stats in the debug window +- Added Disc area light (bake only) +- Added a warning in the material UI to prevent transparent + subsurface-scattering combination. + +### Fixed +- Sorting, undo, labels, layout in the Lighting Explorer. +- Fixed sky settings and materials in Shader Graph Samples package +- Fixed light supported units caching (1182266) +- Fixed an issue where SSAO (that needs temporal reprojection) was still being rendered when Motion Vectors were not available (case 1184998) +- Fixed a nullref when modifying the height parameters inside the layered lit shader UI. +- Fixed Decal gizmo that become white after exiting play mode +- Fixed Decal pivot position to behave like a spotlight +- Fixed an issue where using the LightingOverrideMask would break sky reflection for regular cameras +- Fix DebugMenu FrameSettingsHistory persistency on close +- Fix DensityVolume, ReflectionProbe aned PlanarReflectionProbe advancedControl display +- Fix DXR scene serialization in wizard +- Fixed an issue where Previews would reallocate History Buffers every frame +- Fixed the SetLightLayer function in HDAdditionalLightData setting the wrong light layer +- Fix error first time a preview is created for planar +- Fixed an issue where SSR would use an incorrect roughness value on ForwardOnly (StackLit, AxF, Fabric, etc.) materials when the pipeline is configured to also allow deferred Lit. +- Fixed issues with light explorer (cases 1183468, 1183269) +- Fix dot colors in LayeredLit material inspector +- Fix undo not resetting all value when undoing the material affectation in LayerLit material +- Fix for issue that caused gizmos to render in render textures (case 1174395) +- Fixed the light emissive mesh not updated when the light was disabled/enabled +- Fixed light and shadow layer sync when setting the HDAdditionalLightData.lightlayersMask property +- Fixed a nullref when a custom post process component that was in the HDRP PP list is removed from the project +- Fixed issue that prevented decals from modifying specular occlusion (case 1178272). +- Fixed exposure of volumetric reprojection +- Fixed multi selection support for Scalable Settings in lights +- Fixed font shaders in test projects for VR by using a Shader Graph version +- Fixed refresh of baked cubemap by incrementing updateCount at the end of the bake (case 1158677). +- Fixed issue with rectangular area light when seen from the back +- Fixed decals not affecting lightmap/lightprobe +- Fixed zBufferParams with XR single-pass rendering +- Fixed moving objects not rendered in custom passes +- Fixed abstract classes listed in the + menu of the custom pass list +- Fixed custom pass that was rendered in previews +- Fixed precision error in zero value normals when applying decals (case 1181639) +- Fixed issue that triggered No Scene Lighting view in game view as well (case 1156102) +- Assign default volume profile when creating a new HDRP Asset +- Fixed fov to 0 in planar probe breaking the projection matrix (case 1182014) +- Fixed bugs with shadow caching +- Reassign the same camera for a realtime probe face render request to have appropriate history buffer during realtime probe rendering. +- Fixed issue causing wrong shading when normal map mode is Object space, no normal map is set, but a detail map is present (case 1143352) +- Fixed issue with decal and htile optimization +- Fixed TerrainLit shader compilation error regarding `_Control0_TexelSize` redefinition (case 1178480). +- Fixed warning about duplicate HDRuntimeReflectionSystem when configuring play mode without domain reload. +- Fixed an editor crash when multiple decal projectors were selected and some had null material +- Added all relevant fix actions to FixAll button in Wizard +- Moved FixAll button on top of the Wizard +- Fixed an issue where fog color was not pre-exposed correctly +- Fix priority order when custom passes are overlapping +- Fix cleanup not called when the custom pass GameObject is destroyed +- Replaced most instances of GraphicsSettings.renderPipelineAsset by GraphicsSettings.currentRenderPipeline. This should fix some parameters not working on Quality Settings overrides. +- Fixed an issue with Realtime GI not working on upgraded projects. +- Fixed issue with screen space shadows fallback texture was not set as a texture array. +- Fixed Pyramid Lights bounding box +- Fixed terrain heightmap default/null values and epsilons +- Fixed custom post-processing effects breaking when an abstract class inherited from `CustomPostProcessVolumeComponent` +- Fixed XR single-pass rendering in Editor by using ShaderConfig.s_XrMaxViews to allocate matrix array +- Multiple different skies rendered at the same time by different cameras are now handled correctly without flickering +- Fixed flickering issue happening when different volumes have shadow settings and multiple cameras are present. +- Fixed issue causing planar probes to disappear if there is no light in the scene. +- Fixed a number of issues with the prefab isolation mode (Volumes leaking from the main scene and reflection not working properly) +- Fixed an issue with fog volume component upgrade not working properly +- Fixed Spot light Pyramid Shape has shadow artifacts on aspect ratio values lower than 1 +- Fixed issue with AO upsampling in XR +- Fixed camera without HDAdditionalCameraData component not rendering +- Removed the macro ENABLE_RAYTRACING for most of the ray tracing code +- Fixed prefab containing camera reloading in loop while selected in the Project view +- Fixed issue causing NaN wheh the Z scale of an object is set to 0. +- Fixed DXR shader passes attempting to render before pipeline loaded +- Fixed black ambient sky issue when importing a project after deleting Library. +- Fixed issue when upgrading a Standard transparent material (case 1186874) +- Fixed area light cookies not working properly with stack lit +- Fixed material render queue not updated when the shader is changed in the material inspector. +- Fixed a number of issues with full screen debug modes not reseting correctly when setting another mutually exclusive mode +- Fixed compile errors for platforms with no VR support +- Fixed an issue with volumetrics and RTHandle scaling (case 1155236) +- Fixed an issue where sky lighting might be updated uselessly +- Fixed issue preventing to allow setting decal material to none (case 1196129) +- Fixed XR multi-pass decals rendering +- Fixed several fields on Light Inspector that not supported Prefab overrides +- VFX: Removed z-fight glitches that could appear when using deferred depth prepass and lit quad primitives +- VFX: Preserve specular option for lit outputs (matches HDRP lit shader) +- Fixed init of debug for FrameSettingsHistory on SceneView camera +- Added a fix script to handle the warning 'referenced script in (GameObject 'SceneIDMap') is missing' +- Fix Wizard load when none selected for RenderPipelineAsset +- Fixed issue with unclear naming of debug menu for decals. + +### Changed +- Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled +- Rename Emission Radius to Radius in UI in Point, Spot +- Angular Diameter parameter for directional light is no longuer an advanced property +- DXR: Remove Light Radius and Angular Diamater of Raytrace shadow. Angular Diameter and Radius are used instead. +- Remove MaxSmoothness parameters from UI for point, spot and directional light. The MaxSmoothness is now deduce from Radius Parameters +- DXR: Remove the Ray Tracing Environement Component. Add a Layer Mask to the ray Tracing volume components to define which objects are taken into account for each effect. +- Removed second cubemaps used for shadowing in lookdev +- Disable Physically Based Sky below ground +- Increase max limit of area light and reflection probe to 128 +- Change default texture for detailmap to grey +- Optimize Shadow RT load on Tile based architecture platforms. +- Improved quality of SSAO. +- Moved RequestShadowMapRendering() back to public API. +- Update HDRP DXR Wizard with an option to automatically clone the hdrp config package and setup raytracing to 1 in shaders file. +- Added SceneSelection pass for TerrainLit shader. +- Simplified Light's type API regrouping the logic in one place (Check type in HDAdditionalLightData) +- The support of LOD CrossFade (Dithering transition) in master nodes now required to enable it in the master node settings (Save variant) +- Improved shadow bias, by removing constant depth bias and substituting it with slope-scale bias. +- Fix the default stencil values when a material is created from a SSS ShaderGraph. +- Tweak test asset to be compatible with XR: unlit SG material for canvas and double-side font material +- Slightly tweaked the behaviour of bloom when resolution is low to reduce artifacts. +- Hidden fields in Light Inspector that is not relevant while in BakingOnly mode. + +## [7.1.2] - 2019-09-19 + +### Fixed +- Fix/workaround a probable graphics driver bug in the GTAO shader. +- Fixed Hair and PBR shader graphs double sided modes +- Fixed an issue where updating an HDRP asset in the Quality setting panel would not recreate the pipeline. +- Fixed issue with point lights being considered even when occupying less than a pixel on screen (case 1183196) +- Fix a potential NaN source with iridescence (case 1183216) +- Fixed issue of spotlight breaking when minimizing the cone angle via the gizmo (case 1178279) +- Fixed issue that caused decals not to modify the roughness in the normal buffer, causing SSR to not behave correctly (case 1178336) +- Fixed lit transparent refraction with XR single-pass rendering +- Removed extra jitter for TemporalAA in VR +- Fixed ShaderGraph time in main preview +- Fixed issue on some UI elements in HDRP asset not expanding when clicking the arrow (case 1178369) +- Fixed alpha blending in custom post process +- Fixed the modification of the _AlphaCutoff property in the material UI when exposed with a ShaderGraph parameter. +- Fixed HDRP test `1218_Lit_DiffusionProfiles` on Vulkan. +- Fixed an issue where building a player in non-dev mode would generate render target error logs every frame +- Fixed crash when upgrading version of HDRP +- Fixed rendering issues with material previews +- Fixed NPE when using light module in Shuriken particle systems (1173348). +- Refresh cached shadow on editor changes + ## [7.1.1] - 2019-09-05 ### Added From d15725c9274ce79b12268496fcbb9f1280100c24 Mon Sep 17 00:00:00 2001 From: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Date: Tue, 7 Apr 2020 19:32:29 +0200 Subject: [PATCH 84/84] Clamp probes compression factor to 0 #19 --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Utilities/ProbeSettings.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index d3abf8be222..95651cd1f71 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix issues in the post process system with RenderTexture being invalid in some cases, causing rendering problems. - Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. - Fixed path validation when creating new volume profile (case 1229933) +- Fix for range compression factor for probes going negative (now clamped to positive values). ### Changed - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs index 23499318e19..23360c346f5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs @@ -137,6 +137,7 @@ public struct Lighting public float fadeDistance; /// The result of the rendering of the probe will be divided by this factor. When the probe is read, this factor is undone as the probe data is read. /// This is to simply avoid issues with values clamping due to precision of the storing format. + [Min(1e-6f)] public float rangeCompressionFactor; }