Skip to content

[Skip CI] Virtual Texturing cache settings #536

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 11 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Implemented ray traced reflections for transparent objects.
- Add a new parameter to control reflections in recursive rendering.
- Added an initial version of SSGI.
- Added Virtual Texturing cache settings to control the size of the Streaming Virtual Texturing caches.
- Added back-compatibility with builtin stereo matrices.
- Added CustomPassUtils API to simplify Blur, Copy and DrawRenderers custom passes.
- Added Histogram guided automatic exposure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,10 @@ Use these settings to enable or disable settings relating to lighting in HDRP.
| **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. |
| **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. |
| **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.

## Virtual Texturing

| **Property** | **Description** |
| ----------------------- | --------------------------------------------------------------- |
| **CPU Cache Size** | Amount of CPU memory (in MB) that can be allocated by the Streaming Virtual Texturing system to cache texture data. |
| **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. |
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class GeneralSection
public static readonly GUIContent materialSectionTitle = EditorGUIUtility.TrTextContent("Material");
public static readonly GUIContent postProcessSectionTitle = EditorGUIUtility.TrTextContent("Post-processing");
public static readonly GUIContent xrTitle = EditorGUIUtility.TrTextContent("XR");
public static readonly GUIContent virtualTexturingTitle = EditorGUIUtility.TrTextContent("Virtual Texturing");
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.");
public static readonly GUIContent lightLoopSubTitle = EditorGUIUtility.TrTextContent("Lights");
public static readonly GUIContent postProcessQualitySubTitle = EditorGUIUtility.TrTextContent("Post-processing Quality Settings");
public static readonly GUIContent lightingQualitySettings = EditorGUIUtility.TrTextContent("Lighting Quality Settings");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ internal enum SelectedFrameSettings

internal static SelectedFrameSettings selectedFrameSettings;

internal static VirtualTexturingSettingsUI virtualTexturingSettingsUI = new VirtualTexturingSettingsUI();

static HDRenderPipelineUI()
{
Inspector = CED.Group(
Expand Down Expand Up @@ -99,7 +101,8 @@ static HDRenderPipelineUI()
CED.FoldoutGroup(Styles.bloomQualitySettings, Expandable.BloomQuality, k_ExpandedState, FoldoutOption.Indent | FoldoutOption.SubFoldout | FoldoutOption.NoSpaceAtEnd, Drawer_SectionBloomQualitySettings),
CED.FoldoutGroup(Styles.chromaticAberrationQualitySettings, Expandable.ChromaticAberrationQuality, k_ExpandedState, FoldoutOption.Indent | FoldoutOption.SubFoldout | FoldoutOption.NoSpaceAtEnd, Drawer_SectionChromaticAberrationQualitySettings)
),
CED.FoldoutGroup(Styles.xrTitle, Expandable.XR, k_ExpandedState, Drawer_SectionXRSettings)
CED.FoldoutGroup(Styles.xrTitle, Expandable.XR, k_ExpandedState, Drawer_SectionXRSettings),
CED.FoldoutGroup(Styles.virtualTexturingTitle, Expandable.VirtualTexturing, k_ExpandedState, Drawer_SectionVTSettings)
);

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

static void Drawer_SectionVTSettings(SerializedHDRenderPipelineAsset serialized, Editor owner)
{
virtualTexturingSettingsUI.OnGUI(serialized, owner);
}

static private bool m_ShowDoFLowQualitySection = false;
static private bool m_ShowDoFMediumQualitySection = false;
static private bool m_ShowDoFHighQualitySection = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SerializedHDRenderPipelineAsset
public SerializedFrameSettings defaultFrameSettings;
public SerializedFrameSettings defaultBakedOrCustomReflectionFrameSettings;
public SerializedFrameSettings defaultRealtimeReflectionFrameSettings;
public SerializedVirtualTexturingSettings virtualTexturingSettings;

//RenderPipelineResources not always exist and thus cannot be serialized normally.
public bool editorResourceHasMultipleDifferentValues
Expand Down Expand Up @@ -63,6 +64,8 @@ public SerializedHDRenderPipelineAsset(SerializedObject serializedObject)
defaultFrameSettings = new SerializedFrameSettings(serializedObject.FindProperty("m_RenderingPathDefaultCameraFrameSettings"), null); //no overrides in HDRPAsset
defaultBakedOrCustomReflectionFrameSettings = new SerializedFrameSettings(serializedObject.FindProperty("m_RenderingPathDefaultBakedOrCustomReflectionFrameSettings"), null); //no overrides in HDRPAsset
defaultRealtimeReflectionFrameSettings = new SerializedFrameSettings(serializedObject.FindProperty("m_RenderingPathDefaultRealtimeReflectionFrameSettings"), null); //no overrides in HDRPAsset

virtualTexturingSettings = new SerializedVirtualTexturingSettings(serializedObject.FindProperty("virtualTexturingSettings"));
}

public void Update()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using UnityEditor.Rendering;
using UnityEngine.Rendering.HighDefinition;

namespace UnityEditor.Rendering.HighDefinition
{
public sealed class SerializedVirtualTexturingSettings
{
public SerializedProperty root;

public SerializedProperty streamingCpuCacheSizeInMegaBytes;
public SerializedProperty streamingGpuCacheSettings;
public SerializedVirtualTexturingSettings(SerializedProperty root)
{
this.root = root;

streamingCpuCacheSizeInMegaBytes = root.Find((VirtualTexturingSettingsSRP s) => s.streamingCpuCacheSizeInMegaBytes);
streamingGpuCacheSettings = root.Find((VirtualTexturingSettingsSRP s) => s.streamingGpuCacheSettings);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading