Skip to content

Commit 1fb6334

Browse files
sebastienlagardealelievrFrancescoC-unityadrien-de-tocquevillepmavridis
committed
Merge Hd/bugfix (#2928)
* [HDRP] Fix coat normal space (#2888) * Fix coat normal space * Update CHANGELOG.md Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com> * Avoid issues causing faulty transitions in shadows (resulting in no shadows with unconventional aspect ratio) (#2776) * Fixed volume component tooltips using the same parameter name (#2754) * Use the proper history info for Bicubic resampling in TAA (#2759) * Use proper info for previous buffer info * changelog * Fixed lookdev movement (#2757) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Fix issue with saving some quality settings in volume overrides (#2758) * Fix issue with saving some quality settings volume overrides * Fix typo in changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Fixed NullReferenceException in HDRenderPipeline.UpgradeResourcesIfNeeded (case 1292524) (#2765) * fix issue with confusing text (#2766) * Fix * Fix white dots * Changelog * Rename the sunrise icon to fix typo, causing issue with 2x resolution loading. (#2809) * [HDRP] Rename HDRP to HD Render Pipeline in menu item (#2819) * [HDRP] Update HDRP menu in shader graph * Update CHANGELOG.md * HDRP/Fix package version showing package after the last "verified" package (#2783) * Fix typo * Remove last version checker from wizard and add link to package manager instead * Update CHANGELOG.md * Update documentation * Update Render-Pipeline-Wizard.md Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com> * Revert bad changelog merge * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com> Co-authored-by: sebastienlagarde <sebastien@unity3d.com> Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com> Co-authored-by: John Parsaie <johnpa@unity3d.com> Co-authored-by: Remi Slysz <40034005+RSlysz@users.noreply.github.com> * Fixed invalid loop length for probe baking (case 1289680) (#2830) * Fixed invalid loop length for probe baking (case 1289680) # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md * Update CHANGELOG.md Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix volumetric fog with XR single-pass (#2823) * fix volumetric fog with XR single-pass rendering * update changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Fix rendering issues for the first frame (#2836) * Fix first frame exposure, depth pyramid / AO * Update changelog * Comment * Typo * Add missing RenderGraphBuilder.ReadTexture call * Move ComputePackedMipChainInfo at the beginning of ExecuteWithRenderGraph Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Update 5001_Fog_FogFallback.png * Revert "Update 5001_Fog_FogFallback.png" This reverts commit 2653b9c. * Update 5001_Fog_FogFallback.unity * Fix AOV API for render graph (#2909) * Fix AOV api in rendergraph # Conflicts: # com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs * Update changelog * Fix a small discrepancy in the marker placement in light intensity sliders (#2924) * Update CHANGELOG.md * Fix issue with VT spewing errors when transparent and opaque are disabled (#2925) * Fix * Changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed a bug in the sphere-aabb light cluster (case 1294767). (#2920) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Move EndCameraRendering callback out of the profiling scope (#2917) * Move EndCameraRendering callback out of the profiling scope * added a comment Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed baked light being included into the ray tracing light cluster (case 1296203). (#2915) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Handle all enums the same way for UI (#2913) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Changed the message when the graphics device doesn't support ray tracing (case 1287355). (#2916) * [HDRP] Fix default blocks for Hair and Eye shader graphs (#2919) * Fixed default eye shader blocks * Fix missing emission block in hair shader * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Init scene camera debug framesettings (#2931) * Fixed using the wrong method to define if a light should be included in the light cluster depending on its baking status. (#2932) * - Fixed using the wrong method to define if a light should be included in the light cluster depending on its baking status. * Update CHANGELOG.md Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [HDRP] Change the behavior of custom passes when the volume is disabled (#2930) * Changed the behavior of custom passes when the Custom Pass Volume component is disabled * Updated changelog * Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels (#2921) * Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels * Update changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed an issue when trying to open a look dev env library when Look Dev is not supported. (#2929) * Fixed an issue when trying to open a look dev env library when Look Dev is not supported. * Update changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Enable Reflector for Spotlight by default * - Fixed shader graph not supporting indirectdxr multibounce (case 1294694). (#2933) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed the planar depth texture not being properly created and rendered to (case 1299617). (#2926) * Fixed the planar depth texture not being properly created and rendered to (case 1299617). * adding comment Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed C# 8 compilation issue with turning on nullable checks (case 1300167) (#2949) * Fixed C# 8 compilation issue with turning on nullable checks - bis (#2951) * Fixed C# 8 compilation issue with turning on nullable checks (case 1300167) * Update MaterialDebug.cs * Fix scripting light test with enableReflector true by default * Fixed affects AO for deacl materials (#2950) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fixed case where material keywords would not get setup before usage (#2961) * Update CHANGELOG.md Co-authored-by: Antoine Lelievre <antoinel@unity3d.com> Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com> Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com> Co-authored-by: John Parsaie <johnpa@unity3d.com> Co-authored-by: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Co-authored-by: Frédéric Vauchelles <55485372+fredericv-unity3d@users.noreply.github.com> Co-authored-by: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com> Co-authored-by: JulienIgnace-Unity <julien@unity3d.com>
1 parent 718f456 commit 1fb6334

File tree

25 files changed

+159
-92
lines changed

25 files changed

+159
-92
lines changed

com.unity.render-pipelines.core/Editor/LookDev/EnvironmentLibrary.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using UnityEngine.UIElements;
66
using System.IO;
7+
using UnityEditor;
78
using UnityEditor.UIElements;
89

910
namespace UnityEditor.Rendering.LookDev
@@ -117,26 +118,38 @@ public int IndexOf(Environment environment)
117118
[CustomEditor(typeof(EnvironmentLibrary))]
118119
class EnvironmentLibraryEditor : Editor
119120
{
120-
VisualElement root;
121+
VisualElement m_Root;
122+
VisualElement m_OpenButton;
121123

122124
public sealed override VisualElement CreateInspectorGUI()
123125
{
124126
var library = target as EnvironmentLibrary;
125-
root = new VisualElement();
127+
m_Root = new VisualElement();
126128

127-
Button open = new Button(() =>
129+
m_OpenButton = new Button(() =>
128130
{
129131
if (!LookDev.open)
130132
LookDev.Open();
131133
LookDev.currentContext.UpdateEnvironmentLibrary(library);
132134
LookDev.currentEnvironmentDisplayer.Repaint();
133135
})
134136
{
135-
text = "Open in LookDev window"
137+
text = "Open in Look Dev window"
136138
};
139+
m_OpenButton.SetEnabled(LookDev.supported);
137140

138-
root.Add(open);
139-
return root;
141+
m_Root.Add(m_OpenButton);
142+
return m_Root;
143+
}
144+
145+
void OnEnable() => EditorApplication.update += Update;
146+
void OnDisable() => EditorApplication.update -= Update;
147+
148+
void Update()
149+
{
150+
// Current SRP can be changed at any time so we need to do this at every update.
151+
if (m_OpenButton != null)
152+
m_OpenButton.SetEnabled(LookDev.supported);
140153
}
141154

142155
// Don't use ImGUI

com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ bool IntersectRayCone(float3 rayOrigin, float3 rayDirection,
182182
return hit;
183183
}
184184

185+
bool IntersectSphereAABB(float3 position, float radius, float3 aabbMin, float3 aabbMax)
186+
{
187+
float x = max(aabbMin.x, min(position.x, aabbMax.x));
188+
float y = max(aabbMin.y, min(position.y, aabbMax.y));
189+
float z = max(aabbMin.z, min(position.z, aabbMax.z));
190+
float distance2 = ((x - position.x) * (x - position.x) + (y - position.y) * (y - position.y) + (z - position.z) * (z - position.z));
191+
return distance2 < radius * radius;
192+
}
193+
185194
//-----------------------------------------------------------------------------
186195
// Miscellaneous functions
187196
//-----------------------------------------------------------------------------

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5151
- Fixed NullPointerException when baking probes from the lighting window (case 1289680)
5252
- Fixed volumetric fog with XR single-pass rendering.
5353
- Fixed issues with first frame rendering when RenderGraph is used (auto exposure, AO)
54+
- Fixed AOV api in render graph (case 1296605)
55+
- Fixed a small discrepancy in the marker placement in light intensity sliders (case 1299750)
56+
- Fixed issue with VT resolve pass rendergraph errors when opaque and transparent are disabled in frame settings.
57+
- Fixed a bug in the sphere-aabb light cluster (case 1294767).
58+
- Fixed issue when submitting SRPContext during EndCameraRendering.
59+
- Fixed baked light being included into the ray tracing light cluster (case 1296203).
60+
- Fixed enums UI for the shadergraph nodes.
61+
- Fixed ShaderGraph stack blocks appearing when opening the settings in Hair and Eye ShaderGraphs.
62+
- Fixed white screen when undoing in the editor.
63+
- Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels
64+
- Fixed an issue when trying to open a look dev env library when Look Dev is not supported.
65+
- Fixed shader graph not supporting indirectdxr multibounce (case 1294694).
66+
- Fixed the planar depth texture not being properly created and rendered to (case 1299617).
67+
- Fixed C# 8 compilation issue with turning on nullable checks (case 1300167)
68+
- Fixed affects AO for deacl materials.
69+
- Fixed case where material keywords would not get setup before usage.
5470

5571
### Changed
5672
- Rename HDRP sub menu in Assets/Create/Shader to HD Render Pipeline for consistency.
5773
- Replaced last package version checker in Wizard to a link on Package Manager
74+
- Changed the message when the graphics device doesn't support ray tracing (case 1287355).
75+
- When a Custom Pass Volume is disabled, the custom pass Cleanup() function is called, it allows to release resources when the volume isn't used anymore.
76+
- Enable Reflector for Spotlight by default
5877

5978
## [10.2.1] - 2020-11-30
6079

com.unity.render-pipelines.high-definition/Editor/AssetProcessors/MaterialPostProcessor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
157157
//due to FB 1175514, this not work. It is being fixed though.
158158
//delayed call of the following work in some case and cause infinite loop in other cases.
159159
AssetDatabase.AddObjectToAsset(assetVersion, asset);
160+
161+
// Init material in case it's used before an inspector window is opened
162+
HDShaderUtils.ResetMaterialKeywords(material);
160163
}
161164
else
162165
{

com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static class SliderConfig
2121
public const float k_MarkerHeight = 2;
2222
public const float k_MarkerTooltipScale = 4;
2323
public const float k_ThumbTooltipSize = 10;
24+
public const float k_KnobSize = 10;
2425
}
2526

2627
protected static class SliderStyles
@@ -118,11 +119,16 @@ void DoSliderMarker(Rect rect, float position, float value, string tooltip)
118119
// Vertically align with slider.
119120
markerRect.y += (EditorGUIUtility.singleLineHeight / 2f) - 1;
120121

121-
// Horizontally place on slider.
122-
const float halfWidth = width * 0.5f;
123-
markerRect.x = rect.x + rect.width * position;
122+
// Horizontally place on slider. We need to take into account the "knob" size when doing this, because position 0 and 1 starts
123+
// at the center of the knob when it's placed at the left and right corner respectively. We don't do this adjustment when placing
124+
// the marker at the corners (to avoid havind the slider slightly extend past the marker)
125+
float knobSize = (position > 0f && position < 1f) ? SliderConfig.k_KnobSize : 0f;
126+
float start = rect.x + knobSize / 2f;
127+
float range = rect.width - knobSize;
128+
markerRect.x = start + range * position;
124129

125130
// Center the marker on value.
131+
const float halfWidth = width * 0.5f;
126132
markerRect.x -= halfWidth;
127133

128134
// Clamp to the slider edges.

com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalUI.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro
4747
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change
4848
static public void SetupCommonDecalMaterialKeywordsAndPass(Material material)
4949
{
50+
bool affectsMaskmap = false;
51+
affectsMaskmap |= material.HasProperty(kAffectMetal) && material.GetFloat(kAffectMetal) == 1.0f;
52+
affectsMaskmap |= material.HasProperty(kAffectAO) && material.GetFloat(kAffectAO) == 1.0f;
53+
affectsMaskmap |= material.HasProperty(kAffectSmoothness) && material.GetFloat(kAffectSmoothness) == 1.0f;
54+
5055
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_ALBEDO", material.HasProperty(kAffectAlbedo) && material.GetFloat(kAffectAlbedo) == 1.0f);
5156
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_NORMAL", material.HasProperty(kAffectNormal) && material.GetFloat(kAffectNormal) == 1.0f);
52-
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectMetal) && material.GetFloat(kAffectMetal) == 1.0f);
53-
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectAO) && material.GetFloat(kAffectAO) == 1.0f);
54-
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", material.HasProperty(kAffectSmoothness) && material.GetFloat(kAffectSmoothness) == 1.0f);
57+
CoreUtils.SetKeyword(material, "_MATERIAL_AFFECTS_MASKMAP", affectsMaskmap);
5558

5659
// Albedo : RT0 RGB, A - sRGB
5760
// Normal : RT1 RGB, A

com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/CreateEyeShaderGraph.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public static void CreateEyeGraph()
1818
BlockFields.VertexDescription.Tangent,
1919
BlockFields.SurfaceDescription.BaseColor,
2020
BlockFields.SurfaceDescription.NormalTS,
21-
HDBlockFields.SurfaceDescription.IrisNormalTS,
2221
HDBlockFields.SurfaceDescription.BentNormal,
2322
BlockFields.SurfaceDescription.Smoothness,
2423
HDBlockFields.SurfaceDescription.IOR,

com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/CreateHairShaderGraph.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public static void CreateHairGraph()
3030
HDBlockFields.SurfaceDescription.SecondarySpecularTint,
3131
HDBlockFields.SurfaceDescription.SecondarySmoothness,
3232
HDBlockFields.SurfaceDescription.SecondarySpecularShift,
33+
BlockFields.SurfaceDescription.Emission,
3334
};
3435

3536
GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors);

com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,11 @@ public static PassDescriptor GenerateLitRaytracingPrepass()
878878

879879
#region Raytracing Indirect
880880

881+
public static KeywordCollection IndirectDiffuseKeywordCollection = new KeywordCollection
882+
{
883+
{ CoreKeywordDescriptors.multiBounceIndirect },
884+
};
885+
881886
public static PassDescriptor GenerateRaytracingIndirect(bool supportLighting)
882887
{
883888
return new PassDescriptor
@@ -891,6 +896,7 @@ public static PassDescriptor GenerateRaytracingIndirect(bool supportLighting)
891896
// Collections
892897
pragmas = CorePragmas.RaytracingBasic,
893898
defines = supportLighting ? RaytracingIndirectDefines : null,
899+
keywords = supportLighting ? IndirectDiffuseKeywordCollection : null,
894900
includes = GenerateIncludes(),
895901
};
896902

com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,15 @@ static class CoreKeywordDescriptors
13241324
definition = KeywordDefinition.ShaderFeature,
13251325
scope = KeywordScope.Local,
13261326
};
1327+
1328+
public static KeywordDescriptor multiBounceIndirect = new KeywordDescriptor
1329+
{
1330+
displayName = "Multi Bounce Indirect",
1331+
referenceName = "MULTI_BOUNCE_INDIRECT",
1332+
type = KeywordType.Boolean,
1333+
definition = KeywordDefinition.MultiCompile,
1334+
scope = KeywordScope.Global,
1335+
};
13271336
}
13281337
#endregion
13291338
}

0 commit comments

Comments
 (0)