Skip to content

Internal/master #8015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7b122b1
[UIT-2237]: Reverting the new Contextual Menu feature.
freddy-cheungh Dec 12, 2023
13ba7b6
2d/staging/tilemap/uum53666
ChuanXin-Unity Dec 12, 2023
52d453d
[HDRP] Various fixes
adrien-de-tocqueville Dec 12, 2023
6094ffc
Render Graph compilation caching.
JulienIgnace-Unity Dec 12, 2023
158e6c5
[VFX/SG] Fix Custom HLSL
PaulDemeulenaere Dec 12, 2023
3872cf5
Graphics/SRP/RPF - RG Opt 1 - Using UnityEngine.Pool for RenderGraphO…
axoloto Dec 12, 2023
3c6b8bf
[Bug UUM-58488] Fix typos, misspellings, & inaccuracies in Node Refer…
bencloward Dec 12, 2023
766c1dc
Graphics/hd/fix/56870 Sky occlusion: tooltips and documentation updat…
arthur-dufay Dec 13, 2023
9e53df8
[URP]Implementing uUniversalRenderPipelinePostProcessDataUsage Analytic.
alex-vazquez-unity3d Dec 13, 2023
3b9d2d9
[2023.3][URP] Fixing decals not affecting grass when using Deferred R…
ellioman Dec 13, 2023
187c3d9
Fix UUM-58354 by splitting up large probe jobs
pigselated Dec 13, 2023
0cdb567
[URP][2023.3] Fixing an issue where SSAO feature can not be disabled …
ellioman Dec 13, 2023
3215702
[HDRP][Docs] Fix Water burst script having compilation issues
remi-chapelain Dec 13, 2023
1de0c11
[HDRP] Correct rayrtacing limitation documentation
sebastienlagarde Dec 13, 2023
4fcaf12
[2023.3][URP] Make ValidateRendererFeatures() use IsSubclassOf instea…
ellioman Dec 13, 2023
88f4e29
Fix rendering debugger null exception on render graph path.
eh-unity Dec 13, 2023
a61a8db
Fix Some Warnings in 32-bit STP Path
gmitrano-unity Dec 13, 2023
ee880a6
[SRP] Add XR for Data Driven Lens Flare
Dec 15, 2023
43866ac
[Graphics][URP][Bugfix][Trunk] Foward+ Reflection Probe GL y-flip fix
Nzollner Dec 15, 2023
2c6583d
[VFX] Particle strips missing functionality
gabrieldelacruz Dec 15, 2023
e791836
[VFX] Fix Sample Camera Buffer in Dispatch
PaulDemeulenaere Dec 15, 2023
d607c2d
Add Profiling Markers for RecordRenderGraph
RoseHirigoyen Dec 15, 2023
94cd81f
Remove one of duplicate dependencies from RP Core to com.unity.collec…
arttu-peltonen Dec 15, 2023
cf0d2a8
Added HDRP stencil documentation page
alelievr Dec 15, 2023
6a5a847
[POI-817] Optimize RenderGraph CPU cost by converting Bloom from many…
eh-unity Dec 16, 2023
9c302f1
[HDRP] Fix raytraced shadow denoising on box lights
pjbunity Dec 16, 2023
4861fd7
Documentation/staging
RobJessop Dec 16, 2023
a53e0ee
Graphics/SRP/RPF - RG Opt 2 - No more buffers clearing in RenderGraph…
axoloto Dec 19, 2023
5577d27
[URP] Fix SSAO + DBuffer global texture
mcc-unity Dec 19, 2023
7ff3ddc
Fixed a null ref exception when baking APV without GPU streaming enab…
JulienIgnace-Unity Dec 19, 2023
646c007
[HDRP] Update What's new 17 documentation page
sebastienlagarde Dec 20, 2023
229c766
Graphics/SRP/RPF - RG Opt 3 - Disable Render Graph Validation Checks …
axoloto Dec 20, 2023
b883dcf
[VFX] Fixed two unexpected console messages
julienamsellem Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ internal static void SendData(IAnalytic analytic)
EditorAnalytics.SendAnalytic(analytic);
}

internal static IEnumerable<FieldInfo> GetSerializableFields(this Type type, bool removeObsolete = false)
/// <summary>
/// Gets a list of the serializable fields of the given type
/// </summary>
/// <param name="type">The type to get fields that are serialized.</param>
/// <param name="removeObsolete">If obsolete fields are taken into account</param>
/// <returns>The collection of <see cref="FieldInfo"/> that are serialized for this type</returns>
public static IEnumerable<FieldInfo> GetSerializableFields(this Type type, bool removeObsolete = false)
{
var members = type.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class HeaderFoldout : Foldout
const string k_Class = "header-foldout";

private string m_DocumentationURL;
private Func<GenericDropdownMenu> m_ContextMenuGenerator;
private Func<GenericMenu> m_ContextMenuGenerator;
private VisualElement m_HelpButton;
private VisualElement m_ContextMenuButton;

Expand All @@ -30,7 +30,7 @@ public string documentationURL
}

/// <summary>Context menu to show on clic of the context button. If null, button don't show.</summary>
public Func<GenericDropdownMenu> contextMenuGenerator
public Func<GenericMenu> contextMenuGenerator //Use ImGUI for now
{
get => m_ContextMenuGenerator;
set
Expand Down Expand Up @@ -78,7 +78,7 @@ void DelayedInit(AttachToPanelEvent evt)
void ShowMenu()
{
var menu = m_ContextMenuGenerator.Invoke();
menu.DropDown(new Rect(m_ContextMenuButton.worldBound.position + m_ContextMenuButton.worldBound.size.y * Vector2.up, Vector2.zero), this);
menu.DropDown(new Rect(m_ContextMenuButton.worldBound.position + m_ContextMenuButton.worldBound.size.y * Vector2.up, Vector2.zero));
}
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1185,12 +1185,6 @@ static void ApplyPostBakeOperations(NativeArray<SphericalHarmonicsL2> sh, Native
}
fetchScope.Dispose();

// Don't use Disk streaming to avoid having to wait for it when doing dilation.
ProbeReferenceVolume.instance.ForceNoDiskStreaming(true);
// Force maximum sh bands to perform baking, we need to store what sh bands was selected from the settings as we need to restore it after.
var prevSHBands = ProbeReferenceVolume.instance.shBands;
ProbeReferenceVolume.instance.ForceSHBand(ProbeVolumeSHBands.SphericalHarmonicsL2);

PrepareCellsForWriting(isBakingSceneSubset);

using var writeScope = new BakingCompleteProfiling(BakingCompleteProfiling.Stages.WriteBakedData);
Expand All @@ -1211,6 +1205,16 @@ static void ApplyPostBakeOperations(NativeArray<SphericalHarmonicsL2> sh, Native
// Reset internal structures depending on current bake.
probeRefVolume.EnsureCurrentBakingSet(m_BakingSet);

// This subsequent block needs to happen AFTER we call WriteBakingCells.
// Otherwise in cases where we change the spacing between probes, we end up loading cells with a certain layout in ForceSHBand
// And then we unload cells using the wrong layout in PerformDilation (after WriteBakingCells updates the baking set object) which leads to a broken internal state.

// Don't use Disk streaming to avoid having to wait for it when doing dilation.
ProbeReferenceVolume.instance.ForceNoDiskStreaming(true);
// Force maximum sh bands to perform baking, we need to store what sh bands was selected from the settings as we need to restore it after.
var prevSHBands = ProbeReferenceVolume.instance.shBands;
ProbeReferenceVolume.instance.ForceSHBand(ProbeVolumeSHBands.SphericalHarmonicsL2);

// TODO Discuss: Not nice to do this here, shouldn't reloading the asset also resolve cell data?
// Would still need to reload common shared data like bricks as they are separately handled by the baking set itself.
// Load common shared data (bricks + debug)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ internal class ProbeVolumeBakingSetEditor : Editor
SerializedProperty m_SkyOcclusionBakingSamples;
SerializedProperty m_SkyOcclusionBakingBounces;
SerializedProperty m_SkyOcclusionAverageAlbedo;
SerializedProperty m_SkyOcclusionBackFaceCulling;
SerializedProperty m_SkyOcclusionShadingDirection;

ProbeVolumeBakingSet bakingSet => target as ProbeVolumeBakingSet;
Expand All @@ -51,7 +50,7 @@ static class Styles
{
public static readonly GUIContent scenariosTitle = new GUIContent("Lighting Scenarios");
public static readonly GUIContent placementTitle = new GUIContent("Probe Placement");
public static readonly GUIContent settingsTitle = new GUIContent("Probe Invalidity Settings");
public static readonly GUIContent invaliditySettingsTitle = new GUIContent("Probe Invalidity Settings");
public static readonly GUIContent skyOcclusionSettingsTitle = new GUIContent("Sky Occlusion Settings");

public static readonly GUIContent keepSamePlacement = new GUIContent("Probe Positions", "If set to Don't Recalculate, probe positions are not recalculated when baking. Allows baking multiple Scenarios that include small differences in Scene geometry.");
Expand All @@ -73,13 +72,13 @@ static class Styles
public static readonly GUIContent renderersLayerMask = new GUIContent("Layer Mask", "Specify Layers to use when generating probe positions.");
public static readonly GUIContent rendererFilterSettings = new GUIContent("Renderer Filter Settings");

public static readonly GUIContent skyOcclusion = new GUIContent("Sky Occlusion", "When occlusion is baked, probe volumes can react to sky lighting changes at runtime. This will increase the memory footprint for probe volumes.");
public static readonly GUIContent skyOcclusionBakingSamples = new GUIContent("Samples", "Control the number of samples used for Sky Occlusion baking. Increasing this value may improve the quality but increases the time required for baking to complete.");
public static readonly GUIContent skyOcclusionBakingBounces = new GUIContent("Bounces", "Control the number of bounces used for Sky Occlusion baking.");
public static readonly GUIContent skyOcclusionAverageAlbedo = new GUIContent("Albedo Override", "Bounced lighting for Sky Occlusion does not take material properties such as color and roughness into account. Thus a single color is applied to all materials. The colors range from 0 (black) to 1 (white).");
public static readonly GUIContent skyOcclusionBackFaceCulling = new GUIContent("Backface Culling", "Enable backface culling for Sky Occlusion baking.");
public static readonly GUIContent skyOcclusionShadingDirection = new GUIContent("Sky Direction", "In addition to Sky Occlusion, bake the most suitable direction to sample the ambient probe at runtime. Without it, surface normals would be used as a fallback and might lead to inaccuracies when updating the probes with the sky color.");
public static readonly GUIContent cpuLightmapperNotSupportedWarning = new GUIContent("The Progressive CPU Lightmapper is not supported with Sky Occlusion. Use Progressive GPU lightmapper instead in Lightmapping settings.");
public static readonly GUIContent skyOcclusion = new GUIContent("Sky Occlusion", "Choose whether to generate Sky Occlusion data for probes within this Probe Volume. When enabled, Scenes can be dynamically re-lit when the sky is changed. This feature increases memory usage.");
public static readonly GUIContent skyOcclusionBakingSamples = new GUIContent("Samples", "The number of samples used to calculate the influence of the sky when baking probes. Increasing this value improves the accuracy of Sky Occlusion data, but increases the time required to generate baked lighting.");
public static readonly GUIContent skyOcclusionBakingBounces = new GUIContent("Bounces", "The maximum number of bounces allowed for each Sky Occlusion sample. Increasing this value particularly improves the accuracy of occlusion data in areas of the Scene with complicated routes to the sky.");
public static readonly GUIContent skyOcclusionAverageAlbedo = new GUIContent("Albedo Override", "Sky Occlusion does not consider the albedo of materials in the Scene when calculating bounced light from the sky. Albedo Override determines the value used instead. Lower values darken and higher values will brighten the Scene.");
public static readonly GUIContent skyOcclusionShadingDirection = new GUIContent("Sky Direction", "For each probe, additionally bake the most suitable direction to use for sampling the Scene’s Ambient Probe. When disabled, surface normals are used instead. Sky Direction improves visual quality at the expense of memory.");
public static readonly GUIContent cpuLightmapperNotSupportedWarning = new GUIContent("Sky Occlusion is not supported by the current lightmapper. Ensure that Progressive GPU is selected in Lightmapper Settings.");



// Probe Settings section
Expand All @@ -102,7 +101,6 @@ void OnEnable()
m_SkyOcclusionBakingSamples = serializedObject.FindProperty(nameof(ProbeVolumeBakingSet.skyOcclusionBakingSamples));
m_SkyOcclusionBakingBounces = serializedObject.FindProperty(nameof(ProbeVolumeBakingSet.skyOcclusionBakingBounces));
m_SkyOcclusionAverageAlbedo = serializedObject.FindProperty(nameof(ProbeVolumeBakingSet.skyOcclusionAverageAlbedo));
m_SkyOcclusionBackFaceCulling = serializedObject.FindProperty(nameof(ProbeVolumeBakingSet.skyOcclusionBackFaceCulling));
m_SkyOcclusionShadingDirection = serializedObject.FindProperty(nameof(ProbeVolumeBakingSet.skyOcclusionShadingDirection));

if (ProbeReferenceVolume.instance.supportScenarioBlending)
Expand Down Expand Up @@ -226,9 +224,9 @@ void ProbePlacementGUI()
EditorGUILayout.Space();
}

void ProbeSettingsGUI()
void ProbeInvaliditySettingsGUI()
{
if (!ProbeVolumeLightingTab.Foldout(Styles.settingsTitle, ProbeVolumeLightingTab.Expandable.InvaliditySettings, true, ResetProbeSettings))
if (!ProbeVolumeLightingTab.Foldout(Styles.invaliditySettingsTitle, ProbeVolumeLightingTab.Expandable.InvaliditySettings, true, ResetProbeSettings))
return;

using (new EditorGUI.IndentLevelScope())
Expand All @@ -237,7 +235,7 @@ void ProbeSettingsGUI()
EditorGUILayout.Space();
}

void SkyOcclusionSettings()
void SkyOcclusionSettingsGUI()
{
if (!SupportedRenderingFeatures.active.skyOcclusion)
return;
Expand All @@ -247,11 +245,12 @@ void SkyOcclusionSettings()
EditorGUI.indentLevel++;

var lightmapper = ProbeVolumeLightingTab.GetLightingSettings().lightmapper;
if (lightmapper == LightingSettings.Lightmapper.ProgressiveCPU)
bool cpuLightmapperSelected = lightmapper == LightingSettings.Lightmapper.ProgressiveCPU;
if (cpuLightmapperSelected)
{
EditorGUILayout.HelpBox(Styles.cpuLightmapperNotSupportedWarning.text, MessageType.Warning);
}
else
using (new EditorGUI.DisabledScope(cpuLightmapperSelected))
{
EditorGUILayout.PropertyField(m_SkyOcclusion, Styles.skyOcclusion);

Expand All @@ -262,7 +261,6 @@ void SkyOcclusionSettings()
EditorGUILayout.PropertyField(m_SkyOcclusionBakingBounces, Styles.skyOcclusionBakingBounces);
EditorGUILayout.PropertyField(m_SkyOcclusionAverageAlbedo, Styles.skyOcclusionAverageAlbedo);
EditorGUILayout.PropertyField(m_SkyOcclusionShadingDirection, Styles.skyOcclusionShadingDirection);
EditorGUILayout.PropertyField(m_SkyOcclusionBackFaceCulling, Styles.skyOcclusionBackFaceCulling);
EditorGUI.indentLevel--;
}
}
Expand All @@ -277,8 +275,8 @@ public override void OnInspectorGUI()

ProbePlacementGUI();
LightingScenariosGUI();
ProbeSettingsGUI();
SkyOcclusionSettings();
SkyOcclusionSettingsGUI();
ProbeInvaliditySettingsGUI();

serializedObject.ApplyModifiedProperties();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public abstract class DefaultVolumeProfileSettingsContextMenu<TSetting, TRenderP
/// </summary>
protected abstract string defaultVolumeProfilePath { get; }

void IRenderPipelineGraphicsSettingsContextMenu<TSetting>.PopulateContextMenu(TSetting setting, PropertyDrawer drawer, ref GenericDropdownMenu menu)
void IRenderPipelineGraphicsSettingsContextMenu<TSetting>.PopulateContextMenu(TSetting setting, PropertyDrawer drawer, ref GenericMenu menu)
{
menu.AddSeparator("");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public static void EnsureAllOverridesForDefaultProfile(VolumeProfile profile, Vo
/// <param name="onComponentEditorsExpandedCollapsed">Callback when all editors are collapsed or expanded</param>
/// <param name="canCreateNewProfile">Whether it is allowed to create a new profile</param>
public static void AddVolumeProfileContextMenuItems(
ref GenericDropdownMenu menu,
ref GenericMenu menu,
VolumeProfile volumeProfile,
List<VolumeComponentEditor> componentEditors,
bool overrideStateOnReset,
Expand All @@ -270,22 +270,22 @@ public static void AddVolumeProfileContextMenuItems(
{
if (canCreateNewProfile)
{
menu.AddItem(Styles.newVolumeProfile.text, false, () =>
menu.AddItem(Styles.newVolumeProfile, false, () =>
{
VolumeProfileFactory.CreateVolumeProfileWithCallback(defaultVolumeProfilePath,
onNewVolumeProfileCreated);
});
}
else
{
menu.AddDisabledItem(Styles.newVolumeProfile.text, false);
menu.AddDisabledItem(Styles.newVolumeProfile, false);
}

if (volumeProfile != null)
{
if (canCreateNewProfile)
{
menu.AddItem(Styles.clone.text, false, () =>
menu.AddItem(Styles.clone, false, () =>
{
var pathName = AssetDatabase.GenerateUniqueAssetPath(AssetDatabase.GetAssetPath(volumeProfile));
var clone = VolumeProfileFactory.CreateVolumeProfileAtPath(pathName, volumeProfile);
Expand All @@ -294,17 +294,17 @@ public static void AddVolumeProfileContextMenuItems(
}
else
{
menu.AddDisabledItem(Styles.clone.text, false);
menu.AddDisabledItem(Styles.clone, false);
}

menu.AddSeparator(string.Empty);

menu.AddItem(Styles.collapseAll.text, false, () =>
menu.AddItem(Styles.collapseAll, false, () =>
{
SetComponentEditorsExpanded(componentEditors, false);
onComponentEditorsExpandedCollapsed?.Invoke();
});
menu.AddItem(Styles.expandAll.text, false, () =>
menu.AddItem(Styles.expandAll, false, () =>
{
SetComponentEditorsExpanded(componentEditors, true);
onComponentEditorsExpandedCollapsed?.Invoke();
Expand All @@ -313,28 +313,28 @@ public static void AddVolumeProfileContextMenuItems(

menu.AddSeparator(string.Empty);

menu.AddItem(Styles.showAllAdditionalProperties.text, false,
menu.AddItem(Styles.showAllAdditionalProperties, false,
CoreRenderPipelinePreferences.Open);

menu.AddSeparator(string.Empty);

menu.AddItem(Styles.openInRenderingDebugger.text, false, DebugDisplaySettingsVolume.OpenInRenderingDebugger);
menu.AddItem(Styles.openInRenderingDebugger, false, DebugDisplaySettingsVolume.OpenInRenderingDebugger);

if (volumeProfile != null)
{
menu.AddSeparator(string.Empty);

menu.AddItem(Styles.copyAllSettings.text, false,
menu.AddItem(Styles.copyAllSettings, false,
() => VolumeComponentCopyPaste.CopySettings(volumeProfile.components));

if (VolumeComponentCopyPaste.CanPaste(volumeProfile.components))
menu.AddItem(Styles.pasteSettings.text, false, () =>
menu.AddItem(Styles.pasteSettings, false, () =>
{
VolumeComponentCopyPaste.PasteSettings(volumeProfile.components);
VolumeManager.instance.OnVolumeProfileChanged(volumeProfile);
});
else
menu.AddDisabledItem(Styles.pasteSettings.text, false);
menu.AddDisabledItem(Styles.pasteSettings, false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected RTHandle AllocHistoryFrameRT(int id, int count,
// Simplified for typical history textures:
// Sampling is usually bilinear & clamp. Point sample can be a texture.Load() or done with inline samplers.
// No shadows, no mipmaps, no aniso.
m_owner.AllocBuffer(id, count, ref desc, FilterMode.Bilinear, TextureWrapMode.Clamp, false, 1, 0, name);
m_owner.AllocBuffer(id, count, ref desc, FilterMode.Bilinear, TextureWrapMode.Clamp, false, 0, 0, name);
return GetCurrentFrameRT(0);
}

Expand Down
Loading