Skip to content

Commit 33419f4

Browse files
NicoLeymanGraphineNicolassebastienlagarde
authored
[Skip CI] Virtual Texturing cache settings (#536)
* Changed use of VT.System namespace to VT.Streaming namespace where the API has changed. * Virtual Texturing HDRP cache size settings. * VT settings UI is now shown but disabled when VT is not enabled. * Added a tooltip to the header of the VT settings. * Revert whitespace changes to HDRP changelog. Co-authored-by: Nico Leyman <Nicolas@GraphineSoftware.com> Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>
1 parent 756d775 commit 33419f4

13 files changed

+411
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
126126
- Implemented ray traced reflections for transparent objects.
127127
- Add a new parameter to control reflections in recursive rendering.
128128
- Added an initial version of SSGI.
129+
- Added Virtual Texturing cache settings to control the size of the Streaming Virtual Texturing caches.
129130
- Added back-compatibility with builtin stereo matrices.
130131
- Added CustomPassUtils API to simplify Blur, Copy and DrawRenderers custom passes.
131132
- Added Histogram guided automatic exposure.

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,10 @@ Use these settings to enable or disable settings relating to lighting in HDRP.
218218
| **Grading LUT Size** | The size of the internal and external color grading lookup textures (LUTs). This size is fixed for the Project. You can not mix and match LUT sizes, so decide on a size before you start the color grading process. The default value, **32**, provides a good balance of speed and quality. |
219219
| **Grading LUT Format** | Use the drop-down to select the format to encode the color grading LUTs with. Lower precision formats are faster and use less memory at the expense of color precision. These formats directly map to their equivalent in the built-in [GraphicsFormat](https://docs.unity3d.com/ScriptReference/Experimental.Rendering.GraphicsFormat.html) enum value. |
220220
| **Buffer Format** | Use the drop-down to select the format of the color buffers that are used in the post-processing passes. Lower precision formats are faster and use less memory at the expense of color precision. These formats directly map to their equivalent in the built-in [GraphicsFormat](https://docs.unity3d.com/ScriptReference/Experimental.Rendering.GraphicsFormat.html) enum value.
221+
222+
## Virtual Texturing
223+
224+
| **Property** | **Description** |
225+
| ----------------------- | --------------------------------------------------------------- |
226+
| **CPU Cache Size** | Amount of CPU memory (in MB) that can be allocated by the Streaming Virtual Texturing system to cache texture data. |
227+
| **GPU Cache Size per Format** | Amount of GPU memory (in MB) that can be allocated per format by the Streaming Virtual Texturing system to cache texture data. The value assigned to None is used for all unspecified formats. |

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class GeneralSection
2323
public static readonly GUIContent materialSectionTitle = EditorGUIUtility.TrTextContent("Material");
2424
public static readonly GUIContent postProcessSectionTitle = EditorGUIUtility.TrTextContent("Post-processing");
2525
public static readonly GUIContent xrTitle = EditorGUIUtility.TrTextContent("XR");
26-
public static readonly GUIContent virtualTexturingTitle = EditorGUIUtility.TrTextContent("Virtual Texturing");
26+
public static readonly GUIContent virtualTexturingTitle = EditorGUIUtility.TrTextContent("Virtual Texturing", "Virtual Texturing Settings. These are only available when Virtual Texturing is enabled in the Player Settings.");
2727
public static readonly GUIContent lightLoopSubTitle = EditorGUIUtility.TrTextContent("Lights");
2828
public static readonly GUIContent postProcessQualitySubTitle = EditorGUIUtility.TrTextContent("Post-processing Quality Settings");
2929
public static readonly GUIContent lightingQualitySettings = EditorGUIUtility.TrTextContent("Lighting Quality Settings");

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ internal enum SelectedFrameSettings
6868

6969
internal static SelectedFrameSettings selectedFrameSettings;
7070

71+
internal static VirtualTexturingSettingsUI virtualTexturingSettingsUI = new VirtualTexturingSettingsUI();
72+
7173
static HDRenderPipelineUI()
7274
{
7375
Inspector = CED.Group(
@@ -99,7 +101,8 @@ static HDRenderPipelineUI()
99101
CED.FoldoutGroup(Styles.bloomQualitySettings, Expandable.BloomQuality, k_ExpandedState, FoldoutOption.Indent | FoldoutOption.SubFoldout | FoldoutOption.NoSpaceAtEnd, Drawer_SectionBloomQualitySettings),
100102
CED.FoldoutGroup(Styles.chromaticAberrationQualitySettings, Expandable.ChromaticAberrationQuality, k_ExpandedState, FoldoutOption.Indent | FoldoutOption.SubFoldout | FoldoutOption.NoSpaceAtEnd, Drawer_SectionChromaticAberrationQualitySettings)
101103
),
102-
CED.FoldoutGroup(Styles.xrTitle, Expandable.XR, k_ExpandedState, Drawer_SectionXRSettings)
104+
CED.FoldoutGroup(Styles.xrTitle, Expandable.XR, k_ExpandedState, Drawer_SectionXRSettings),
105+
CED.FoldoutGroup(Styles.virtualTexturingTitle, Expandable.VirtualTexturing, k_ExpandedState, Drawer_SectionVTSettings)
103106
);
104107

105108
// fix init of selection along what is serialized
@@ -569,6 +572,11 @@ static void Drawer_SectionXRSettings(SerializedHDRenderPipelineAsset serialized,
569572
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.cameraJitter, Styles.XRCameraJitter);
570573
}
571574

575+
static void Drawer_SectionVTSettings(SerializedHDRenderPipelineAsset serialized, Editor owner)
576+
{
577+
virtualTexturingSettingsUI.OnGUI(serialized, owner);
578+
}
579+
572580
static private bool m_ShowDoFLowQualitySection = false;
573581
static private bool m_ShowDoFMediumQualitySection = false;
574582
static private bool m_ShowDoFHighQualitySection = false;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class SerializedHDRenderPipelineAsset
2020
public SerializedFrameSettings defaultFrameSettings;
2121
public SerializedFrameSettings defaultBakedOrCustomReflectionFrameSettings;
2222
public SerializedFrameSettings defaultRealtimeReflectionFrameSettings;
23+
public SerializedVirtualTexturingSettings virtualTexturingSettings;
2324

2425
//RenderPipelineResources not always exist and thus cannot be serialized normally.
2526
public bool editorResourceHasMultipleDifferentValues
@@ -63,6 +64,8 @@ public SerializedHDRenderPipelineAsset(SerializedObject serializedObject)
6364
defaultFrameSettings = new SerializedFrameSettings(serializedObject.FindProperty("m_RenderingPathDefaultCameraFrameSettings"), null); //no overrides in HDRPAsset
6465
defaultBakedOrCustomReflectionFrameSettings = new SerializedFrameSettings(serializedObject.FindProperty("m_RenderingPathDefaultBakedOrCustomReflectionFrameSettings"), null); //no overrides in HDRPAsset
6566
defaultRealtimeReflectionFrameSettings = new SerializedFrameSettings(serializedObject.FindProperty("m_RenderingPathDefaultRealtimeReflectionFrameSettings"), null); //no overrides in HDRPAsset
67+
68+
virtualTexturingSettings = new SerializedVirtualTexturingSettings(serializedObject.FindProperty("virtualTexturingSettings"));
6669
}
6770

6871
public void Update()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using UnityEditor.Rendering;
2+
using UnityEngine.Rendering.HighDefinition;
3+
4+
namespace UnityEditor.Rendering.HighDefinition
5+
{
6+
public sealed class SerializedVirtualTexturingSettings
7+
{
8+
public SerializedProperty root;
9+
10+
public SerializedProperty streamingCpuCacheSizeInMegaBytes;
11+
public SerializedProperty streamingGpuCacheSettings;
12+
public SerializedVirtualTexturingSettings(SerializedProperty root)
13+
{
14+
this.root = root;
15+
16+
streamingCpuCacheSizeInMegaBytes = root.Find((VirtualTexturingSettingsSRP s) => s.streamingCpuCacheSizeInMegaBytes);
17+
streamingGpuCacheSettings = root.Find((VirtualTexturingSettingsSRP s) => s.streamingGpuCacheSettings);
18+
}
19+
}
20+
}

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

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)