Skip to content

Commit cfd6f5d

Browse files
sebastienlagardeanisunityFrancescoC-unityskhiatRSlysz
authored
Merge 8.x.x/hd/staging (#38)
* [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 <sebastien@unity3d.com> * [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 <sebastien@unity3d.com> * [8.x.x Backport] Make subsection in decal debug menu to specify "affect transparents" (#6202) * Make subsection in decal debug menu * changelog * Support cookie on light backing for Disc Area Light #6138 * Hdrp /lookdev/fix crash on adding volume as viewed game object #6129 * fixed changelog * Add smoothness remark (#6226) * Removed legacy VR code from HDRP #5923 * Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file #5895 * Improve light clipping and culling #2 #4711 * Hdrp/fix/decal material ui errors #6225 * 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 <sebastien@unity3d.com> * Update CHANGELOG.md * Mention default post processing in default volumes. (#6233) * Fix cubemap inspector so that thumbnail for cubemap work #6231 * - Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. (#6197) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [Backport 8.x.x] Fix some typos in the debug menu (#6249) * Backport renaming * changelog * Added debug exposure to light hierarchy debug. (#6216) # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. (#6254) * Clearer naming of tile and cluster categories for environment lights #6227 * Fix texture curve destroy (#6277) # Conflicts: # com.unity.render-pipelines.core/CHANGELOG.md * Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). (#6270) * fix for Fogbugz 1214609 - HDRP Wizard addively increases the Light Intesity instead of setting it (#6266) * Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. #6235 * Add XR setting to control camera jitter for temporal effects #6259 * fix unreachable code in TextureXR.useTexArray (#6260) Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Deprecate Utilities namespace #6219 * Fix issue on thumbnail generation so that no error on new project and thumbnail are generated at first import #6265 * Update CHANGELOG.md * [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 * [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 * [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 <sebastien@unity3d.com> * [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 <sebastien@unity3d.com> * Hdrp/fix material baked emission #5392 * Fixed volume components lifespan in the clipboard #5869 * Hdrp/fix/particle light shadows #6111 * Bugfix: uncached reflection probe cameras were reseting the debug mode #6245 * Fix case in PBR sky where a camera below ground might invalidate result of a camera above #6272 * Hdrp/probe scale 1219246 (#6288) * Fix when scale down < 0 all direction of box Influence Volume * Update Change log * Update CHANGELOG.md * Split set rendering feature set and API validity check #6301 * Fix Render Texture with XR #6306 * Fix sRGB mismatch with XR SDK #6311 * Fix XR single-pass with Mock HMD plugin #6313 * Fix XR culling with multiple cameras #6314 * Add custom pass opaque rendering error message #6330 * Update Light-Component.md (#6332) * Update CHANGELOG.md * Update TextureCurve.cs * fix merge issue * Update CHANGELOG.md * - Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. (#6410) * 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 * Catch and handle NRefactory parser exceptions (#6392) Co-authored-by: vlad-andreev <vlad-andreev@unity3d.com> * 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. * Refreshed the GUIDs for additional post processing data to avoid conflicts with PPv2 (#6394) * Added known issues page (#6447) * Platform/playstation #6380 * Shadow cascade tooltip fix (when using the metric mode) #6448 * Focus on Decal uses the extends of the projectors #6449 * [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 <sebastien@unity3d.com> * Fixed usage of light size data that are not available at runtime. (#6490) * Changed the diffusion profile warning on the material to an info and changed the message to be more precise. (#6481) * Fix shadow tesselation culling (#6477) * Fix custom pass culling params * Fixed shadow tessellation culling * revert custom pass code * Add option to disable XR rendering on the camera settings #6372 * Move scene view camera settings to camera settings window #6390 * Corrected typo and changed links to .md (#6414) * Corrected typo and changed links to .md * Update Master-Node-Fabric.md * Hdrp /fix reset of HDAdditionalLightData #6453 * Fix null error when leaving debug menu #6467 * Hdrp /fix drag area width at left of light intensity #6471 * Fix issue with baked reflection probes constantly marked as dirty with auto-bake on #6473 * Fix custom pass depth copy #6484 * Hdrp /lookdev ui fixes #6491 * Expose a debug constant in ShaderLab to make HDRP/Unlit SRP Batcher compatible again. #6496 * fix unused leftover (#6497) * Fix custom pass test reference images (#6512) * [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 <remi.chapelain@unity3d.com> * Fixed an usage of a a compute buffer not bound (1229964) (#27) Co-authored-by: Anis <anis@unity3d.com> * Removed wrongly serialized fields in StaticLightingSky (#6441) * Fix issues in the post process system with RenderTexture being invalid in some cases. Causing rendering problems. #6480 * Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. #6493 * Hdrp/docs/glossary f number (#6523) * Update Glossary.md * Update Glossary.md * path validation when creating new volume profile (#36) * Clamp probes compression factor to 0 #19 Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com> Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Co-authored-by: skhiat <55133890+skhiat@users.noreply.github.com> Co-authored-by: Remi Slysz <40034005+RSlysz@users.noreply.github.com> Co-authored-by: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Co-authored-by: Evgenii Golubev <EvgeniiG@users.noreply.github.com> Co-authored-by: Antoine Lelievre <antoinel@unity3d.com> Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com> Co-authored-by: JulienIgnace-Unity <julien@unity3d.com> Co-authored-by: fredericv-unity3d <55485372+fredericv-unity3d@users.noreply.github.com> Co-authored-by: Thomas <Chman@users.noreply.github.com> Co-authored-by: JordanL8 <lewis.jordan@hotmail.co.uk> Co-authored-by: vlad-andreev <vlad-andreev@users.noreply.github.com> Co-authored-by: vlad-andreev <vlad-andreev@unity3d.com> Co-authored-by: ChristianF-ARM <45175346+ChristianF-ARM@users.noreply.github.com> Co-authored-by: Tim Cannell <timcannell@unity3d.com> Co-authored-by: Jussi Knuuttila <jussi.knuuttila@unity3d.com> Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com> Co-authored-by: Anis <anis@unity3d.com>
1 parent 91f7d0b commit cfd6f5d

File tree

11 files changed

+528
-367
lines changed

11 files changed

+528
-367
lines changed

com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ namespace UnityEditor.Rendering
1616
/// in the inspector:
1717
/// <code>
1818
/// using UnityEngine.Rendering;
19-
///
19+
///
2020
/// [CustomEditor(typeof(VolumeProfile))]
2121
/// public class CustomVolumeProfileEditor : Editor
2222
/// {
2323
/// VolumeComponentListEditor m_ComponentList;
24-
///
24+
///
2525
/// void OnEnable()
2626
/// {
2727
/// m_ComponentList = new VolumeComponentListEditor(this);
2828
/// m_ComponentList.Init(target as VolumeProfile, serializedObject);
2929
/// }
30-
///
30+
///
3131
/// void OnDisable()
3232
/// {
3333
/// if (m_ComponentList != null)
3434
/// m_ComponentList.Clear();
3535
/// }
36-
///
36+
///
3737
/// public override void OnInspectorGUI()
3838
/// {
3939
/// serializedObject.Update();
@@ -58,6 +58,8 @@ public sealed class VolumeComponentListEditor
5858
Dictionary<Type, Type> m_EditorTypes; // Component type => Editor type
5959
List<VolumeComponentEditor> m_Editors;
6060

61+
int m_CurrentHashCode;
62+
6163
/// <summary>
6264
/// Creates a new instance of <see cref="VolumeComponentListEditor"/> to use in an
6365
/// existing editor.
@@ -195,9 +197,12 @@ public void OnGUI()
195197
if (asset == null)
196198
return;
197199

198-
if (asset.isDirty)
200+
// Even if the asset is not dirty, the list of component may have been changed by another inspector.
201+
// In this case, only the hash will tell us that we need to refresh.
202+
if (asset.isDirty || asset.GetHashCode() != m_CurrentHashCode)
199203
{
200204
RefreshEditors();
205+
m_CurrentHashCode = asset.GetHashCode();
201206
asset.isDirty = false;
202207
}
203208

com.unity.render-pipelines.core/Editor/Volume/VolumeProfileFactory.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,22 @@ public static VolumeProfile CreateVolumeProfile(Scene scene, string targetName)
5656
{
5757
var scenePath = Path.GetDirectoryName(scene.path);
5858
var extPath = scene.name;
59-
var profilePath = scenePath + "/" + extPath;
59+
var profilePath = scenePath + Path.DirectorySeparatorChar + extPath;
6060

6161
if (!AssetDatabase.IsValidFolder(profilePath))
62-
AssetDatabase.CreateFolder(scenePath, extPath);
62+
{
63+
var directories = profilePath.Split(Path.DirectorySeparatorChar);
64+
string rootPath = "";
65+
foreach (var directory in directories)
66+
{
67+
var newPath = rootPath + directory;
68+
if (!AssetDatabase.IsValidFolder(newPath))
69+
AssetDatabase.CreateFolder(rootPath.TrimEnd(Path.DirectorySeparatorChar), directory);
70+
rootPath = newPath + Path.DirectorySeparatorChar;
71+
}
72+
}
6373

64-
path = profilePath + "/";
74+
path = profilePath + Path.DirectorySeparatorChar;
6575
}
6676

6777
path += targetName + " Profile.asset";

com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,5 +279,23 @@ public bool TryGetAllSubclassOf<T>(Type type, List<T> result)
279279

280280
return count != result.Count;
281281
}
282+
283+
284+
/// <summary>
285+
/// A custom hashing function that Unity uses to compare the state of parameters.
286+
/// </summary>
287+
/// <returns>A computed hash code for the current instance.</returns>
288+
public override int GetHashCode()
289+
{
290+
unchecked
291+
{
292+
int hash = 17;
293+
294+
for (int i = 0; i < components.Count; i++)
295+
hash = hash * 23 + components[i].GetHashCode();
296+
297+
return hash;
298+
}
299+
}
282300
}
283301
}

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

Lines changed: 391 additions & 329 deletions
Large diffs are not rendered by default.

com.unity.render-pipelines.high-definition/Documentation~/Glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A face refers to one side of a piece of geometry. The front face is the side of
4040

4141
#### f-number:
4242

43-
The ratio of the focal length to the diameter of the camera lens.
43+
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.
4444

4545
<a name="NyquistRate"></a>
4646

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class Styles
4545
ReorderableList m_BeforeTransparentCustomPostProcesses;
4646
ReorderableList m_BeforePostProcessCustomPostProcesses;
4747
ReorderableList m_AfterPostProcessCustomPostProcesses;
48+
int m_CurrentVolumeProfileHash;
4849

4950
public void OnGUI(string searchContext)
5051
{
@@ -207,6 +208,13 @@ void Draw_VolumeInspector()
207208
}
208209
EditorGUILayout.EndHorizontal();
209210

211+
// The state of the profile can change without the asset reference changing so in this case we need to reset the editor.
212+
if (m_CurrentVolumeProfileHash != asset.GetHashCode() && m_CachedDefaultVolumeProfileEditor != null)
213+
{
214+
m_CurrentVolumeProfileHash = asset.GetHashCode();
215+
m_CachedDefaultVolumeProfileEditor = null;
216+
}
217+
210218
Editor.CreateCachedEditor(asset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedDefaultVolumeProfileEditor);
211219
EditorGUIUtility.labelWidth -= 18;
212220
bool oldEnabled = GUI.enabled;
@@ -230,13 +238,13 @@ void Draw_VolumeInspector()
230238
hdrpAsset.defaultLookDevProfile = newLookDevAsset;
231239
EditorUtility.SetDirty(hdrpAsset);
232240
}
233-
241+
234242
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)))
235243
{
236244
DefaultVolumeProfileCreator.CreateAndAssign(DefaultVolumeProfileCreator.Kind.LookDev);
237245
}
238246
EditorGUILayout.EndHorizontal();
239-
247+
240248
Editor.CreateCachedEditor(lookDevAsset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedLookDevVolumeProfileEditor);
241249
EditorGUIUtility.labelWidth -= 18;
242250
oldEnabled = GUI.enabled;
@@ -311,7 +319,7 @@ static string GetDefaultName(Kind kind)
311319
}
312320
return defaultName;
313321
}
314-
322+
315323
public static void CreateAndAssign(Kind kind)
316324
{
317325
var assetCreator = ScriptableObject.CreateInstance<DefaultVolumeProfileCreator>();

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSetting.cs

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,29 +136,55 @@ ScalableSettingSchema schema
136136
static void MultiField<T>(Rect position, GUIContent[] subLabels, T[] values)
137137
where T: struct
138138
{
139+
// The number of slots we need to fit into this rectangle
139140
var length = values.Length;
140-
var num = (position.width - (float) (length - 1) * 3f) / (float) length;
141-
var position1 = new Rect(position)
142-
{
143-
width = num
144-
};
145-
var labelWidth = EditorGUIUtility.labelWidth;
141+
142+
// Let's compute the space allocated for every field including the label
143+
var num = position.width / (float) length;
144+
145+
// Reset the indentation
146146
var indentLevel = EditorGUI.indentLevel;
147147
EditorGUI.indentLevel = 0;
148+
149+
// Variable to keep track of the current pixel shift in the rectangle we were assigned for this whole section.
150+
float pixelShift = 0;
151+
152+
// Loop through the levels
148153
for (var index = 0; index < values.Length; ++index)
149154
{
150-
EditorGUIUtility.labelWidth = CalcPrefixLabelWidth(subLabels[index], (GUIStyle) null);
151-
if (typeof(T) == typeof(int))
152-
values[index] = (T)(object)EditorGUI.DelayedIntField(position1, subLabels[index], (int)(object)values[index]);
153-
else if (typeof(T) == typeof(bool))
154-
values[index] = (T)(object)EditorGUI.Toggle(position1, subLabels[index], (bool)(object)values[index]);
155-
else if (typeof(T) == typeof(float))
156-
values[index] = (T)(object)EditorGUI.FloatField(position1, subLabels[index], (float)(object)values[index]);
157-
else
158-
throw new ArgumentOutOfRangeException($"<{typeof(T)}> is not a supported type for multi field");
159-
position1.x += num + 4f;
155+
// Let's first compute what is the width of the label of this scalable setting level
156+
// We make sure that the label doesn't go beyond the space available for this scalable setting level
157+
var labelWidth = Mathf.Clamp(CalcPrefixLabelWidth(subLabels[index], (GUIStyle)null), 0, num);
158+
159+
// Draw the Label at the expected position
160+
EditorGUI.LabelField(new Rect(position.x + pixelShift, position.y, labelWidth, position.height), subLabels[index]);
161+
162+
// We need to remove from the position the label size that we've just drawn and shift by it's length
163+
pixelShift += labelWidth;
164+
165+
// The amount of space left for the field
166+
float spaceLeft = num - labelWidth;
167+
168+
// If at least two pixels are left to draw this field, draw it, otherwise, skip
169+
if (spaceLeft > 2)
170+
{
171+
// Define the rectangle for the field
172+
var fieldSlot = new Rect(position.x + pixelShift, position.y, num - labelWidth, position.height);
173+
174+
// Draw the right field depending on its type.
175+
if (typeof(T) == typeof(int))
176+
values[index] = (T)(object)EditorGUI.DelayedIntField(fieldSlot, (int)(object)values[index]);
177+
else if (typeof(T) == typeof(bool))
178+
values[index] = (T)(object)EditorGUI.Toggle(fieldSlot, (bool)(object)values[index]);
179+
else if (typeof(T) == typeof(float))
180+
values[index] = (T)(object)EditorGUI.FloatField(fieldSlot, (float)(object)values[index]);
181+
else
182+
throw new ArgumentOutOfRangeException($"<{typeof(T)}> is not a supported type for multi field");
183+
}
184+
185+
// Shift by the slot that was left for the field
186+
pixelShift += spaceLeft;
160187
}
161-
EditorGUIUtility.labelWidth = labelWidth;
162188
EditorGUI.indentLevel = indentLevel;
163189
}
164190

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3150,7 +3150,8 @@ void BuildGPULightListsCommon(HDCamera hdCamera, CommandBuffer cmd)
31503150
// 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
31513151
// to changes to the inner workings of the lists.
31523152
// Also, we clear all the lists and to be resilient to changes in pipeline.
3153-
ClearLightList(hdCamera, cmd, resources.tileAndClusterData.bigTileLightList);
3153+
if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.BigTilePrepass))
3154+
ClearLightList(hdCamera, cmd, resources.tileAndClusterData.bigTileLightList);
31543155
ClearLightList(hdCamera, cmd, resources.tileAndClusterData.lightList);
31553156
ClearLightList(hdCamera, cmd, resources.tileAndClusterData.perVoxelOffset);
31563157

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ private enum SMAAStage
133133

134134
HDRenderPipeline m_HDInstance;
135135

136+
void FillEmptyExposureTexture()
137+
{
138+
var tex = new Texture2D(1, 1, TextureFormat.RGHalf, false, true);
139+
tex.SetPixel(0, 0, new Color(1f, ColorUtils.ConvertExposureToEV100(1f), 0f, 0f));
140+
tex.Apply();
141+
Graphics.Blit(tex, m_EmptyExposureTexture);
142+
CoreUtils.Destroy(tex);
143+
}
144+
136145
public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources)
137146
{
138147
m_Resources = defaultResources;
@@ -206,11 +215,7 @@ public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources
206215
// TODO: Write a version that uses structured buffer instead of texture to do atomic as Metal doesn't support atomics on textures.
207216
m_MotionBlurSupportsScattering = m_MotionBlurSupportsScattering && (SystemInfo.graphicsDeviceType != GraphicsDeviceType.Metal);
208217

209-
var tex = new Texture2D(1, 1, TextureFormat.RGHalf, false, true);
210-
tex.SetPixel(0, 0, new Color(1f, ColorUtils.ConvertExposureToEV100(1f), 0f, 0f));
211-
tex.Apply();
212-
Graphics.Blit(tex, m_EmptyExposureTexture);
213-
CoreUtils.Destroy(tex);
218+
FillEmptyExposureTexture();
214219

215220
// Initialize our target pool to ease RT management
216221
m_Pool = new TargetPool();
@@ -287,6 +292,23 @@ public void Cleanup()
287292
m_FarBokehTileList = null;
288293
}
289294

295+
// In some cases, the internal buffer of render textures might be invalid.
296+
// Usually when using these textures with API such as SetRenderTarget, they are recreated internally.
297+
// 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.
298+
void CheckRenderTexturesValidity()
299+
{
300+
if (!m_EmptyExposureTexture.rt.IsCreated())
301+
FillEmptyExposureTexture();
302+
303+
HDUtils.CheckRTCreated(m_InternalLogLut.rt);
304+
HDUtils.CheckRTCreated(m_TempTexture1024.rt);
305+
HDUtils.CheckRTCreated(m_TempTexture32.rt);
306+
if (m_KeepAlpha)
307+
{
308+
HDUtils.CheckRTCreated(m_AlphaTexture.rt);
309+
}
310+
}
311+
290312
public void BeginFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline hdInstance)
291313
{
292314
m_HDInstance = hdInstance;
@@ -336,6 +358,8 @@ public void BeginFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline hdIn
336358
m_DitheringFS = frameSettings.IsEnabled(FrameSettingsField.Dithering);
337359
m_AntialiasingFS = frameSettings.IsEnabled(FrameSettingsField.Antialiasing);
338360

361+
CheckRenderTexturesValidity();
362+
339363
// Handle fixed exposure & disabled pre-exposure by forcing an exposure multiplier of 1
340364
if (!m_ExposureControlFS)
341365
{
@@ -2644,7 +2668,11 @@ public RTHandle Get(in Vector2 scaleFactor, GraphicsFormat format, bool mipmap =
26442668
var hashCode = ComputeHashCode(scaleFactor.x, scaleFactor.y, (int)format, mipmap);
26452669

26462670
if (m_Targets.TryGetValue(hashCode, out var stack) && stack.Count > 0)
2647-
return stack.Pop();
2671+
{
2672+
var tex = stack.Pop();
2673+
HDUtils.CheckRTCreated(tex.rt);
2674+
return tex;
2675+
}
26482676

26492677
var rt = RTHandles.Alloc(
26502678
scaleFactor, TextureXR.slices, DepthBits.None, colorFormat: format, dimension: TextureXR.dimension,

com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections.Generic;
23
using UnityEngine.Serialization;
34

@@ -15,8 +16,9 @@ class StaticLightingSky : MonoBehaviour
1516
int m_LastComputedHash;
1617
bool m_NeedUpdateStaticLightingSky;
1718

18-
// This one contain only property values from overridden properties in the original profile component
19-
public SkySettings m_SkySettings;
19+
[NonSerialized]
20+
public SkySettings m_SkySettings; // This one contain only property values from overridden properties in the original profile component
21+
[NonSerialized]
2022
public SkySettings m_SkySettingsFromProfile;
2123

2224
public SkySettings skySettings

0 commit comments

Comments
 (0)