From 3a8d06022f55479e6d02b9e060108dd046cc679a Mon Sep 17 00:00:00 2001 From: Unity Technologies <@unity.com> Date: Sat, 8 May 2021 04:20:38 +0200 Subject: [PATCH] com.unity.render-pipelines.core@12.0.0 in Unity 2021.2.0a17 ## [12.0.0] - 2021-01-11 ### Changed - ClearFlag.Depth does not implicitely clear stencil anymore. ClearFlag.Stencil added. - The RTHandleSystem no longer requires a specific number of sample for MSAA textures. Number of samples can be chosen independently for all textures. ### Fixed - Fixed missing warning UI about Projector component being unsupported (case 1300327). - Fixed the display name of a Volume Parameter when is defined the attribute InspectorName - Calculating correct rtHandleScale by considering the possible pixel rounding when DRS is on - Problem on domain reload of Volume Parameter Ranges and UI values - Fixed Right Align of additional properties on Volume Components Editors - Fixed normal bias field of reference volume being wrong until the profile UI was displayed. - Fixed L2 for Probe Volumes. - Fixed assertion on compression of L1 coefficients for Probe Volume. ### Added - Support for the PlayStation 5 platform has been added. - Support for additional properties for Volume Components without custom editor - Calculating correct rtHandleScale by considering the possible pixel rounding when DRS is on - Support for the PlayStation 5 platform has been added. - Support for the XboxSeries platform has been added. - Added Editor window that allow showing an icon to browse the documentation - New method DrawHeaders for VolumeComponentsEditors - Unification of Material Editor Headers Scopes - New API functions with no side effects in DynamicResolutionHandler, to retrieve resolved drs scale and to apply DRS on a size. - Added a blitter for the SRPs. - Added 2D texture atlases. - New methods on CoreEditorDrawers, to allow adding a label on a group before rendering the internal drawers - Method to generate a Texture2D of 1x1 with a plain color - Red, Green, Blue Texture2D on CoreEditorStyles - New API in DynamicResolutionHandler to handle multicamera rendering for hardware mode. Changing cameras and resetting scaling per camera should be safe. - Added SpeedTree8MaterialUpgrader, which provides utilities for upgrading and importing SpeedTree 8 assets to scriptable render pipelines. - Adding documentation links to Light Sections ### Changed - Changed Window/Render Pipeline/Render Pipeline Debug to Window/Rendering/Render Pipeline Debugger - Changed Window/Render Pipeline/Look Dev to Window/Analysis/Look Dev - Changed Window/Render Pipeline/Render Graph Viewer to Window/Analysis/Render Graph Viewer - Changed Window/Render Pipeline/Graphics Compositor to Window/Rendering/Graphics Compositor - Volume Gizmo Color setting is now under Colors->Scene->Volume Gizmo - Volume Gizmo alpha changed from 0.5 to 0.125 - Moved Edit/Render Pipeline/Generate Shader Includes to Edit/Rendering/Generate Shader Includes - Moved Assets/Create/LookDev/Environment Library to Assets/Create/Rendering/Environment Library (Look Dev) - Changed Nintendo Switch specific half float fixes in color conversion routines to all platforms. - Improved load asset time for probe volumes. ### Added - Added class for drawing shadow cascades `UnityEditor.Rendering.ShadowCascadeGUI.DrawShadowCascades`. --- CHANGELOG.md | 4 + Documentation~/TableOfContents.md | 2 + Documentation~/rthandle-system-using.md | 10 +- Documentation~/whats-new-12.md | 11 + Documentation~/whats-new.md | 7 + Editor/CoreEditorDrawers.cs | 24 +- Editor/CoreEditorUtils.cs | 36 +- Editor/Lighting/ISerializedLight.cs | 24 + .../Lighting/ISerializedLight.cs.meta | 2 +- .../ProbeVolume/InstancedProbeShader.shader | 97 - .../InstancedProbeShader.shader.meta | 10 - Editor/Lighting/ProbeVolume/ProbeGIBaking.cs | 1 - Editor/Lighting/ProbeVolume/ProbePlacement.cs | 4 +- .../ProbeReferenceVolumeAuthoringEditor.cs | 225 +- .../ProbeVolume/ProbeVolumeUI.Skin.cs | 2 +- Editor/RenderPipeline.meta | 8 + .../RenderPipelineResourcesEditor.cs | 32 + .../RenderPipelineResourcesEditor.cs.meta | 11 + Editor/SpeedTree8MaterialUpgrader.cs | 191 ++ Editor/SpeedTree8MaterialUpgrader.cs.meta | 11 + Runtime/Debugging/DebugUpdater.cs | 36 +- .../Prefabs/Resources/DebugUICanvas.prefab | 2 +- .../Resources/DebugUIPersistentCanvas.prefab | 316 +-- .../Prefabs/Scripts/DebugUIHandlerCanvas.cs | 35 +- .../Scripts/DebugUIHandlerEnumField.cs | 11 +- .../Prefabs/Scripts/DebugUIHandlerPanel.cs | 20 +- .../Prefabs/Widgets/DebugUIEnumField.prefab | 540 ++++- .../Prefabs/Widgets/DebugUIFloatField.prefab | 780 ++++++- .../Prefabs/Widgets/DebugUIPanel.prefab | 1982 +++++++++++------ .../Lighting/ProbeVolume/ProbeBrickIndex.cs | 122 +- .../Lighting/ProbeVolume/ProbeBrickPool.cs | 124 +- .../ProbeVolume/ProbeReferenceVolume.Debug.cs | 240 ++ .../ProbeReferenceVolume.Debug.cs.hlsl | 15 + .../ProbeReferenceVolume.Debug.cs.hlsl.meta | 7 + .../ProbeReferenceVolume.Debug.cs.meta | 11 + .../ProbeVolume/ProbeReferenceVolume.cs | 170 +- .../ProbeReferenceVolumeAuthoring.cs | 31 +- .../ProbeReferenceVolumeProfile.cs | 6 - Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl | 116 +- .../ProbeVolume/ProbeVolumesOptions.cs | 20 + .../ProbeVolume/ProbeVolumesOptions.cs.meta | 11 + .../ShaderVariablesProbeVolumes.cs | 24 + .../ShaderVariablesProbeVolumes.cs.hlsl | 18 + .../ShaderVariablesProbeVolumes.cs.hlsl.meta | 7 + .../ShaderVariablesProbeVolumes.cs.meta | 11 + Runtime/RenderGraph/RenderGraph.cs | 2 +- .../RenderGraphResourceRegistry.cs | 8 - .../RenderGraph/RenderGraphResourceTexture.cs | 12 +- .../IOverrideCoreEditorResources.cs | 16 - .../RenderPipeline/RenderPipelineResources.cs | 15 + .../RenderPipelineResources.cs.meta | 11 + Runtime/Textures/BufferedRTHandleSystem.cs | 7 +- Runtime/Textures/RTHandle.cs | 3 + Runtime/Textures/RTHandleSystem.cs | 101 +- Runtime/Textures/RTHandles.cs | 43 +- Runtime/Textures/TextureXR.cs | 8 +- ShaderLibrary/AreaLighting.hlsl | 3 +- ShaderLibrary/Common.hlsl | 3 +- ShaderLibrary/Debug.hlsl | 26 +- 59 files changed, 3799 insertions(+), 1826 deletions(-) create mode 100644 Documentation~/whats-new-12.md create mode 100644 Documentation~/whats-new.md create mode 100644 Editor/Lighting/ISerializedLight.cs rename Runtime/RenderPipeline/IOverrideCoreEditorResources.cs.meta => Editor/Lighting/ISerializedLight.cs.meta (83%) delete mode 100644 Editor/Lighting/ProbeVolume/InstancedProbeShader.shader delete mode 100644 Editor/Lighting/ProbeVolume/InstancedProbeShader.shader.meta create mode 100644 Editor/RenderPipeline.meta create mode 100644 Editor/RenderPipeline/RenderPipelineResourcesEditor.cs create mode 100644 Editor/RenderPipeline/RenderPipelineResourcesEditor.cs.meta create mode 100644 Editor/SpeedTree8MaterialUpgrader.cs create mode 100644 Editor/SpeedTree8MaterialUpgrader.cs.meta create mode 100644 Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs create mode 100644 Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl create mode 100644 Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl.meta create mode 100644 Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.meta create mode 100644 Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs create mode 100644 Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs.meta create mode 100644 Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs create mode 100644 Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl create mode 100644 Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl.meta create mode 100644 Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.meta delete mode 100644 Runtime/RenderPipeline/IOverrideCoreEditorResources.cs create mode 100644 Runtime/RenderPipeline/RenderPipelineResources.cs create mode 100644 Runtime/RenderPipeline/RenderPipelineResources.cs.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a6fef..fad9159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - ClearFlag.Depth does not implicitely clear stencil anymore. ClearFlag.Stencil added. +- The RTHandleSystem no longer requires a specific number of sample for MSAA textures. Number of samples can be chosen independently for all textures. ### Fixed - Fixed missing warning UI about Projector component being unsupported (case 1300327). @@ -35,6 +36,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Method to generate a Texture2D of 1x1 with a plain color - Red, Green, Blue Texture2D on CoreEditorStyles - New API in DynamicResolutionHandler to handle multicamera rendering for hardware mode. Changing cameras and resetting scaling per camera should be safe. +- Added SpeedTree8MaterialUpgrader, which provides utilities for upgrading and importing SpeedTree 8 assets to scriptable render pipelines. +- Adding documentation links to Light Sections ### Changed - Changed Window/Render Pipeline/Render Pipeline Debug to Window/Rendering/Render Pipeline Debugger @@ -46,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Moved Edit/Render Pipeline/Generate Shader Includes to Edit/Rendering/Generate Shader Includes - Moved Assets/Create/LookDev/Environment Library to Assets/Create/Rendering/Environment Library (Look Dev) - Changed Nintendo Switch specific half float fixes in color conversion routines to all platforms. +- Improved load asset time for probe volumes. ### Added - Added class for drawing shadow cascades `UnityEditor.Rendering.ShadowCascadeGUI.DrawShadowCascades`. diff --git a/Documentation~/TableOfContents.md b/Documentation~/TableOfContents.md index c2ade8b..ddfd5f1 100644 --- a/Documentation~/TableOfContents.md +++ b/Documentation~/TableOfContents.md @@ -1,4 +1,6 @@ * [SRP Core](index.md) +* [What's new](whats-new.md) + * [12](whats-new-12.md) * Camera components * [Free Camera](Free-Camera.md) * [Camera Switcher](Camera-Switcher.md) diff --git a/Documentation~/rthandle-system-using.md b/Documentation~/rthandle-system-using.md index e08b66d..58be25f 100644 --- a/Documentation~/rthandle-system-using.md +++ b/Documentation~/rthandle-system-using.md @@ -8,18 +8,16 @@ All operations related to `RTHandles` require an instance of the `RTHandleSystem ```c# RTHandleSystem m_RTHandleSystem = new RTHandleSystem(); -m_RTHandleSystem.Initialize(Screen.width, Screen.height, scaledRTsupportsMSAA: true, scaledRTMSAASamples: MSAASamples.MSAA4x); +m_RTHandleSystem.Initialize(Screen.width, Screen.height); ``` When you initialize the system, you must supply the starting resolution. The above code example uses the width and height of the screen. Because the RTHandle system only reallocates render textures when a Camera requires a resolution larger than the current maximum size, the internal `RTHandle` resolution can only increase from the value you pass in here. It is good practice to initialize this resolution to be the resolution of the main display. This means the system does not need to unnecessarily reallocate the render textures (and cause unwanted memory spikes) at the beginning of the application. -If you want to use multi-sample anti-aliasing (MSAA), you must declare the MSAA sample mode during initialization. In the example code above, the RTHandle system supports MSAA and uses the MSAA4x mode. The RTHandle system allocates all textures with the same number of samples. You can change the sample mode later, but this changes the sample mode for all automatically resized textures. - You must only call the `Initialize` function once at the beginning of the application. After this, you can use the initialized instance to allocate textures. Because you allocate the majority of `RTHandles` from the same `RTHandleSystem` instance, the RTHandle system also provides a default global instance through the `RTHandles` static class. Rather than maintain your own instance of `RTHandleSystem`, this allows you to use the same API that you get with an instance, but not worry about the lifetime of the instance. Using the static instance, the initialization becomes this: ```c# -RTHandles.Initialize(Screen.width, Screen.height, scaledRTsupportsMSAA: true, scaledRTMSAASamples: MSAASamples.MSAA4x); +RTHandles.Initialize(Screen.width, Screen.height); ``` The code examples in the rest of this page use the default global instance. @@ -29,7 +27,7 @@ The code examples in the rest of this page use the default global instance. Before rendering with a Camera, you need to set the resolution the RTHandle system uses as a reference size. To do so, call the `SetReferenceSize` function. ```c# -RTHandles.SetReferenceSize(width, hight, msaaSamples); +RTHandles.SetReferenceSize(width, height); ``` Calling this function has two effects: @@ -166,7 +164,7 @@ public void ReleaseBuffer(int bufferId); In the same way that you provide the reference size for regular `RTHandleSystems`, you must do this for each instance of `BufferedRTHandleSystem`. ```c# -public void SwapAndSetReferenceSize(int width, int height, MSAASamples msaaSamples); +public void SwapAndSetReferenceSize(int width, int height); ``` This works the same way as regular RTHandleSystem but it also swaps the buffers internally so that the 0 index for `GetFrameRT` still references the current frame buffer. This slightly different way of handling Camera-specific buffers also has implications when you write shader code. diff --git a/Documentation~/whats-new-12.md b/Documentation~/whats-new-12.md new file mode 100644 index 0000000..80129f9 --- /dev/null +++ b/Documentation~/whats-new-12.md @@ -0,0 +1,11 @@ +# What's new in SRP Core version 12 / Unity 2021.2 + +This page contains an overview of new features, improvements, and issues resolved in version 12 of the Core Render Pipeline package, embedded in Unity 2021.2. + +## Improvements + +### RTHandle System and MSAA + +The RTHandle System no longer requires you to specify the number of MSAA samples at initialization time. This means that you can now set the number of samples on a per texture basis, rather than for the whole system. + +In practice, this means that the initialization APIs no longer require MSAA related parameters. The `Alloc` functions have replaced the `enableMSAA` parameter and enables you to explicitly set the number of samples. diff --git a/Documentation~/whats-new.md b/Documentation~/whats-new.md new file mode 100644 index 0000000..5991a94 --- /dev/null +++ b/Documentation~/whats-new.md @@ -0,0 +1,7 @@ +# What's new in SRP Core + +This section contains information about changes to SRP Core. Each page contains a list of new features and, if relevant, a list of improvements and a list of resolved issues. + +The list of pages is as follows: + +- [12](whats-new-12.md) diff --git a/Editor/CoreEditorDrawers.cs b/Editor/CoreEditorDrawers.cs index b981482..1743242 100644 --- a/Editor/CoreEditorDrawers.cs +++ b/Editor/CoreEditorDrawers.cs @@ -1,7 +1,10 @@ using System; using System.Collections.Generic; +using System.Linq; +using System.Reflection; using UnityEngine; using UnityEditor.AnimatedValues; +using UnityEngine.Rendering; namespace UnityEditor.Rendering { @@ -534,6 +537,20 @@ public static IDrawer FoldoutGroup(GUIContent title, TEnum mask, return FoldoutGroup(title, mask, state, options, null, null, contentDrawers); } + static string GetHelpURL(TEnum mask) + where TEnum : struct, IConvertible + { + var helpURLAttribute = (HelpURLAttribute)mask + .GetType() + .GetCustomAttributes(typeof(HelpURLAttribute), false) + .FirstOrDefault(); + + if (helpURLAttribute == null) + return string.Empty; + + return $"{helpURLAttribute.URL}#{mask}"; + } + // This one is private as we do not want to have unhandled advanced switch. Change it if necessary. static IDrawer FoldoutGroup(GUIContent title, TEnum mask, ExpandedState state, FoldoutOption options, Enabler showAdditionalProperties, SwitchEnabler switchAdditionalProperties, params ActionDrawer[] contentDrawers) where TEnum : struct, IConvertible @@ -554,9 +571,12 @@ static IDrawer FoldoutGroup(GUIContent title, TEnum mask, Expande else { CoreEditorUtils.DrawSplitter(isBoxed); - newExpended = CoreEditorUtils.DrawHeaderFoldout(title, expended, isBoxed, + newExpended = CoreEditorUtils.DrawHeaderFoldout(title, + expended, + isBoxed, showAdditionalProperties == null ? (Func)null : () => showAdditionalProperties(data, owner), - switchAdditionalProperties == null ? (Action)null : () => switchAdditionalProperties(data, owner)); + switchAdditionalProperties == null ? (Action)null : () => switchAdditionalProperties(data, owner), + GetHelpURL(mask)); } if (newExpended ^ expended) state[mask] = newExpended; diff --git a/Editor/CoreEditorUtils.cs b/Editor/CoreEditorUtils.cs index 1858ca2..91eaa88 100644 --- a/Editor/CoreEditorUtils.cs +++ b/Editor/CoreEditorUtils.cs @@ -230,7 +230,7 @@ public static bool DrawHeaderFoldout(string title, bool state, bool isBoxed = fa /// [optional] Delegate used to draw the right state of the advanced button. If null, no button drawn. /// [optional] Callback call when advanced button clicked. Should be used to toggle its state. /// return the state of the foldout header - public static bool DrawHeaderFoldout(GUIContent title, bool state, bool isBoxed = false, Func hasMoreOptions = null, Action toggleMoreOptions = null) + public static bool DrawHeaderFoldout(GUIContent title, bool state, bool isBoxed = false, Func hasMoreOptions = null, Action toggleMoreOptions = null, string documentationURL = "") { const float height = 17f; var backgroundRect = GUILayoutUtility.GetRect(1f, height); @@ -270,7 +270,7 @@ public static bool DrawHeaderFoldout(GUIContent title, bool state, bool isBoxed // Context menu var menuIcon = CoreEditorStyles.paneOptionsIcon; - var menuRect = new Rect(labelRect.xMax + 3f, labelRect.y + 1f, menuIcon.width, menuIcon.height); + var menuRect = new Rect(labelRect.xMax + 3f, labelRect.y + 1f, 16, 16); // Add context menu for "Additional Properties" Action contextAction = null; @@ -285,6 +285,9 @@ public static bool DrawHeaderFoldout(GUIContent title, bool state, bool isBoxed contextAction(new Vector2(menuRect.x, menuRect.yMax)); } + // Documentation button + ShowHelpButton(menuRect, documentationURL, title); + var e = Event.current; if (e.type == EventType.MouseDown) @@ -489,19 +492,7 @@ public static bool DrawHeaderToggle(GUIContent title, SerializedProperty group, } // Documentation button - if (!String.IsNullOrEmpty(documentationURL)) - { - var documentationRect = contextMenuRect; - documentationRect.x -= 16 + 5; - documentationRect.y -= 1; - - var documentationTooltip = $"Open Reference for {title.text}."; - var documentationIcon = new GUIContent(EditorGUIUtility.TrIconContent("_Help").image, documentationTooltip); - var documentationStyle = new GUIStyle("IconButton"); - - if (GUI.Button(documentationRect, documentationIcon, documentationStyle)) - System.Diagnostics.Process.Start(documentationURL); - } + ShowHelpButton(contextMenuRect, documentationURL, title); // Handle events var e = Event.current; @@ -524,6 +515,21 @@ public static bool DrawHeaderToggle(GUIContent title, SerializedProperty group, return group.isExpanded; } + static void ShowHelpButton(Rect contextMenuRect, string documentationURL, GUIContent title) + { + if (string.IsNullOrEmpty(documentationURL)) + return; + + var documentationRect = contextMenuRect; + documentationRect.x -= 16 + 5; + documentationRect.y -= 1; + + var documentationIcon = new GUIContent(CoreEditorStyles.iconHelp, $"Open Reference for {title.text}."); + + if (GUI.Button(documentationRect, documentationIcon, CoreEditorStyles.iconHelpStyle)) + Help.BrowseURL(documentationURL); + } + static void OnContextClick(Vector2 position, Func hasMoreOptions, Action toggleMoreOptions) { var menu = new GenericMenu(); diff --git a/Editor/Lighting/ISerializedLight.cs b/Editor/Lighting/ISerializedLight.cs new file mode 100644 index 0000000..1c2906b --- /dev/null +++ b/Editor/Lighting/ISerializedLight.cs @@ -0,0 +1,24 @@ +namespace UnityEditor.Rendering +{ + /// + /// Interface to be implemented by each pipeline to hold the for a Light Editor + /// + public interface ISerializedLight + { + /// The base settings of the light + LightEditor.Settings settings { get; } + /// The light serialized + SerializedObject serializedObject { get; } + /// The additinal light data serialized + SerializedObject serializedAdditionalDataObject { get; } + + /// Light Intensity Property + SerializedProperty intensity { get; } + + /// Method that updates the of the Light and the Additional Light Data + void Update(); + + /// Method that applies the modified properties the of the Light and the Light Camera Data + void Apply(); + } +} diff --git a/Runtime/RenderPipeline/IOverrideCoreEditorResources.cs.meta b/Editor/Lighting/ISerializedLight.cs.meta similarity index 83% rename from Runtime/RenderPipeline/IOverrideCoreEditorResources.cs.meta rename to Editor/Lighting/ISerializedLight.cs.meta index 5ac5396..b808670 100644 --- a/Runtime/RenderPipeline/IOverrideCoreEditorResources.cs.meta +++ b/Editor/Lighting/ISerializedLight.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 887d95bcebfeb23438020d963f229f1b +guid: 8f69c566379255640bf031b4ae7fe0f5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Editor/Lighting/ProbeVolume/InstancedProbeShader.shader b/Editor/Lighting/ProbeVolume/InstancedProbeShader.shader deleted file mode 100644 index 0c94264..0000000 --- a/Editor/Lighting/ProbeVolume/InstancedProbeShader.shader +++ /dev/null @@ -1,97 +0,0 @@ -Shader "Hidden/InstancedProbeShader" -{ - Properties - { - } - - SubShader - { - Tags { "RenderType" = "Opaque" } - LOD 100 - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma multi_compile_instancing - #include "UnityCG.cginc" - #include "Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/DecodeSH.hlsl" - - uniform int _ShadingMode; - uniform float _ExposureCompensation; - uniform float _ProbeSize; - uniform float4 _Color; - - struct appdata - { - float4 vertex : POSITION; - float3 normal : NORMAL; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct v2f - { - float4 vertex : SV_POSITION; - float3 normal : TEXCOORD1; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - UNITY_INSTANCING_BUFFER_START(Props) - UNITY_DEFINE_INSTANCED_PROP(float4, _R) - UNITY_DEFINE_INSTANCED_PROP(float4, _G) - UNITY_DEFINE_INSTANCED_PROP(float4, _B) - UNITY_DEFINE_INSTANCED_PROP(float4, _Validity) - UNITY_INSTANCING_BUFFER_END(Props) - - v2f vert(appdata v) - { - v2f o; - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - - o.vertex = UnityObjectToClipPos(v.vertex * _ProbeSize); - o.normal = UnityObjectToWorldNormal(v.normal); - - return o; - } - - float3 evalSH(float3 normal, float4 SHAr, float4 SHAg, float4 SHAb) - { - float4 normalPadded = float4(normal, 1); - - float3 x; - - SHAr.xyz = DecodeSH(SHAr.w, SHAr.xyz); - SHAg.xyz = DecodeSH(SHAg.w, SHAg.xyz); - SHAb.xyz = DecodeSH(SHAb.w, SHAb.xyz); - - // Linear (L1) + constant (L0) polynomial terms - x.r = dot(SHAr, normalPadded); - x.g = dot(SHAg, normalPadded); - x.b = dot(SHAb, normalPadded); - - return x; - } - - float4 frag(v2f i) : SV_Target - { - UNITY_SETUP_INSTANCE_ID(i); - if (_ShadingMode == 1) - { - float4 r = UNITY_ACCESS_INSTANCED_PROP(Props, _R); - float4 g = UNITY_ACCESS_INSTANCED_PROP(Props, _G); - float4 b = UNITY_ACCESS_INSTANCED_PROP(Props, _B); - - return float4(evalSH(normalize(i.normal), r, g, b) * exp2(_ExposureCompensation), 1); - } - else if (_ShadingMode == 2) - { - return UNITY_ACCESS_INSTANCED_PROP(Props, _Validity); - } - return _Color; - } - ENDCG - } - } -} diff --git a/Editor/Lighting/ProbeVolume/InstancedProbeShader.shader.meta b/Editor/Lighting/ProbeVolume/InstancedProbeShader.shader.meta deleted file mode 100644 index fbd8d9a..0000000 --- a/Editor/Lighting/ProbeVolume/InstancedProbeShader.shader.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: d176dd7e34cd6c940b5a8801282ea3ef -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - preprocessorOverride: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs b/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs index 95dc7a7..02334de 100644 --- a/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs +++ b/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs @@ -74,7 +74,6 @@ static public void Clear() refVol.Clear(); refVol.SetTRS(refVolAuthoring.transform.position, refVolAuthoring.transform.rotation, refVolAuthoring.brickSize); refVol.SetMaxSubdivision(refVolAuthoring.maxSubdivision); - refVol.SetNormalBias(refVolAuthoring.normalBias); } cellIndex2SceneReferences.Clear(); diff --git a/Editor/Lighting/ProbeVolume/ProbePlacement.cs b/Editor/Lighting/ProbeVolume/ProbePlacement.cs index d6c690e..da8c54d 100644 --- a/Editor/Lighting/ProbeVolume/ProbePlacement.cs +++ b/Editor/Lighting/ProbeVolume/ProbePlacement.cs @@ -149,11 +149,13 @@ public static void SubdivisionAlgorithm(ProbeReferenceVolume.Volume cellVolume, // Find the local max from all overlapping probe volumes: float localMaxSubdiv = 0; float localMinSubdiv = 0; + bool overlap = false; foreach (ProbeReferenceVolume.Volume v in probeVolumes) { ProbeReferenceVolume.Volume vol = v; if (ProbeVolumePositioning.OBBIntersect(ref vol, ref brickVolume)) { + overlap = true; localMaxSubdiv = Mathf.Max(localMaxSubdiv, vol.maxSubdivisionMultiplier); // Do we use max for min subdiv too? localMinSubdiv = Mathf.Max(localMinSubdiv, vol.minSubdivisionMultiplier); @@ -164,7 +166,7 @@ public static void SubdivisionAlgorithm(ProbeReferenceVolume.Volume cellVolume, bool belowMinSubdiv = subdivisionLevel <= ProbeReferenceVolume.instance.GetMaxSubdivision(localMinSubdiv); // Keep bricks that overlap at least one probe volume, and at least one influencer (mesh) - if (belowMinSubdiv || (belowMaxSubdiv && ShouldKeepBrick(probeVolumes, brickVolume) && ShouldKeepBrick(influenceVolumes, brickVolume))) + if ((belowMinSubdiv && overlap) || (belowMaxSubdiv && ShouldKeepBrick(probeVolumes, brickVolume) && ShouldKeepBrick(influenceVolumes, brickVolume))) { f.subdivide = true; diff --git a/Editor/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoringEditor.cs b/Editor/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoringEditor.cs index 0c7f3bb..fb3965c 100644 --- a/Editor/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoringEditor.cs +++ b/Editor/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoringEditor.cs @@ -12,22 +12,6 @@ namespace UnityEngine.Experimental.Rendering [CustomEditor(typeof(ProbeReferenceVolumeAuthoring))] internal class ProbeReferenceVolumeAuthoringEditor : Editor { - // debug gizmo data - class CellInstancedDebugProbes - { - public List probeBuffers; - public List props; - public List probeMaps; - public Hash128 cellHash; - public Vector3 cellPosition; - } - - private SerializedProperty m_DrawProbes; - private SerializedProperty m_DrawBricks; - private SerializedProperty m_DrawCells; - private SerializedProperty m_ProbeShading; - private SerializedProperty m_CullingDistance; - private SerializedProperty m_ExposureCompensation; private SerializedProperty m_Dilate; private SerializedProperty m_MaxDilationSamples; private SerializedProperty m_MaxDilationSampleDistance; @@ -40,35 +24,15 @@ class CellInstancedDebugProbes internal static readonly GUIContent s_DataAssetLabel = new GUIContent("Data asset", "The asset which serializes all probe related data in this volume."); internal static readonly GUIContent s_ProfileAssetLabel = new GUIContent("Profile", "The asset which determines the characteristics of the probe reference volume."); - private string[] ProbeShadingModes = { "Size", "SH", "Validity" }; - - private static bool DebugVisualizationGroupEnabled; private static bool DilationGroupEnabled; private float DilationValidityThresholdInverted; ProbeReferenceVolumeAuthoring actualTarget => target as ProbeReferenceVolumeAuthoring; - // Debug Properties - Mesh debugMesh; - Material debugMaterial; - const int probesPerBatch = 1023; - List cellDebugData = new List(); - - //Once the onRenderPipelineTypeChanged event is made public, we won't need the following: - static EventInfo onRenderPipelineTypeChanged = typeof(RenderPipelineManager).GetEvent("activeRenderPipelineTypeChanged", BindingFlags.NonPublic | BindingFlags.Static); - static MethodInfo addHandler = onRenderPipelineTypeChanged.GetAddMethod(nonPublic: true); - static MethodInfo removeHandler = onRenderPipelineTypeChanged.GetAddMethod(nonPublic: true); - private void OnEnable() { m_Profile = serializedObject.FindProperty("m_Profile"); - m_DrawProbes = serializedObject.FindProperty("m_DrawProbes"); - m_DrawBricks = serializedObject.FindProperty("m_DrawBricks"); - m_DrawCells = serializedObject.FindProperty("m_DrawCells"); - m_ProbeShading = serializedObject.FindProperty("m_ProbeShading"); - m_CullingDistance = serializedObject.FindProperty("m_CullingDistance"); - m_ExposureCompensation = serializedObject.FindProperty("m_Exposure"); m_Dilate = serializedObject.FindProperty("m_Dilate"); m_MaxDilationSamples = serializedObject.FindProperty("m_MaxDilationSamples"); m_MaxDilationSampleDistance = serializedObject.FindProperty("m_MaxDilationSampleDistance"); @@ -77,15 +41,6 @@ private void OnEnable() m_VolumeAsset = serializedObject.FindProperty("volumeAsset"); DilationValidityThresholdInverted = 1f - m_DilationValidityThreshold.floatValue; - - // Update debug material in case the current render pipeline has a custom one - CheckInit(); - addHandler.Invoke(null, new Action[] { UpdateDebugMaterial }); - } - - void OnDisable() - { - removeHandler.Invoke(null, new Action[] { UpdateDebugMaterial }); } public override void OnInspectorGUI() @@ -96,22 +51,35 @@ public override void OnInspectorGUI() serializedObject.Update(); var probeReferenceVolumes = FindObjectsOfType(); - bool foundInconsistency = false; + bool mismatchedProfile = false; + bool mismatchedTransform = false; if (probeReferenceVolumes.Length > 1) { foreach (var o1 in probeReferenceVolumes) { foreach (var o2 in probeReferenceVolumes) { - if (!o1.profile.IsEquivalent(o2.profile) && !foundInconsistency) + if (!o1.profile.IsEquivalent(o2.profile)) { - EditorGUILayout.HelpBox("Multiple Probe Reference Volume components are loaded, but they have different profiles. " - + "This is unsupported, please make sure all loaded Probe Reference Volume have the same profile or profiles with equal values.", MessageType.Error, wide: true); - foundInconsistency = true; + mismatchedProfile = true; + } + if (o1.transform.worldToLocalMatrix != o2.transform.worldToLocalMatrix) + { + mismatchedTransform = true; } - if (foundInconsistency) break; } } + + if (mismatchedProfile) + { + EditorGUILayout.HelpBox("Multiple Probe Reference Volume components are loaded, but they have different profiles. " + + "This is unsupported, please make sure all loaded Probe Reference Volume have the same profile or profiles with equal values.", MessageType.Error, wide: true); + } + if (mismatchedTransform) + { + EditorGUILayout.HelpBox("Multiple Probe Reference Volume components are loaded, but they have different transforms. " + + "This is currently unsupported, please make sure all loaded Probe Reference Volume have the same transform.", MessageType.Error, wide: true); + } } EditorGUI.BeginChangeCheck(); @@ -149,22 +117,6 @@ public override void OnInspectorGUI() m_VolumeAsset.objectReferenceValue = EditorGUILayout.ObjectField(s_DataAssetLabel, m_VolumeAsset.objectReferenceValue, typeof(ProbeVolumeAsset), false); - DebugVisualizationGroupEnabled = EditorGUILayout.BeginFoldoutHeaderGroup(DebugVisualizationGroupEnabled, "Debug Visualization"); - if (DebugVisualizationGroupEnabled) - { - m_DrawCells.boolValue = EditorGUILayout.Toggle("Draw Cells", m_DrawCells.boolValue); - m_DrawBricks.boolValue = EditorGUILayout.Toggle("Draw Bricks", m_DrawBricks.boolValue); - m_DrawProbes.boolValue = EditorGUILayout.Toggle("Draw Probes", m_DrawProbes.boolValue); - EditorGUI.BeginDisabledGroup(!m_DrawProbes.boolValue); - m_ProbeShading.enumValueIndex = EditorGUILayout.Popup("Probe Shading Mode", m_ProbeShading.enumValueIndex, ProbeShadingModes); - EditorGUI.BeginDisabledGroup(m_ProbeShading.enumValueIndex != 1); - m_ExposureCompensation.floatValue = EditorGUILayout.FloatField("Probe Exposure Compensation", m_ExposureCompensation.floatValue); - EditorGUI.EndDisabledGroup(); - EditorGUI.EndDisabledGroup(); - m_CullingDistance.floatValue = EditorGUILayout.FloatField("Culling Distance", m_CullingDistance.floatValue); - } - EditorGUILayout.EndFoldoutHeaderGroup(); - DilationGroupEnabled = EditorGUILayout.BeginFoldoutHeaderGroup(DilationGroupEnabled, "Dilation"); if (DilationGroupEnabled) { @@ -192,149 +144,10 @@ public override void OnInspectorGUI() private void Constrain() { - m_CullingDistance.floatValue = Mathf.Max(m_CullingDistance.floatValue, 0); m_MaxDilationSamples.intValue = Mathf.Max(m_MaxDilationSamples.intValue, 0); m_MaxDilationSampleDistance.floatValue = Mathf.Max(m_MaxDilationSampleDistance.floatValue, 0); m_DilationValidityThreshold.floatValue = 1f - DilationValidityThresholdInverted; } - - private void CheckInit() - { - if (debugMesh == null || debugMaterial == null) - { - // Load debug mesh, material - debugMesh = AssetDatabase.LoadAssetAtPath("Packages/com.unity.render-pipelines.core/Editor/Resources/DebugProbe.fbx"); - UpdateDebugMaterial(); - } - } - - void UpdateDebugMaterial() - { - Shader debugShader = Shader.Find("Hidden/InstancedProbeShader"); - var srpAsset = QualitySettings.renderPipeline ?? GraphicsSettings.renderPipelineAsset; - if (srpAsset is IOverrideCoreEditorResources overrideResources) - debugShader = overrideResources.GetProbeVolumeProbeShader(); - - debugMaterial = new Material(debugShader) { enableInstancing = true }; - } - - public void OnSceneGUI() - { - if (Event.current.type == EventType.Layout) - DrawProbeGizmos(); - } - - void DrawProbeGizmos() - { - if (m_DrawProbes.boolValue) - { - // TODO: Update data on ref vol changes - if (cellDebugData.Count == 0) - CreateInstancedProbes(); - - // Debug data has not been loaded yet. - if (debugMesh == null || debugMaterial == null) - return; - - foreach (var debug in cellDebugData) - { - if (actualTarget.ShouldCull(debug.cellPosition, ProbeReferenceVolume.instance.GetTransform().posWS)) - continue; - - for (int i = 0; i < debug.probeBuffers.Count; ++i) - { - var probeBuffer = debug.probeBuffers[i]; - var props = debug.props[i]; - props.SetInt("_ShadingMode", m_ProbeShading.intValue); - props.SetFloat("_ExposureCompensation", -m_ExposureCompensation.floatValue); - props.SetFloat("_ProbeSize", Gizmos.probeSize * 100); - - var debugCam = SceneView.lastActiveSceneView.camera; - Graphics.DrawMeshInstanced(debugMesh, 0, debugMaterial, probeBuffer, probeBuffer.Length, props, ShadowCastingMode.Off, false, 0, debugCam, LightProbeUsage.Off, null); - } - } - } - } - - void CreateInstancedProbes() - { - foreach (var cell in ProbeReferenceVolume.instance.cells.Values) - { - if (cell.sh == null || cell.sh.Length == 0) - continue; - - float largestBrickSize = cell.bricks.Count == 0 ? 0 : cell.bricks[0].subdivisionLevel; - - List probeBuffers = new List(); - List props = new List(); - List probeMaps = new List(); - - // Batch probes for instanced rendering - for (int brickSize = 0; brickSize < largestBrickSize + 1; brickSize++) - { - List probeBuffer = new List(); - List probeMap = new List(); - - for (int i = 0; i < cell.probePositions.Length; i++) - { - // Skip probes which aren't of current brick size - if (cell.bricks[i / 64].subdivisionLevel == brickSize) - { - probeBuffer.Add(Matrix4x4.TRS(cell.probePositions[i], Quaternion.identity, Vector3.one * (0.3f * (brickSize + 1)))); - probeMap.Add(i); - } - - // Batch limit reached or out of probes - if (probeBuffer.Count >= probesPerBatch || i == cell.probePositions.Length - 1) - { - MaterialPropertyBlock prop = new MaterialPropertyBlock(); - float gradient = largestBrickSize == 0 ? 1 : brickSize / largestBrickSize; - prop.SetColor("_Color", Color.Lerp(Color.red, Color.green, gradient)); - props.Add(prop); - - probeBuffers.Add(probeBuffer.ToArray()); - probeBuffer = new List(); - probeMaps.Add(probeMap.ToArray()); - probeMap = new List(); - } - } - } - - var debugData = new CellInstancedDebugProbes(); - debugData.probeBuffers = probeBuffers; - debugData.props = props; - debugData.probeMaps = probeMaps; - debugData.cellPosition = cell.position; - - Vector4[][] shBuffer = new Vector4[4][]; - for (int i = 0; i < shBuffer.Length; i++) - shBuffer[i] = new Vector4[probesPerBatch]; - - Vector4[] validityColors = new Vector4[probesPerBatch]; - - for (int batchIndex = 0; batchIndex < debugData.probeMaps.Count; batchIndex++) - { - for (int indexInBatch = 0; indexInBatch < debugData.probeMaps[batchIndex].Length; indexInBatch++) - { - int probeIdx = debugData.probeMaps[batchIndex][indexInBatch]; - - shBuffer[0][indexInBatch] = new Vector4(cell.sh[probeIdx][0, 3], cell.sh[probeIdx][0, 1], cell.sh[probeIdx][0, 2], cell.sh[probeIdx][0, 0]); - shBuffer[1][indexInBatch] = new Vector4(cell.sh[probeIdx][1, 3], cell.sh[probeIdx][1, 1], cell.sh[probeIdx][1, 2], cell.sh[probeIdx][1, 0]); - shBuffer[2][indexInBatch] = new Vector4(cell.sh[probeIdx][2, 3], cell.sh[probeIdx][2, 1], cell.sh[probeIdx][2, 2], cell.sh[probeIdx][2, 0]); - - validityColors[indexInBatch] = Color.Lerp(Color.green, Color.red, cell.validity[probeIdx]); - } - - debugData.props[batchIndex].SetVectorArray("_R", shBuffer[0]); - debugData.props[batchIndex].SetVectorArray("_G", shBuffer[1]); - debugData.props[batchIndex].SetVectorArray("_B", shBuffer[2]); - - debugData.props[batchIndex].SetVectorArray("_Validity", validityColors); - } - - cellDebugData.Add(debugData); - } - } } } diff --git a/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs b/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs index 6b1d0c8..3cdcf41 100644 --- a/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs +++ b/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs @@ -7,7 +7,7 @@ static partial class ProbeVolumeUI internal static class Styles { internal const string k_featureWarning = "Warning: Probe Volumes is a highly experimental feature.\nIt is disabled by default for this reason.\nIt's functionality is subject to breaking changes and whole sale removal.\nIt is not recommended for use outside of for providing feedback.\nIt should not be used in production."; - internal const string k_featureEnableInfo = "\nProbe Volumes feature is disabled. To enable, set:\nProbeVolumesEvaluationMode = ProbeVolumesEvaluationModes.MaterialPass\ninside of ShaderConfig.cs and inside of the editor run:\nEdit->Rendering->Generate Shader Includes\nProbe Volumes feature must also be enabled inside of your HDRenderPipelineAsset."; + internal const string k_featureEnableInfo = "\nProbe Volumes feature is disabled. To enable, Probe Volumes feature must be enabled inside of your HDRenderPipelineAsset and the corresponding frame setting must be set on relevant cameras."; internal static readonly GUIContent s_Size = new GUIContent("Size", "Modify the size of this Probe Volume. This is independent of the Transform's Scale."); diff --git a/Editor/RenderPipeline.meta b/Editor/RenderPipeline.meta new file mode 100644 index 0000000..984568d --- /dev/null +++ b/Editor/RenderPipeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cfdb90e800bfd304780e27e0bec8b4e5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/RenderPipeline/RenderPipelineResourcesEditor.cs b/Editor/RenderPipeline/RenderPipelineResourcesEditor.cs new file mode 100644 index 0000000..e4e9f23 --- /dev/null +++ b/Editor/RenderPipeline/RenderPipelineResourcesEditor.cs @@ -0,0 +1,32 @@ +using UnityEditor; + +namespace UnityEngine.Rendering +{ + [CustomEditor(typeof(RenderPipelineResources), editorForChildClasses: true)] + class RenderPipelineResourcesEditor : Editor + { + public override void OnInspectorGUI() + { + DrawDefaultInspector(); + + // Add a "Reload All" button in inspector when we are in developer's mode + if (EditorPrefs.GetBool("DeveloperMode") + && GUILayout.Button("Reload All")) + { + foreach (RenderPipelineResources t in targets) + { + if (string.IsNullOrEmpty(t.packagePath_Internal)) + { + Debug.LogError($"packagePath is not set in {t.GetType().Name}. We will not be able to reload it. Skipping."); + continue; + } + + foreach (var field in t.GetType().GetFields()) + field.SetValue(t, null); + + ResourceReloader.ReloadAllNullIn(t, t.packagePath_Internal); + } + } + } + } +} diff --git a/Editor/RenderPipeline/RenderPipelineResourcesEditor.cs.meta b/Editor/RenderPipeline/RenderPipelineResourcesEditor.cs.meta new file mode 100644 index 0000000..08cc090 --- /dev/null +++ b/Editor/RenderPipeline/RenderPipelineResourcesEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f5ff1027825046c46884c3ad73d26610 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/SpeedTree8MaterialUpgrader.cs b/Editor/SpeedTree8MaterialUpgrader.cs new file mode 100644 index 0000000..2f2b3b6 --- /dev/null +++ b/Editor/SpeedTree8MaterialUpgrader.cs @@ -0,0 +1,191 @@ +using System.Collections.Generic; +using UnityEngine; +using System; + +namespace UnityEditor.Rendering +{ + /// + /// Material upgrader and relevant utilities for SpeedTree 8. + /// + public class SpeedTree8MaterialUpgrader : MaterialUpgrader + { + private enum WindQuality + { + None = 0, + Fastest, + Fast, + Better, + Best, + Palm, + Count + } + + private static string[] WindQualityString = + { + "_WINDQUALITY_NONE", + "_WINDQUALITY_FASTEST", + "_WINDQUALITY_FAST", + "_WINDQUALITY_BETTER", + "_WINDQUALITY_BEST", + "_WINDQUALITY_PALM" + }; + + /// + /// Creates a material upgrader that handles the property renames that HD and Universal have in common when upgrading + /// from the built-in SpeedTree 8 shader. + /// + /// Original SpeedTree8 shader name. + /// New SpeedTree 8 shader name. + /// A delegate that postprocesses the material for the render pipeline in use. + public SpeedTree8MaterialUpgrader(string sourceShaderName, string destShaderName, MaterialFinalizer finalizer = null) + { + RenameShader(sourceShaderName, destShaderName, finalizer); + RenameFloat("_WindQuality", "_WINDQUALITY"); + RenameFloat("_TwoSided", "_CullMode"); // Currently only used in HD. Update this once URP per-material cullmode is enabled via shadergraph. + } + + private static void ImportNewSpeedTree8Material(Material mat, int windQuality, bool isBillboard) + { + if (mat == null) + return; + + int cullmode = 0; + mat.SetFloat("_WINDQUALITY", windQuality); + if (isBillboard) + { + mat.SetFloat("EFFECT_BILLBOARD", 1.0f); + cullmode = 2; + } + if (mat.HasProperty("_CullMode")) + mat.SetFloat("_CullMode", cullmode); + + if (mat.IsKeywordEnabled("EFFECT_EXTRA_TEX")) + mat.SetFloat("EFFECT_EXTRA_TEX", 1.0f); + } + + /// + /// Postprocesses materials while you are importing a SpeedTree 8 asset. Call from OnPostprocessSpeedTree in a MaterialPostprocessor. + /// + /// The GameObject Unity creates from this imported SpeedTree. + /// The asset importer used to import this SpeedTree asset. + /// Render pipeline-specific material finalizer. + public static void PostprocessSpeedTree8Materials(GameObject speedtree, SpeedTreeImporter stImporter, MaterialFinalizer finalizer = null) + { + LODGroup lg = speedtree.GetComponent(); + LOD[] lods = lg.GetLODs(); + for (int l = 0; l < lods.Length; l++) + { + LOD lod = lods[l]; + bool isBillboard = stImporter.hasBillboard && (l == lods.Length - 1); + int wq = Mathf.Min(stImporter.windQualities[l], stImporter.bestWindQuality); + foreach (Renderer r in lod.renderers) + { + // Override default motion vector generation mode pending + // proper motion vector integration in SRPs. + r.motionVectorGenerationMode = MotionVectorGenerationMode.Camera; + foreach (Material m in r.sharedMaterials) + { + float cutoff = stImporter.alphaTestRef; + ImportNewSpeedTree8Material(m, wq, isBillboard); + if (finalizer != null) + finalizer(m); + } + } + } + } + + /// + /// Preserves wind quality and billboard settings while you are upgrading a SpeedTree 8 material from previous versions of SpeedTree 8. + /// Wind priority order is enabled keyword > _WindQuality float value. + /// Should work for upgrading versions within a pipeline and from standard to current pipeline. + /// + /// SpeedTree 8 material to upgrade. + public static void SpeedTree8MaterialFinalizer(Material material) + { + if (material.HasProperty("_TwoSided") && material.HasProperty("_CullMode")) + material.SetFloat("_CullMode", material.GetFloat("_TwoSided")); + + if (material.IsKeywordEnabled("EFFECT_EXTRA_TEX")) + material.SetFloat("EFFECT_EXTRA_TEX", 1.0f); + + bool isBillboard = material.IsKeywordEnabled("EFFECT_BILLBOARD"); + if (material.HasProperty("EFFECT_BILLBOARD")) + material.SetFloat("EFFECT_BILLBOARD", isBillboard ? 1.0f : 0.0f); + + UpgradeWindQuality(material); + } + + private static void UpgradeWindQuality(Material material, int windQuality = -1) + { + int wq = GetWindQuality(material, windQuality); + SetWindQuality(material, wq); + } + + private static int GetWindQuality(Material material, int windQuality = -1) + { + // Conservative wind quality priority: + // input WindQuality > enabled keyword > _WindQuality float value + if (!WindIntValid(windQuality)) + { + windQuality = GetWindQualityFromKeywords(material.shaderKeywords); + if (!WindIntValid(windQuality)) + { + windQuality = material.HasProperty("_WindQuality") ? (int)material.GetFloat("_WindQuality") : 0; + + if (!WindIntValid(windQuality)) + windQuality = 0; + } + } + return windQuality; + } + + private static void ClearWindKeywords(Material material) + { + if (material == null) + return; + for (int i = 0; i < (int)WindQuality.Count; i++) + { + material.DisableKeyword(WindQualityString[i]); + } + } + + private static void SetWindQuality(Material material, int windQuality) + { + Debug.Assert(WindIntValid(windQuality), "Attempting to set invalid wind quality on material " + material.name); + + if (material == null) + return; + + if (windQuality != GetWindQualityFromKeywords(material.shaderKeywords)) + { + ClearWindKeywords(material); + } + + material.EnableKeyword(WindQualityString[windQuality]); + material.SetFloat("_WindQuality", windQuality); // A legacy float used in native code to apply wind data + if (material.HasProperty("_WINDQUALITY")) + material.SetFloat("_WINDQUALITY", windQuality); // The actual name of the keyword enum for the shadergraph + } + + private static int GetWindQualityFromKeywords(string[] matKws) + { + foreach (string kw in matKws) + { + if (kw.StartsWith("_WINDQUALITY_")) + { + for (int i = 0; i < (int)WindQuality.Count; i++) + { + if (kw.EndsWith(WindQualityString[i])) + return i; + } + } + } + return -1; + } + + private static bool WindIntValid(int windInt) + { + return ((int)WindQuality.None <= windInt) && (windInt < (int)WindQuality.Count); + } + } +} diff --git a/Editor/SpeedTree8MaterialUpgrader.cs.meta b/Editor/SpeedTree8MaterialUpgrader.cs.meta new file mode 100644 index 0000000..2e4a879 --- /dev/null +++ b/Editor/SpeedTree8MaterialUpgrader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d24fb80a63f172749b7076ac6f006fe9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Debugging/DebugUpdater.cs b/Runtime/Debugging/DebugUpdater.cs index 6c4ac38..b2a0571 100644 --- a/Runtime/Debugging/DebugUpdater.cs +++ b/Runtime/Debugging/DebugUpdater.cs @@ -1,3 +1,5 @@ +using UnityEngine.EventSystems; + namespace UnityEngine.Rendering { class DebugUpdater : MonoBehaviour @@ -10,18 +12,42 @@ static void RuntimeInit() var go = new GameObject { name = "[Debug Updater]" }; go.AddComponent(); + + var es = GameObject.FindObjectOfType(); + if (es == null) + { + go.AddComponent(); + go.AddComponent(); + } DontDestroyOnLoad(go); } void Update() { - DebugManager.instance.UpdateActions(); + DebugManager debugManager = DebugManager.instance; + + debugManager.UpdateActions(); - if (DebugManager.instance.GetAction(DebugAction.EnableDebugMenu) != 0.0f) - DebugManager.instance.displayRuntimeUI = !DebugManager.instance.displayRuntimeUI; + if (debugManager.GetAction(DebugAction.EnableDebugMenu) != 0.0f) + { + debugManager.displayRuntimeUI = !debugManager.displayRuntimeUI; + } + else + { + if (Input.touchCount == 3) + { + foreach (var touch in Input.touches) + { + if (touch.phase == TouchPhase.Began) + debugManager.displayRuntimeUI = !debugManager.displayRuntimeUI; + } + } + } - if (DebugManager.instance.displayRuntimeUI && DebugManager.instance.GetAction(DebugAction.ResetAll) != 0.0f) - DebugManager.instance.Reset(); + if (debugManager.displayRuntimeUI && debugManager.GetAction(DebugAction.ResetAll) != 0.0f) + { + debugManager.Reset(); + } } } } diff --git a/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab b/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab index 314a81b..e9a4697 100644 --- a/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab +++ b/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab @@ -72,7 +72,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 m_ReferenceResolution: {x: 800, y: 600} diff --git a/Runtime/Debugging/Prefabs/Resources/DebugUIPersistentCanvas.prefab b/Runtime/Debugging/Prefabs/Resources/DebugUIPersistentCanvas.prefab index f78442f..29d9048 100644 --- a/Runtime/Debugging/Prefabs/Resources/DebugUIPersistentCanvas.prefab +++ b/Runtime/Debugging/Prefabs/Resources/DebugUIPersistentCanvas.prefab @@ -1,22 +1,12 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1822588063230394} - m_IsPrefabParent: 1 --- !u!1 &1388241697787146 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224499400523491650} - component: {fileID: 222203031975944290} @@ -30,85 +20,43 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1822588063230394 -GameObject: +--- !u!224 &224499400523491650 +RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224556897823040040} - - component: {fileID: 223125086719629416} - - component: {fileID: 114876729554496680} - - component: {fileID: 114213191034542798} - - component: {fileID: 114605181728370468} - m_Layer: 5 - m_Name: DebugUI Persistent Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &114213191034542798 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1822588063230394} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &114307594989265542 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1388241697787146} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1741964061, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalFit: 0 - m_VerticalFit: 1 ---- !u!114 &114399612179518328 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224556897823040040} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -5, y: -5} + m_SizeDelta: {x: 400, y: 0} + m_Pivot: {x: 1, y: 1} +--- !u!222 &222203031975944290 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1388241697787146} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 5 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 0 - m_Spacing: 0 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 1 - m_ChildControlWidth: 1 - m_ChildControlHeight: 0 + m_CullTransparentMesh: 0 --- !u!114 &114530022413994304 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1388241697787146} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -127,52 +75,93 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114605181728370468 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &114399612179518328 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1822588063230394} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388241697787146} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 87177621604658d4e893f55be7cfae4a, type: 3} + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} m_Name: m_EditorClassIdentifier: - panel: {fileID: 224499400523491650} - valuePrefab: {fileID: 224720214277421396, guid: dc0f88987826e6e48b1fe9c7c2b53a53, - type: 2} ---- !u!114 &114876729554496680 + m_Padding: + m_Left: 5 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 +--- !u!114 &114307594989265542 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1822588063230394} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388241697787146} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!222 &222203031975944290 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1388241697787146} + m_HorizontalFit: 0 + m_VerticalFit: 1 +--- !u!1 &1822588063230394 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224556897823040040} + - component: {fileID: 223125086719629416} + - component: {fileID: 114876729554496680} + - component: {fileID: 114213191034542798} + - component: {fileID: 114605181728370468} + m_Layer: 5 + m_Name: DebugUI Persistent Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224556897823040040 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1822588063230394} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224499400523491650} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!223 &223125086719629416 Canvas: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1822588063230394} m_Enabled: 1 serializedVersion: 3 @@ -188,40 +177,57 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 ---- !u!224 &224499400523491650 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1388241697787146} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224556897823040040} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -5, y: -5} - m_SizeDelta: {x: 400, y: 0} - m_Pivot: {x: 1, y: 1} ---- !u!224 &224556897823040040 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} +--- !u!114 &114876729554496680 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1822588063230394} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 224499400523491650} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &114213191034542798 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1822588063230394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114605181728370468 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1822588063230394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 87177621604658d4e893f55be7cfae4a, type: 3} + m_Name: + m_EditorClassIdentifier: + panel: {fileID: 224499400523491650} + valuePrefab: {fileID: 224720214277421396, guid: dc0f88987826e6e48b1fe9c7c2b53a53, + type: 3} diff --git a/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerCanvas.cs b/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerCanvas.cs index fd910d1..f4bcb6a 100644 --- a/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerCanvas.cs +++ b/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerCanvas.cs @@ -98,6 +98,7 @@ void Rebuild() go.name = panel.displayName; var uiPanel = go.GetComponent(); uiPanel.SetPanel(panel); + uiPanel.Canvas = this; m_UIPanels.Add(uiPanel); var container = go.GetComponent(); Traverse(panel, container.contentHolder, null); @@ -213,7 +214,7 @@ internal void ChangeSelection(DebugUIHandlerWidget widget, bool fromNext) } } - void SelectPreviousItem() + internal void SelectPreviousItem() { if (m_SelectedWidget == null) return; @@ -224,7 +225,25 @@ void SelectPreviousItem() ChangeSelection(newSelection, false); } - void SelectNextItem() + internal void SelectNextPanel() + { + int index = m_SelectedPanel + 1; + if (index >= m_UIPanels.Count) + index = 0; + index = Mathf.Clamp(index, 0, m_UIPanels.Count - 1); + ActivatePanel(index); + } + + internal void SelectPreviousPanel() + { + int index = m_SelectedPanel - 1; + if (index < 0) + index = m_UIPanels.Count - 1; + index = Mathf.Clamp(index, 0, m_UIPanels.Count - 1); + ActivatePanel(index); + } + + internal void SelectNextItem() { if (m_SelectedWidget == null) return; @@ -260,20 +279,12 @@ void HandleInput() { if (DebugManager.instance.GetAction(DebugAction.PreviousDebugPanel) != 0f) { - int index = m_SelectedPanel - 1; - if (index < 0) - index = m_UIPanels.Count - 1; - index = Mathf.Clamp(index, 0, m_UIPanels.Count - 1); - ActivatePanel(index); + SelectPreviousPanel(); } if (DebugManager.instance.GetAction(DebugAction.NextDebugPanel) != 0f) { - int index = m_SelectedPanel + 1; - if (index >= m_UIPanels.Count) - index = 0; - index = Mathf.Clamp(index, 0, m_UIPanels.Count - 1); - ActivatePanel(index); + SelectNextPanel(); } if (DebugManager.instance.GetAction(DebugAction.Action) != 0f) diff --git a/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerEnumField.cs b/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerEnumField.cs index bf1b2d0..f14c281 100644 --- a/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerEnumField.cs +++ b/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerEnumField.cs @@ -8,10 +8,15 @@ namespace UnityEngine.Rendering.UI /// public class DebugUIHandlerEnumField : DebugUIHandlerWidget { + /// Text displayed for the "next" button. + public Text nextButtonText; + /// Text displayed for the "previous" button. + public Text previousButtonText; /// Name of the enum field. public Text nameLabel; /// Value of the enum field. public Text valueLabel; + internal protected DebugUI.EnumField m_Field; internal override void SetWidget(DebugUI.Widget widget) @@ -30,6 +35,8 @@ internal override void SetWidget(DebugUI.Widget widget) /// State of the widget. public override bool OnSelection(bool fromNext, DebugUIHandlerWidget previous) { + nextButtonText.color = colorSelected; + previousButtonText.color = colorSelected; nameLabel.color = colorSelected; valueLabel.color = colorSelected; return true; @@ -40,6 +47,8 @@ public override bool OnSelection(bool fromNext, DebugUIHandlerWidget previous) /// public override void OnDeselection() { + nextButtonText.color = colorDefault; + previousButtonText.color = colorDefault; nameLabel.color = colorDefault; valueLabel.color = colorDefault; } @@ -174,7 +183,7 @@ protected virtual void UpdateValueLabel() if (index < 0) index = 0; - valueLabel.text = "< " + m_Field.enumNames[index].text + " >"; + valueLabel.text = m_Field.enumNames[index].text; } } } diff --git a/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerPanel.cs b/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerPanel.cs index ae58306..644f76a 100644 --- a/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerPanel.cs +++ b/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerPanel.cs @@ -13,6 +13,8 @@ public class DebugUIHandlerPanel : MonoBehaviour public ScrollRect scrollRect; /// Viewport of the panel. public RectTransform viewport; + /// Associated canvas. + public DebugUIHandlerCanvas Canvas; RectTransform m_ScrollTransform; RectTransform m_ContentTransform; @@ -30,7 +32,7 @@ void OnEnable() internal void SetPanel(DebugUI.Panel panel) { m_Panel = panel; - nameLabel.text = "< " + panel.displayName + " >"; + nameLabel.text = panel.displayName; } internal DebugUI.Panel GetPanel() @@ -38,6 +40,22 @@ internal DebugUI.Panel GetPanel() return m_Panel; } + /// + /// Select next panel on the canvas. + /// + public void SelectNextItem() + { + Canvas.SelectNextPanel(); + } + + /// + /// Select previous panel on the canvas. + /// + public void SelectPreviousItem() + { + Canvas.SelectPreviousPanel(); + } + // TODO: Jumps around with foldouts and the likes, fix me internal void ScrollTo(DebugUIHandlerWidget target) { diff --git a/Runtime/Debugging/Prefabs/Widgets/DebugUIEnumField.prefab b/Runtime/Debugging/Prefabs/Widgets/DebugUIEnumField.prefab index c49a783..6198f57 100644 --- a/Runtime/Debugging/Prefabs/Widgets/DebugUIEnumField.prefab +++ b/Runtime/Debugging/Prefabs/Widgets/DebugUIEnumField.prefab @@ -1,22 +1,12 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1311110376158742} - m_IsPrefabParent: 1 --- !u!1 &1311110376158742 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224224135738715566} - component: {fileID: 114506562444320092} @@ -27,12 +17,52 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &224224135738715566 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311110376158742} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224082802897306466} + - {fileID: 73524541048352296} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 26} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114506562444320092 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311110376158742} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0ca07cb82ca30874c849ad6a8be4ce42, type: 3} + m_Name: + m_EditorClassIdentifier: + colorDefault: {r: 0.8, g: 0.8, b: 0.8, a: 1} + colorSelected: {r: 0.25, g: 0.65, b: 0.8, a: 1} + nextButtonText: {fileID: 1122682645790643364} + previousButtonText: {fileID: 5991968131668804396} + nameLabel: {fileID: 114749518858187484} + valueLabel: {fileID: 114525189159037378} --- !u!1 &1318931732956078 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224082802897306466} - component: {fileID: 222666496576361700} @@ -44,12 +74,74 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &224082802897306466 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1318931732956078} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224224135738715566} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 300, y: 16} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &222666496576361700 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1318931732956078} + m_CullTransparentMesh: 0 +--- !u!114 &114749518858187484 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1318931732956078} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: wibble --- !u!1 &1489651458712568 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224794258446302326} - component: {fileID: 222110064721837410} @@ -61,30 +153,43 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &114506562444320092 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1311110376158742} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0ca07cb82ca30874c849ad6a8be4ce42, type: 3} - m_Name: - m_EditorClassIdentifier: - colorDefault: {r: 0.8, g: 0.8, b: 0.8, a: 1} - colorSelected: {r: 0.25, g: 0.65, b: 0.8, a: 1} - nameLabel: {fileID: 114749518858187484} - valueLabel: {fileID: 114525189159037378} +--- !u!224 &224794258446302326 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489651458712568} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 73524541048352296} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -80, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222110064721837410 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489651458712568} + m_CullTransparentMesh: 0 --- !u!114 &114525189159037378 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1489651458712568} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -102,27 +207,168 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 1 m_MaxSize: 40 - m_Alignment: 3 + m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 0 m_HorizontalOverflow: 1 - m_VerticalOverflow: 0 + m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: < 0 > ---- !u!114 &114749518858187484 + m_Text: Enum +--- !u!1 &5170338306183638078 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 73524541048352296} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &73524541048352296 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5170338306183638078} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1881800067243094030} + - {fileID: 224794258446302326} + - {fileID: 5949731805867224018} + m_Father: {fileID: 224224135738715566} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 310, y: 0} + m_SizeDelta: {x: -310, y: 0} + m_Pivot: {x: 0, y: 0.5} +--- !u!1 &5539936913609446775 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5949731805867224018} + - component: {fileID: 3410995964130187825} + - component: {fileID: 171064836484364327} + - component: {fileID: 1122682645790643364} + m_Layer: 5 + m_Name: Increment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5949731805867224018 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 73524541048352296} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &3410995964130187825 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} + m_CullTransparentMesh: 0 +--- !u!114 &171064836484364327 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1318931732956078} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1122682645790643364} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114506562444320092} + m_MethodName: OnIncrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1122682645790643364 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} - m_RaycastTarget: 0 + m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -138,75 +384,143 @@ MonoBehaviour: m_Alignment: 3 m_AlignByGeometry: 0 m_RichText: 0 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: New Text ---- !u!222 &222110064721837410 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1489651458712568} ---- !u!222 &222666496576361700 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1318931732956078} ---- !u!224 &224082802897306466 + m_Text: '>>>' +--- !u!1 &6187864743549253699 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1881800067243094030} + - component: {fileID: 5373617172578495976} + - component: {fileID: 7012455541135481670} + - component: {fileID: 5991968131668804396} + m_Layer: 5 + m_Name: Decrement + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1881800067243094030 RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1318931732956078} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 224224135738715566} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 1} ---- !u!224 &224224135738715566 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1311110376158742} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224082802897306466} - - {fileID: 224794258446302326} - m_Father: {fileID: 0} + m_Father: {fileID: 73524541048352296} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 26} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224794258446302326 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1489651458712568} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224224135738715566} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &5373617172578495976 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_CullTransparentMesh: 0 +--- !u!114 &7012455541135481670 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5991968131668804396} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114506562444320092} + m_MethodName: OnDecrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &5991968131668804396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: <<< diff --git a/Runtime/Debugging/Prefabs/Widgets/DebugUIFloatField.prefab b/Runtime/Debugging/Prefabs/Widgets/DebugUIFloatField.prefab index a3dc112..689b3f5 100644 --- a/Runtime/Debugging/Prefabs/Widgets/DebugUIFloatField.prefab +++ b/Runtime/Debugging/Prefabs/Widgets/DebugUIFloatField.prefab @@ -1,22 +1,12 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1100371661045084} - m_IsPrefabParent: 1 --- !u!1 &1100371661045084 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224720214277421396} - component: {fileID: 114688613186139690} @@ -27,12 +17,50 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &224720214277421396 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100371661045084} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224309343631572978} + - {fileID: 8099796348745405240} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 26} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114688613186139690 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100371661045084} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2c71addad67814c418e8376c7fabd008, type: 3} + m_Name: + m_EditorClassIdentifier: + colorDefault: {r: 0.8, g: 0.8, b: 0.8, a: 1} + colorSelected: {r: 0.25, g: 0.65, b: 0.8, a: 1} + nameLabel: {fileID: 114601347101323698} + valueLabel: {fileID: 114504040572925244} --- !u!1 &1207032646716234 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224309343631572978} - component: {fileID: 222840031335149136} @@ -44,12 +72,74 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &224309343631572978 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1207032646716234} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224720214277421396} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 300, y: 26} + m_Pivot: {x: 0, y: 1} +--- !u!222 &222840031335149136 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1207032646716234} + m_CullTransparentMesh: 0 +--- !u!114 &114601347101323698 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1207032646716234} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: New Text --- !u!1 &1644687155343164 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224518799942003328} - component: {fileID: 222991141768779948} @@ -61,15 +151,43 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &224518799942003328 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1644687155343164} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8099796348745405240} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -160, y: 26} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222991141768779948 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1644687155343164} + m_CullTransparentMesh: 0 --- !u!114 &114504040572925244 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1644687155343164} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -87,29 +205,132 @@ MonoBehaviour: m_BestFit: 0 m_MinSize: 1 m_MaxSize: 40 - m_Alignment: 3 + m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 0 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: '0 + m_Text: '0.000 ' ---- !u!114 &114601347101323698 +--- !u!1 &1438419846765199809 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3626783637040147037} + - component: {fileID: 4320092938451256021} + - component: {fileID: 1489089043139995282} + - component: {fileID: 4921204920640572091} + m_Layer: 5 + m_Name: '>' + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3626783637040147037 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1438419846765199809} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8099796348745405240} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -40, y: 0} + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &4320092938451256021 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1438419846765199809} + m_CullTransparentMesh: 0 +--- !u!114 &1489089043139995282 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1207032646716234} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1438419846765199809} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4921204920640572091} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114688613186139690} + m_MethodName: OnIncrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &4921204920640572091 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1438419846765199809} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} - m_RaycastTarget: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -120,95 +341,460 @@ MonoBehaviour: m_FontSize: 16 m_FontStyle: 0 m_BestFit: 0 - m_MinSize: 10 + m_MinSize: 1 m_MaxSize: 40 - m_Alignment: 3 + m_Alignment: 4 m_AlignByGeometry: 0 - m_RichText: 0 + m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: New Text ---- !u!114 &114688613186139690 + m_Text: '>' +--- !u!1 &3345241452090594779 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9132760328148347255} + - component: {fileID: 4707177476313546309} + - component: {fileID: 1511634106046967948} + - component: {fileID: 4198675178191085711} + m_Layer: 5 + m_Name: < + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9132760328148347255 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3345241452090594779} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8099796348745405240} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 40, y: 0} + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &4707177476313546309 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3345241452090594779} + m_CullTransparentMesh: 0 +--- !u!114 &1511634106046967948 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1100371661045084} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3345241452090594779} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2c71addad67814c418e8376c7fabd008, type: 3} + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} m_Name: m_EditorClassIdentifier: - colorDefault: {r: 0.8, g: 0.8, b: 0.8, a: 1} - colorSelected: {r: 0.25, g: 0.65, b: 0.8, a: 1} - nameLabel: {fileID: 114601347101323698} - valueLabel: {fileID: 114504040572925244} ---- !u!222 &222840031335149136 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1207032646716234} ---- !u!222 &222991141768779948 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1644687155343164} ---- !u!224 &224309343631572978 + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4198675178191085711} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114688613186139690} + m_MethodName: OnDecrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &4198675178191085711 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3345241452090594779} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: < +--- !u!1 &6702026499903230195 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8099796348745405240} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8099796348745405240 RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1207032646716234} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6702026499903230195} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 7055364939663876909} + - {fileID: 9132760328148347255} + - {fileID: 224518799942003328} + - {fileID: 3626783637040147037} + - {fileID: 4568531673544676555} m_Father: {fileID: 224720214277421396} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 1} ---- !u!224 &224518799942003328 + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 310, y: 0} + m_SizeDelta: {x: -310, y: 32} + m_Pivot: {x: 0, y: 0.5} +--- !u!1 &7324424786022721302 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7055364939663876909} + - component: {fileID: 6100676362118099584} + - component: {fileID: 9139505336765106438} + - component: {fileID: 6345405944498792300} + m_Layer: 5 + m_Name: <<< + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7055364939663876909 RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1644687155343164} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7324424786022721302} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 224720214277421396} - m_RootOrder: 1 + m_Father: {fileID: 8099796348745405240} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224720214277421396 + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &6100676362118099584 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7324424786022721302} + m_CullTransparentMesh: 0 +--- !u!114 &9139505336765106438 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7324424786022721302} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 6345405944498792300} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114688613186139690} + m_MethodName: OnDecrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &6345405944498792300 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7324424786022721302} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: <<< +--- !u!1 &9054865232088521833 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4568531673544676555} + - component: {fileID: 3306124332615888849} + - component: {fileID: 6254945107107145585} + - component: {fileID: 7981800216590041583} + m_Layer: 5 + m_Name: '>>>' + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4568531673544676555 RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1100371661045084} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9054865232088521833} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224309343631572978} - - {fileID: 224518799942003328} - m_Father: {fileID: 0} - m_RootOrder: 0 + m_Children: [] + m_Father: {fileID: 8099796348745405240} + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 26} - m_Pivot: {x: 0.5, y: 0.5} + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &3306124332615888849 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9054865232088521833} + m_CullTransparentMesh: 0 +--- !u!114 &6254945107107145585 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9054865232088521833} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 7981800216590041583} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114688613186139690} + m_MethodName: OnIncrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &7981800216590041583 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9054865232088521833} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: '>>>' diff --git a/Runtime/Debugging/Prefabs/Widgets/DebugUIPanel.prefab b/Runtime/Debugging/Prefabs/Widgets/DebugUIPanel.prefab index d8c38ed..507e4d1 100644 --- a/Runtime/Debugging/Prefabs/Widgets/DebugUIPanel.prefab +++ b/Runtime/Debugging/Prefabs/Widgets/DebugUIPanel.prefab @@ -1,22 +1,12 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1481385858290834} - m_IsPrefabParent: 1 --- !u!1 &1031930737030514 GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224222931961724930} m_Layer: 5 @@ -26,12 +16,33 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &224222931961724930 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1031930737030514} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224331172789687600} + m_Father: {fileID: 224230088708445616} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1157659775779164 GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224032405375473854} - component: {fileID: 222502714886812374} @@ -43,12 +54,70 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!224 &224032405375473854 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1157659775779164} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224917764046594536} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 275, y: -15} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222502714886812374 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1157659775779164} + m_CullTransparentMesh: 0 +--- !u!114 &114258963550902032 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1157659775779164} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.3, g: 0.3, b: 0.3, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 127279d577f25ac4ea17dae3782e5074, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &1193163269005052 GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 224563081888437474} - component: {fileID: 222723792781457702} @@ -61,194 +130,74 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!1 &1481385858290834 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224481716535368988} - - component: {fileID: 222334382701207864} - - component: {fileID: 114641895251469650} - - component: {fileID: 114200909511311822} - - component: {fileID: 114095782430481536} - - component: {fileID: 114358209095303848} - - component: {fileID: 114002074949699770} - m_Layer: 5 - m_Name: DebugUI Panel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1488004196661762 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224982697890735170} - - component: {fileID: 114062238365270692} - - component: {fileID: 114646799636776326} - m_Layer: 5 - m_Name: Content - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1566365363825024 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224331172789687600} - - component: {fileID: 222881498785153132} - - component: {fileID: 114674513437991784} - m_Layer: 5 - m_Name: Handle - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1599979385028726 -GameObject: +--- !u!224 &224563081888437474 +RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224734842163899044} - - component: {fileID: 222387563949684278} - - component: {fileID: 114807868571886560} - - component: {fileID: 114121917159994304} - m_Layer: 5 - m_Name: Header - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1722629955080566 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224230088708445616} - - component: {fileID: 222067053952777220} - - component: {fileID: 114584516951306838} - - component: {fileID: 114517050931817002} - m_Layer: 5 - m_Name: Scrollbar Vertical - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1865759466118732 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224917764046594536} - m_Layer: 5 - m_Name: Sliding Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1905254433598784 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224367139880787956} - - component: {fileID: 222968323484495154} - - component: {fileID: 114379239449222426} - - component: {fileID: 114990942331515556} - m_Layer: 5 - m_Name: Viewport - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1934506059440930 -GameObject: + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193163269005052} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224917764046594536} + m_Father: {fileID: 224093067269654272} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 5} + m_Pivot: {x: 0, y: 0} +--- !u!222 &222723792781457702 +CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224093067269654272} - - component: {fileID: 222390109283270248} - - component: {fileID: 114589248217440660} - - component: {fileID: 114259601227683192} - - component: {fileID: 114664006040389854} - m_Layer: 5 - m_Name: Scroll View - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &114002074949699770 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1481385858290834} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f61540bb3be4c2409cf6d2f51435714, type: 3} - m_Name: - m_EditorClassIdentifier: - nameLabel: {fileID: 114807868571886560} - scrollRect: {fileID: 114589248217440660} - viewport: {fileID: 224367139880787956} ---- !u!114 &114062238365270692 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193163269005052} + m_CullTransparentMesh: 0 +--- !u!114 &114607729654368332 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1488004196661762} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193163269005052} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: - m_Padding: - m_Left: 5 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 0 - m_Spacing: 1 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 0 - m_ChildControlWidth: 1 - m_ChildControlHeight: 0 + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 127279d577f25ac4ea17dae3782e5074, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!114 &114080217410698576 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1193163269005052} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -2061169968, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} m_Name: m_EditorClassIdentifier: m_Navigation: @@ -262,17 +211,20 @@ MonoBehaviour: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} m_DisabledSprite: {fileID: 0} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted m_DisabledTrigger: Disabled m_Interactable: 1 m_TargetGraphic: {fileID: 114258963550902032} @@ -286,73 +238,71 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null ---- !u!114 &114095782430481536 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1481385858290834} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalFit: 0 - m_VerticalFit: 0 ---- !u!114 &114121917159994304 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1599979385028726} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: -1 - m_PreferredWidth: -1 - m_PreferredHeight: -1 - m_FlexibleWidth: -1 - m_FlexibleHeight: -1 - m_LayoutPriority: 1 ---- !u!114 &114200909511311822 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} +--- !u!1 &1481385858290834 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224481716535368988} + - component: {fileID: 222334382701207864} + - component: {fileID: 114641895251469650} + - component: {fileID: 114200909511311822} + - component: {fileID: 114095782430481536} + - component: {fileID: 114358209095303848} + - component: {fileID: 114002074949699770} + m_Layer: 5 + m_Name: DebugUI Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224481716535368988 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1481385858290834} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 5 - m_Right: 5 - m_Top: 5 - m_Bottom: 5 - m_ChildAlignment: 0 - m_Spacing: 5 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 0 - m_ChildControlWidth: 1 - m_ChildControlHeight: 1 ---- !u!114 &114258963550902032 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224734842163899044} + - {fileID: 224093067269654272} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 5, y: 0} + m_SizeDelta: {x: 600, y: -10} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &222334382701207864 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1481385858290834} + m_CullTransparentMesh: 0 +--- !u!114 &114641895251469650 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1157659775779164} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1481385858290834} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.3, g: 0.3, b: 0.3, a: 1} + m_Color: {r: 0.1, g: 0.1, b: 0.1, a: 0.8509804} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -367,38 +317,53 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114259601227683192 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &114200909511311822 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1934506059440930} - m_Enabled: 0 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1481385858290834} + m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 0, b: 0, a: 0.392} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 127279d577f25ac4ea17dae3782e5074, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 + m_Padding: + m_Left: 5 + m_Right: 5 + m_Top: 5 + m_Bottom: 5 + m_ChildAlignment: 0 + m_Spacing: 5 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 +--- !u!114 &114095782430481536 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1481385858290834} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 0 --- !u!114 &114358209095303848 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1481385858290834} m_Enabled: 1 m_EditorHideFlags: 0 @@ -406,77 +371,157 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: contentHolder: {fileID: 224982697890735170} ---- !u!114 &114379239449222426 +--- !u!114 &114002074949699770 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1905254433598784} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1481385858290834} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f61540bb3be4c2409cf6d2f51435714, type: 3} m_Name: m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 ---- !u!114 &114517050931817002 + nameLabel: {fileID: 7398503340075695022} + scrollRect: {fileID: 114589248217440660} + viewport: {fileID: 224367139880787956} + Canvas: {fileID: 0} +--- !u!1 &1488004196661762 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224982697890735170} + - component: {fileID: 114062238365270692} + - component: {fileID: 114646799636776326} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224982697890735170 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1488004196661762} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224367139880787956} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &114062238365270692 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1722629955080566} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1488004196661762} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -2061169968, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} m_Name: m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 114674513437991784} - m_HandleRect: {fileID: 224331172789687600} - m_Direction: 2 - m_Value: 0 - m_Size: 1 - m_NumberOfSteps: 0 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &114584516951306838 + m_Padding: + m_Left: 5 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 1 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 +--- !u!114 &114646799636776326 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1722629955080566} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1488004196661762} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 1 +--- !u!1 &1566365363825024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224331172789687600} + - component: {fileID: 222881498785153132} + - component: {fileID: 114674513437991784} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224331172789687600 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566365363825024} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224222931961724930} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222881498785153132 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566365363825024} + m_CullTransparentMesh: 0 +--- !u!114 &114674513437991784 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566365363825024} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 1} + m_Color: {r: 0.3, g: 0.3, b: 0.3, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -491,46 +536,122 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114589248217440660 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1934506059440930} - m_Enabled: 1 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1599979385028726 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224734842163899044} + - component: {fileID: 114121917159994304} + m_Layer: 5 + m_Name: Header + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224734842163899044 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1599979385028726} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4203691516198245260} + m_Father: {fileID: 224481716535368988} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 62.44} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &114121917159994304 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1599979385028726} + m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1367256648, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} m_Name: m_EditorClassIdentifier: - m_Content: {fileID: 224982697890735170} - m_Horizontal: 0 - m_Vertical: 1 - m_MovementType: 2 - m_Elasticity: 0.1 - m_Inertia: 0 - m_DecelerationRate: 0.135 - m_ScrollSensitivity: 50 - m_Viewport: {fileID: 224367139880787956} - m_HorizontalScrollbar: {fileID: 114080217410698576} - m_VerticalScrollbar: {fileID: 114517050931817002} - m_HorizontalScrollbarVisibility: 0 - m_VerticalScrollbarVisibility: 2 - m_HorizontalScrollbarSpacing: -3 - m_VerticalScrollbarSpacing: 3 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &114607729654368332 + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!1 &1722629955080566 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224230088708445616} + - component: {fileID: 222067053952777220} + - component: {fileID: 114584516951306838} + - component: {fileID: 114517050931817002} + m_Layer: 5 + m_Name: Scrollbar Vertical + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224230088708445616 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722629955080566} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224222931961724930} + m_Father: {fileID: 224093067269654272} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 5, y: -2} + m_Pivot: {x: 1, y: 1} +--- !u!222 &222067053952777220 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722629955080566} + m_CullTransparentMesh: 0 +--- !u!114 &114584516951306838 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1193163269005052} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722629955080566} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -549,101 +670,504 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114641895251469650 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &114517050931817002 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1481385858290834} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722629955080566} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.1, g: 0.1, b: 0.1, a: 0.8509804} - m_RaycastTarget: 1 - m_OnCullStateChanged: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114674513437991784} + m_HandleRect: {fileID: 224331172789687600} + m_Direction: 2 + m_Value: 0 + m_Size: 1 + m_NumberOfSteps: 0 + m_OnValueChanged: m_PersistentCalls: m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 127279d577f25ac4ea17dae3782e5074, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114646799636776326 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1488004196661762} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalFit: 0 - m_VerticalFit: 1 ---- !u!114 &114664006040389854 + m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!1 &1865759466118732 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224917764046594536} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224917764046594536 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1865759466118732} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224032405375473854} + m_Father: {fileID: 224563081888437474} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 295, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1905254433598784 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224367139880787956} + - component: {fileID: 222968323484495154} + - component: {fileID: 114379239449222426} + - component: {fileID: 114990942331515556} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224367139880787956 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1905254433598784} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224982697890735170} + m_Father: {fileID: 224093067269654272} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!222 &222968323484495154 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1905254433598784} + m_CullTransparentMesh: 0 +--- !u!114 &114379239449222426 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1934506059440930} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1905254433598784} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} m_Name: m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: -1 - m_PreferredWidth: -1 - m_PreferredHeight: -1 - m_FlexibleWidth: 1 - m_FlexibleHeight: 1 - m_LayoutPriority: 1 ---- !u!114 &114674513437991784 + m_ShowMaskGraphic: 0 +--- !u!114 &114990942331515556 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1566365363825024} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1905254433598784} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.3, g: 0.3, b: 0.3, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 127279d577f25ac4ea17dae3782e5074, type: 3} - m_Type: 0 + m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114807868571886560 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1599979385028726} - m_Enabled: 1 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1934506059440930 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224093067269654272} + - component: {fileID: 222390109283270248} + - component: {fileID: 114589248217440660} + - component: {fileID: 114259601227683192} + - component: {fileID: 114664006040389854} + m_Layer: 5 + m_Name: Scroll View + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224093067269654272 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934506059440930} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224367139880787956} + - {fileID: 224563081888437474} + - {fileID: 224230088708445616} + m_Father: {fileID: 224481716535368988} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 419} + m_Pivot: {x: 0, y: 1} +--- !u!222 &222390109283270248 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934506059440930} + m_CullTransparentMesh: 0 +--- !u!114 &114589248217440660 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934506059440930} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 224982697890735170} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 0 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 50 + m_Viewport: {fileID: 224367139880787956} + m_HorizontalScrollbar: {fileID: 114080217410698576} + m_VerticalScrollbar: {fileID: 114517050931817002} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: -3 + m_VerticalScrollbarSpacing: 3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114259601227683192 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934506059440930} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 0, b: 0, a: 0.392} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 127279d577f25ac4ea17dae3782e5074, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &114664006040389854 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934506059440930} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: 1 + m_FlexibleHeight: 1 + m_LayoutPriority: 1 +--- !u!1 &753627827733015361 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4920158688531424978} + - component: {fileID: 8450988844828354142} + - component: {fileID: 4262237030954492287} + - component: {fileID: 1733729636161297954} + m_Layer: 5 + m_Name: Previous + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4920158688531424978 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 753627827733015361} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5914207944735420324} + m_Father: {fileID: 4203691516198245260} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: -20} + m_SizeDelta: {x: 48, y: 48} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &8450988844828354142 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 753627827733015361} + m_CullTransparentMesh: 0 +--- !u!114 &4262237030954492287 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 753627827733015361} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &1733729636161297954 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 753627827733015361} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4262237030954492287} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114002074949699770} + m_MethodName: SelectPreviousItem + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!1 &1053081290339971124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3372372580080396333} + - component: {fileID: 1284369024338128780} + - component: {fileID: 7398503340075695022} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3372372580080396333 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1053081290339971124} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4203691516198245260} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -32, y: -20} + m_SizeDelta: {x: -64, y: 48} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1284369024338128780 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1053081290339971124} + m_CullTransparentMesh: 0 +--- !u!114 &7398503340075695022 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1053081290339971124} + m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -656,38 +1180,87 @@ MonoBehaviour: Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} - m_FontSize: 16 + m_FontSize: 24 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 1 m_MaxSize: 101 - m_Alignment: 1 + m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 0 m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: < Panel Title > ---- !u!114 &114990942331515556 + m_Text: Panel Title +--- !u!1 &1227871200569909317 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4203691516198245260} + - component: {fileID: 3686877244737339833} + - component: {fileID: 8740321093878332076} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4203691516198245260 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227871200569909317} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4920158688531424978} + - {fileID: 3372372580080396333} + - {fileID: 6124518028496243542} + m_Father: {fileID: 224734842163899044} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &3686877244737339833 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227871200569909317} + m_CullTransparentMesh: 0 +--- !u!114 &8740321093878332076 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1905254433598784} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227871200569909317} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0, g: 0, b: 0, a: 0} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 0} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -695,259 +1268,296 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!222 &222067053952777220 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1463755480578966326 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5914207944735420324} + - component: {fileID: 8041110976474993763} + - component: {fileID: 1294088406270544217} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5914207944735420324 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1463755480578966326} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4920158688531424978} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8041110976474993763 CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1722629955080566} ---- !u!222 &222334382701207864 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1481385858290834} ---- !u!222 &222387563949684278 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1599979385028726} ---- !u!222 &222390109283270248 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1934506059440930} ---- !u!222 &222502714886812374 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1157659775779164} ---- !u!222 &222723792781457702 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1193163269005052} ---- !u!222 &222881498785153132 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1566365363825024} ---- !u!222 &222968323484495154 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1905254433598784} ---- !u!224 &224032405375473854 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1157659775779164} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224917764046594536} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 275, y: -15} - m_SizeDelta: {x: 20, y: 20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224093067269654272 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1934506059440930} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224367139880787956} - - {fileID: 224563081888437474} - - {fileID: 224230088708445616} - m_Father: {fileID: 224481716535368988} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 1} ---- !u!224 &224222931961724930 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1031930737030514} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224331172789687600} - m_Father: {fileID: 224230088708445616} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -20, y: -20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224230088708445616 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1463755480578966326} + m_CullTransparentMesh: 0 +--- !u!114 &1294088406270544217 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1463755480578966326} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.24586153, g: 0.6510919, b: 0.8018868, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 101 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: <<< +--- !u!1 &1745798049301762632 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6124518028496243542} + - component: {fileID: 7935060041695072585} + - component: {fileID: 5889315055296551309} + - component: {fileID: 1778922728521724237} + m_Layer: 5 + m_Name: Next + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6124518028496243542 RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1722629955080566} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745798049301762632} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224222931961724930} - m_Father: {fileID: 224093067269654272} + - {fileID: 640381901572764218} + m_Father: {fileID: 4203691516198245260} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 0} + m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 5, y: -2} - m_Pivot: {x: 1, y: 1} ---- !u!224 &224331172789687600 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1566365363825024} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224222931961724930} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224367139880787956 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1905254433598784} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224982697890735170} - m_Father: {fileID: 224093067269654272} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 1} ---- !u!224 &224481716535368988 + m_AnchoredPosition: {x: 0, y: -20} + m_SizeDelta: {x: 48, y: 48} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &7935060041695072585 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745798049301762632} + m_CullTransparentMesh: 0 +--- !u!114 &5889315055296551309 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745798049301762632} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &1778922728521724237 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1745798049301762632} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5889315055296551309} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114002074949699770} + m_MethodName: SelectNextItem + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!1 &7868778805547891576 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 640381901572764218} + - component: {fileID: 2464307334551946099} + - component: {fileID: 5590941507007540359} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &640381901572764218 RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1481385858290834} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7868778805547891576} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224734842163899044} - - {fileID: 224093067269654272} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 5, y: 0} - m_SizeDelta: {x: 600, y: -10} - m_Pivot: {x: 0, y: 0.5} ---- !u!224 &224563081888437474 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1193163269005052} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224917764046594536} - m_Father: {fileID: 224093067269654272} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 5} - m_Pivot: {x: 0, y: 0} ---- !u!224 &224734842163899044 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1599979385028726} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 224481716535368988} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224917764046594536 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1865759466118732} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224032405375473854} - m_Father: {fileID: 224563081888437474} + m_Father: {fileID: 6124518028496243542} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 295, y: 0} - m_SizeDelta: {x: -20, y: -20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224982697890735170 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1488004196661762} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224367139880787956} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2464307334551946099 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7868778805547891576} + m_CullTransparentMesh: 0 +--- !u!114 &5590941507007540359 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7868778805547891576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.24586153, g: 0.6510919, b: 0.8018868, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 101 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: '>>>' diff --git a/Runtime/Lighting/ProbeVolume/ProbeBrickIndex.cs b/Runtime/Lighting/ProbeVolume/ProbeBrickIndex.cs index 1aa3773..e87f1d7 100644 --- a/Runtime/Lighting/ProbeVolume/ProbeBrickIndex.cs +++ b/Runtime/Lighting/ProbeVolume/ProbeBrickIndex.cs @@ -1,4 +1,5 @@ //#define USE_INDEX_NATIVE_ARRAY +using System; using System.Collections; using System.Collections.Generic; using Unity.Collections; @@ -13,7 +14,6 @@ internal class ProbeBrickIndex { // a few constants internal const int kMaxSubdivisionLevels = 7; // 3 bits - private const int kAPVConstantsSize = 12 + 1 + 3 + 3 + 3 + 3; [System.Serializable] public struct Brick @@ -54,21 +54,26 @@ private struct BrickMeta private ComputeBuffer m_IndexBuffer; + private int[] m_IndexBufferData; private Vector3Int m_IndexDim; - private Vector3Int m_CenterRS; // the anchor in ref space, around which the index is defined - private Vector3Int m_CenterIS; // the position in index space that the anchor maps to + private Vector3Int m_CenterRS; // the anchor in ref space, around which the index is defined. [IMPORTANT NOTE! For now we always have it at 0, so is not passed to the shader, but is kept here until development is active in case we find it useful] + private Vector3Int m_CenterIS; // the position in index space that the anchor maps to [IMPORTANT NOTE! For now we always have it at indexDimensions / 2, so is not passed to the shader, but is kept here until development is active in case we find it useful] private HeightRange[] m_HeightRanges; #if !USE_NATIVE_ARRAY - private int[] m_TmpUpdater = new int[Mathf.Max(kAPVConstantsSize, ProbeReferenceVolume.CellSize(15) + 1)]; + private int[] m_TmpUpdater = new int[ProbeReferenceVolume.CellSize(15) + 1]; #endif private Dictionary> m_VoxelToBricks; private Dictionary m_BricksToVoxels; private int m_VoxelSubdivLevel = 3; + private bool m_NeedUpdateIndexComputeBuffer; + + internal Vector3Int GetIndexDimension() { return m_IndexDim; } + internal ProbeBrickIndex(Vector3Int indexDimensions) { Profiler.BeginSample("Create ProbeBrickIndex"); - int index_size = kAPVConstantsSize + indexDimensions.x * (indexDimensions.y + 1) * indexDimensions.z; + int index_size = indexDimensions.x * (indexDimensions.y + 1) * indexDimensions.z; m_CenterRS = new Vector3Int(0, 0, 0); m_IndexDim = indexDimensions; m_CenterIS = indexDimensions / 2; @@ -81,16 +86,41 @@ internal ProbeBrickIndex(Vector3Int indexDimensions) #else m_IndexBuffer = new ComputeBuffer(index_size, sizeof(int), ComputeBufferType.Structured); #endif + m_IndexBufferData = new int[index_size]; + m_NeedUpdateIndexComputeBuffer = false; m_HeightRanges = new HeightRange[indexDimensions.x * indexDimensions.z]; // Should be done by a compute shader Clear(); Profiler.EndSample(); } + void UpdateIndexData(int[] data, int dataStartIndex, int dstStartIndex, int count) + { + Debug.Assert(count <= data.Length); + Debug.Assert(m_IndexBufferData.Length >= dstStartIndex + count); + Array.Copy(data, dataStartIndex, m_IndexBufferData, dstStartIndex, count); + + // We made some modifications, we need to update the compute buffer before is used. + m_NeedUpdateIndexComputeBuffer = true; + } + + void GetIndexData(ref int[] dst, int dstStartIndex, int srcStartIndex, int count) + { + Debug.Assert(count <= dst.Length); + Debug.Assert(m_IndexBufferData.Length >= srcStartIndex + count); + Array.Copy(m_IndexBufferData, srcStartIndex, dst, dstStartIndex, count); + } + + internal void UploadIndexData() + { + m_IndexBuffer.SetData(m_IndexBufferData); + m_NeedUpdateIndexComputeBuffer = false; + } + internal void Clear() { Profiler.BeginSample("Clear Index"); - int index_size = kAPVConstantsSize + m_IndexDim.x * (m_IndexDim.y + 1) * m_IndexDim.z; + int index_size = m_IndexDim.x * (m_IndexDim.y + 1) * m_IndexDim.z; #if USE_INDEX_NATIVE_ARRAY NativeArray arr = m_IndexBuffer.BeginWrite(0, index_size); for (int i = 0; i < index_size; i++) @@ -101,7 +131,7 @@ internal void Clear() m_TmpUpdater[i] = -1; for (int i = 0; i < m_IndexBuffer.count; i += m_TmpUpdater.Length) - m_IndexBuffer.SetData(m_TmpUpdater, 0, i, Mathf.Min(m_TmpUpdater.Length, m_IndexBuffer.count - i)); + UpdateIndexData(m_TmpUpdater, 0, i, Mathf.Min(m_TmpUpdater.Length, m_IndexBuffer.count - i)); #endif HeightRange hr = new HeightRange() { min = -1, cnt = 0 }; @@ -252,7 +282,7 @@ private void ClearVoxel(Vector3Int pos) Vector3Int volMin, volMax; ClipToIndexSpace(pos, m_VoxelSubdivLevel, out volMin, out volMax); - int base_offset = kAPVConstantsSize + m_IndexDim.x * m_IndexDim.z; + int base_offset = m_IndexDim.x * m_IndexDim.z; int volCellSize = ProbeReferenceVolume.CellSize(m_VoxelSubdivLevel); int bsize_x = volMax.x - volMin.x; @@ -281,8 +311,9 @@ private void ClearVoxel(Vector3Int pos) if (hr.min == -1) continue; + int indexTrans = TranslateIndex(mx, 0, mz); - m_IndexBuffer.GetData(m_TmpUpdater, 0, base_offset + TranslateIndex(new Vector3Int(mx, 0, mz)), hr.cnt); + GetIndexData(ref m_TmpUpdater, 0, base_offset + indexTrans, hr.cnt); int start = volMin.y - hr.min; int end = Mathf.Min(start + volCellSize, m_IndexDim.y); start = Mathf.Max(start, 0); @@ -303,27 +334,27 @@ private void ClearVoxel(Vector3Int pos) { hr.min = -1; hr.cnt = 0; - m_IndexBuffer.SetData(m_TmpUpdater, 0, base_offset + TranslateIndex(new Vector3Int(mx, 0, mz)), m_IndexDim.y); + UpdateIndexData(m_TmpUpdater, 0, base_offset + indexTrans, m_IndexDim.y); } else { hr.min += hmin; hr.cnt = hmax - hmin; - m_IndexBuffer.SetData(m_TmpUpdater, hmin, base_offset + TranslateIndex(new Vector3Int(mx, 0, mz)), m_IndexDim.y - hmin); - m_IndexBuffer.SetData(m_TmpUpdater, 0, base_offset + TranslateIndex(new Vector3Int(mx, 0, mz)), hmin); + UpdateIndexData(m_TmpUpdater, hmin, base_offset + indexTrans, m_IndexDim.y - hmin); + UpdateIndexData(m_TmpUpdater, 0, base_offset + indexTrans, hmin); } // update the column offset m_HeightRanges[hoff_idx] = hr; m_TmpUpdater[m_TmpUpdater.Length - 1] = hr.min; - m_IndexBuffer.SetData(m_TmpUpdater, m_TmpUpdater.Length - 1, kAPVConstantsSize + hoff_idx, 1); + UpdateIndexData(m_TmpUpdater, m_TmpUpdater.Length - 1, hoff_idx, 1); } } } private void UpdateIndex(Vector3Int voxel, List bricks, List indices) { - int base_offset = kAPVConstantsSize + m_IndexDim.x * m_IndexDim.z; + int base_offset = m_IndexDim.x * m_IndexDim.z; // clip voxel to index space Vector3Int vx_min, vx_max; @@ -369,7 +400,7 @@ private void UpdateIndex(Vector3Int voxel, List bricks, List bricks, List bricks, List dst = m_IndexBuffer.BeginWrite(0, kAPVConstantsSize); -#else - int[] dst = m_TmpUpdater; -#endif - Matrix4x4 WStoRS = Matrix4x4.Inverse(refTrans.refSpaceToWS); - - dst[0] = Asint(WStoRS[0, 0]); - dst[1] = Asint(WStoRS[1, 0]); - dst[2] = Asint(WStoRS[2, 0]); - dst[3] = Asint(WStoRS[0, 1]); - dst[4] = Asint(WStoRS[1, 1]); - dst[5] = Asint(WStoRS[2, 1]); - dst[6] = Asint(WStoRS[0, 2]); - dst[7] = Asint(WStoRS[1, 2]); - dst[8] = Asint(WStoRS[2, 2]); - dst[9] = Asint(WStoRS[0, 3]); - dst[10] = Asint(WStoRS[1, 3]); - dst[11] = Asint(WStoRS[2, 3]); - dst[12] = Asint(normalBias); - dst[13] = m_CenterRS.x; - dst[14] = m_CenterRS.y; - dst[15] = m_CenterRS.z; - dst[16] = m_CenterIS.x; - dst[17] = m_CenterIS.y; - dst[18] = m_CenterIS.z; - dst[19] = m_IndexDim.x; - dst[20] = m_IndexDim.y; - dst[21] = m_IndexDim.z; - dst[22] = poolDim.x; - dst[23] = poolDim.y; - dst[24] = poolDim.z; - -#if USE_INDEX_NATIVE_ARRAY - m_IndexBuffer.EndWrite(kAPVConstantsSize); -#else - m_IndexBuffer.SetData(dst, 0, 0, kAPVConstantsSize); -#endif + // If we are pending an update of the actual compute buffer we do it here + if (m_NeedUpdateIndexComputeBuffer) + { + UploadIndexData(); + } + rr.index = m_IndexBuffer; } - internal void GetRuntimeResources(ref ProbeReferenceVolume.RuntimeResources rr) { rr.index = m_IndexBuffer; } - internal void Cleanup() { CoreUtils.SafeRelease(m_IndexBuffer); diff --git a/Runtime/Lighting/ProbeVolume/ProbeBrickPool.cs b/Runtime/Lighting/ProbeVolume/ProbeBrickPool.cs index f516e35..e96a3f5 100644 --- a/Runtime/Lighting/ProbeVolume/ProbeBrickPool.cs +++ b/Runtime/Lighting/ProbeVolume/ProbeBrickPool.cs @@ -186,7 +186,7 @@ internal void Update(DataLocation source, List srcLocations, Li } } - public static DataLocation CreateDataLocation(int numProbes, bool compressed, ProbeVolumeSHBands bands) + private static Vector3Int ProbeCountToDataLocSize(int numProbes) { Debug.Assert(numProbes != 0); Debug.Assert(numProbes % kBrickProbeCountTotal == 0); @@ -207,9 +207,19 @@ public static DataLocation CreateDataLocation(int numProbes, bool compressed, Pr width = numBricks; } - width *= kBrickProbeCountPerDim; + width *= kBrickProbeCountPerDim; height *= kBrickProbeCountPerDim; - depth *= kBrickProbeCountPerDim; + depth *= kBrickProbeCountPerDim; + + return new Vector3Int(width, height, depth); + } + + public static DataLocation CreateDataLocation(int numProbes, bool compressed, ProbeVolumeSHBands bands) + { + Vector3Int locSize = ProbeCountToDataLocSize(numProbes); + int width = locSize.x; + int height = locSize.y; + int depth = locSize.z; DataLocation loc; @@ -240,12 +250,37 @@ public static DataLocation CreateDataLocation(int numProbes, bool compressed, Pr return loc; } + private static void SetPixel(ref Color[] data, int x, int y, int z, int dataLocWidth, int dataLocHeight, Color value) + { + int index = x + dataLocWidth * (y + dataLocHeight * z); + data[index] = value; + } + public static void FillDataLocation(ref DataLocation loc, SphericalHarmonicsL2[] shl2, ProbeVolumeSHBands bands) { int numBricks = shl2.Length / kBrickProbeCountTotal; int shidx = 0; int bx = 0, by = 0, bz = 0; Color c = new Color(); + + Color[] L0L1Rx_locData = new Color[loc.width * loc.height * loc.depth * 2]; + Color[] L1GL1Ry_locData = new Color[loc.width * loc.height * loc.depth * 2]; + Color[] L1BL1Rz_locData = new Color[loc.width * loc.height * loc.depth * 2]; + + Color[] L2_0_locData = null; + Color[] L2_1_locData = null; + Color[] L2_2_locData = null; + Color[] L2_3_locData = null; + + + if (bands == ProbeVolumeSHBands.SphericalHarmonicsL2) + { + L2_0_locData = new Color[loc.width * loc.height * loc.depth]; + L2_1_locData = new Color[loc.width * loc.height * loc.depth]; + L2_2_locData = new Color[loc.width * loc.height * loc.depth]; + L2_3_locData = new Color[loc.width * loc.height * loc.depth]; + } + for (int brickIdx = 0; brickIdx < shl2.Length; brickIdx += kBrickProbeCountTotal) { for (int z = 0; z < kBrickProbeCountPerDim; z++) @@ -258,50 +293,49 @@ public static void FillDataLocation(ref DataLocation loc, SphericalHarmonicsL2[] int iy = by + y; int iz = bz + z; - Vector3 L0 = SphericalHarmonicsL2Utils.GetCoefficient(shl2[shidx], 0); - Vector3 L1R, L1G, L1B; - SphericalHarmonicsL2Utils.GetL1(shl2[shidx], out L1R, out L1G, out L1B); + c.r = shl2[shidx][0, 0]; // L0.r + c.g = shl2[shidx][1, 0]; // L0.g + c.b = shl2[shidx][2, 0]; // L0.b + c.a = shl2[shidx][0, 1]; // L1_R.r + SetPixel(ref L0L1Rx_locData, ix, iy, iz, loc.width, loc.height, c); - // First texture will have L0 coefficients in RGB, and L1R.x in the alpha channel - Color L0_L1Rx = new Color(L0.x, L0.y, L0.z, L1R.x); - // Second texture will have L1_G coefficients in RGB and L1R.y in the alpha channel - Color L1G_L1Ry = new Color(L1G.x, L1G.y, L1G.z, L1R.y); - // Third texture will have L1_B coefficients in RGB and L1R.z in the alpha channel - Color L1B_L1Rz = new Color(L1B.x, L1B.y, L1B.z, L1R.z); + c.r = shl2[shidx][1, 1]; // L1_G.r + c.g = shl2[shidx][1, 2]; // L1_G.g + c.b = shl2[shidx][1, 3]; // L1_G.b + c.a = shl2[shidx][0, 2]; // L1_R.g + SetPixel(ref L1GL1Ry_locData, ix, iy, iz, loc.width, loc.height, c); - loc.TexL0_L1rx.SetPixel(ix, iy, iz, L0_L1Rx); - loc.TexL1_G_ry.SetPixel(ix, iy, iz, L1G_L1Ry); - loc.TexL1_B_rz.SetPixel(ix, iy, iz, L1B_L1Rz); + c.r = shl2[shidx][2, 1]; // L1_B.r + c.g = shl2[shidx][2, 2]; // L1_B.g + c.b = shl2[shidx][2, 3]; // L1_B.b + c.a = shl2[shidx][0, 3]; // L1_R.b + SetPixel(ref L1BL1Rz_locData, ix, iy, iz, loc.width, loc.height, c); if (bands == ProbeVolumeSHBands.SphericalHarmonicsL2) { - Vector3 L2_0, L2_1, L2_2, L2_3, L2_4; - SphericalHarmonicsL2Utils.GetL2(shl2[shidx], out L2_0, out L2_1, out L2_2, out L2_3, out L2_4); - - c.r = L2_0.x; - c.g = L2_1.x; - c.b = L2_2.x; - c.a = L2_3.x; - loc.TexL2_0.SetPixel(ix, iy, iz, c); - - c.r = L2_0.y; - c.g = L2_1.y; - c.b = L2_2.y; - c.a = L2_3.y; - loc.TexL2_1.SetPixel(ix, iy, iz, c); - - - c.r = L2_0.z; - c.g = L2_1.z; - c.b = L2_2.z; - c.a = L2_3.z; - loc.TexL2_2.SetPixel(ix, iy, iz, c); - - c.r = L2_4.x; - c.g = L2_4.y; - c.b = L2_4.z; + c.r = shl2[shidx][0, 4]; + c.g = shl2[shidx][0, 5]; + c.b = shl2[shidx][0, 6]; + c.a = shl2[shidx][0, 7]; + SetPixel(ref L2_0_locData, ix, iy, iz, loc.width, loc.height, c); + + c.r = shl2[shidx][1, 4]; + c.g = shl2[shidx][1, 5]; + c.b = shl2[shidx][1, 6]; + c.a = shl2[shidx][1, 7]; + SetPixel(ref L2_1_locData, ix, iy, iz, loc.width, loc.height, c); + + c.r = shl2[shidx][2, 4]; + c.g = shl2[shidx][2, 5]; + c.b = shl2[shidx][2, 6]; + c.a = shl2[shidx][2, 7]; + SetPixel(ref L2_2_locData, ix, iy, iz, loc.width, loc.height, c); + + c.r = shl2[shidx][0, 8]; + c.g = shl2[shidx][1, 8]; + c.b = shl2[shidx][2, 8]; c.a = 1; - loc.TexL2_3.SetPixel(ix, iy, iz, c); + SetPixel(ref L2_3_locData, ix, iy, iz, loc.width, loc.height, c); } shidx++; @@ -323,16 +357,22 @@ public static void FillDataLocation(ref DataLocation loc, SphericalHarmonicsL2[] } } + loc.TexL0_L1rx.SetPixels(L0L1Rx_locData); loc.TexL0_L1rx.Apply(false); - + loc.TexL1_G_ry.SetPixels(L1GL1Ry_locData); loc.TexL1_G_ry.Apply(false); + loc.TexL1_B_rz.SetPixels(L1BL1Rz_locData); loc.TexL1_B_rz.Apply(false); if (bands == ProbeVolumeSHBands.SphericalHarmonicsL2) { + loc.TexL2_0.SetPixels(L2_0_locData); loc.TexL2_0.Apply(false); + loc.TexL2_1.SetPixels(L2_1_locData); loc.TexL2_1.Apply(false); + loc.TexL2_2.SetPixels(L2_2_locData); loc.TexL2_2.Apply(false); + loc.TexL2_3.SetPixels(L2_3_locData); loc.TexL2_3.Apply(false); } } diff --git a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs new file mode 100644 index 0000000..c55daa3 --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs @@ -0,0 +1,240 @@ +using System.Collections.Generic; +using UnityEngine.Rendering; + +namespace UnityEngine.Experimental.Rendering +{ + [GenerateHLSL] + public enum DebugProbeShadingMode + { + SH, + Validity, + Size + } + + class ProbeVolumeDebug + { + public bool drawProbes; + public bool drawBricks; + public bool drawCells; + public DebugProbeShadingMode probeShading; + public float probeSize = 1.0f; + public float cullingDistance = 500; + public float exposureCompensation; + } + + public partial class ProbeReferenceVolume + { + class CellInstancedDebugProbes + { + public List probeBuffers; + public List props; + public Hash128 cellHash; + public Vector3 cellPosition; + } + + const int kProbesPerBatch = 1023; + + internal ProbeVolumeDebug debugDisplay { get; } = new ProbeVolumeDebug(); + + DebugUI.Widget[] m_DebugItems; + Mesh m_DebugMesh; + Material m_DebugMaterial; + List m_CellDebugData = new List(); + Plane[] m_DebugFrustumPlanes = new Plane[6]; + + /// + /// Render Probe Volume related debug + /// + public void RenderDebug(Camera camera) + { + if (camera.cameraType != CameraType.Reflection && camera.cameraType != CameraType.Preview) + { + if (debugDisplay.drawProbes) + { + DrawProbeDebug(camera); + } + } + } + + void InitializeDebug(Mesh debugProbeMesh, Shader debugProbeShader) + { + m_DebugMesh = debugProbeMesh; + m_DebugMaterial = CoreUtils.CreateEngineMaterial(debugProbeShader); + m_DebugMaterial.enableInstancing = true; + + RegisterDebug(); + } + + void CleanupDebug() + { + UnregisterDebug(true); + CoreUtils.Destroy(m_DebugMaterial); + } + + void RefreshDebug(DebugUI.Field field, T value) + { + UnregisterDebug(false); + RegisterDebug(); + } + + void RegisterDebug() + { + var widgetList = new List(); + widgetList.Add(new DebugUI.BoolField { displayName = "Display Cells", getter = () => debugDisplay.drawCells, setter = value => debugDisplay.drawCells = value }); + widgetList.Add(new DebugUI.BoolField { displayName = "Display Bricks", getter = () => debugDisplay.drawBricks, setter = value => debugDisplay.drawBricks = value }); + widgetList.Add(new DebugUI.BoolField { displayName = "Display Probes", getter = () => debugDisplay.drawProbes, setter = value => debugDisplay.drawProbes = value, onValueChanged = RefreshDebug }); + if (debugDisplay.drawProbes) + { + var probeContainer = new DebugUI.Container(); + + probeContainer.children.Add(new DebugUI.EnumField + { + displayName = "Probe Shading Mode", + getter = () => (int)debugDisplay.probeShading, + setter = value => debugDisplay.probeShading = (DebugProbeShadingMode)value, + autoEnum = typeof(DebugProbeShadingMode), + getIndex = () => (int)debugDisplay.probeShading, + setIndex = value => debugDisplay.probeShading = (DebugProbeShadingMode)value, + onValueChanged = RefreshDebug + }); + probeContainer.children.Add(new DebugUI.FloatField { displayName = "Probe Size", getter = () => debugDisplay.probeSize, setter = value => debugDisplay.probeSize = value, min = () => 0.1f, max = () => 10.0f }); + if (debugDisplay.probeShading == DebugProbeShadingMode.SH) + probeContainer.children.Add(new DebugUI.FloatField { displayName = "Probe Exposure Compensation", getter = () => debugDisplay.exposureCompensation, setter = value => debugDisplay.exposureCompensation = value }); + + widgetList.Add(probeContainer); + } + widgetList.Add(new DebugUI.FloatField { displayName = "Culling Distance", getter = () => debugDisplay.cullingDistance, setter = value => debugDisplay.cullingDistance = value, min = () => 0.0f }); + + m_DebugItems = widgetList.ToArray(); + var panel = DebugManager.instance.GetPanel("Probe Volume", true); + panel.children.Add(m_DebugItems); + } + + void UnregisterDebug(bool destroyPanel) + { + if (destroyPanel) + DebugManager.instance.RemovePanel("Probe Volume"); + else + DebugManager.instance.GetPanel("Probe Volume", false).children.Remove(m_DebugItems); + } + + bool ShouldCull(Vector3 cellPosition, Vector3 cameraPosition, Plane[] frustumPlanes) + { + var cellSize = MaxBrickSize(); + var originWS = GetTransform().posWS; + Vector3 cellCenterWS = cellPosition * cellSize + originWS + Vector3.one * (cellSize / 2.0f); + + if (Vector3.Distance(cameraPosition, cellCenterWS) > debugDisplay.cullingDistance) + return true; + + var volumeAABB = new Bounds(cellCenterWS, cellSize * Vector3.one); + + return !GeometryUtility.TestPlanesAABB(frustumPlanes, volumeAABB); + } + + void DrawProbeDebug(Camera camera) + { + if (debugDisplay.drawProbes) + { + // TODO: Update data on ref vol changes + if (m_CellDebugData.Count == 0) + CreateInstancedProbes(); + + GeometryUtility.CalculateFrustumPlanes(camera, m_DebugFrustumPlanes); + + foreach (var debug in m_CellDebugData) + { + if (ShouldCull(debug.cellPosition, camera.transform.position, m_DebugFrustumPlanes)) + continue; + + for (int i = 0; i < debug.probeBuffers.Count; ++i) + { + var probeBuffer = debug.probeBuffers[i]; + var props = debug.props[i]; + props.SetInt("_ShadingMode", (int)debugDisplay.probeShading); + props.SetFloat("_ExposureCompensation", -debugDisplay.exposureCompensation); + props.SetFloat("_ProbeSize", debugDisplay.probeSize); + + Graphics.DrawMeshInstanced(m_DebugMesh, 0, m_DebugMaterial, probeBuffer, probeBuffer.Length, props, ShadowCastingMode.Off, false, 0, camera, LightProbeUsage.Off, null); + } + } + } + } + + void ClearDebugData() + { + m_CellDebugData.Clear(); + } + + void CreateInstancedProbes() + { + foreach (var cell in ProbeReferenceVolume.instance.cells.Values) + { + if (cell.sh == null || cell.sh.Length == 0) + continue; + + float largestBrickSize = cell.bricks.Count == 0 ? 0 : cell.bricks[0].subdivisionLevel; + + List probeBuffers = new List(); + List props = new List(); + List probeMaps = new List(); + + // Batch probes for instanced rendering + for (int brickSize = 0; brickSize < largestBrickSize + 1; brickSize++) + { + List probeBuffer = new List(); + List probeMap = new List(); + + for (int i = 0; i < cell.probePositions.Length; i++) + { + // Skip probes which aren't of current brick size + if (cell.bricks[i / 64].subdivisionLevel == brickSize) + { + probeBuffer.Add(Matrix4x4.TRS(cell.probePositions[i], Quaternion.identity, Vector3.one * (0.3f * (brickSize + 1)))); + probeMap.Add(i); + } + + // Batch limit reached or out of probes + if (probeBuffer.Count >= kProbesPerBatch || i == cell.probePositions.Length - 1) + { + MaterialPropertyBlock prop = new MaterialPropertyBlock(); + float gradient = largestBrickSize == 0 ? 1 : brickSize / largestBrickSize; + prop.SetColor("_Color", Color.Lerp(Color.red, Color.green, gradient)); + props.Add(prop); + + probeBuffers.Add(probeBuffer.ToArray()); + probeBuffer = new List(); + probeMaps.Add(probeMap.ToArray()); + probeMap = new List(); + } + } + } + + var debugData = new CellInstancedDebugProbes(); + debugData.probeBuffers = probeBuffers; + debugData.props = props; + debugData.cellPosition = cell.position; + + Vector4[] positionBuffer = new Vector4[kProbesPerBatch]; + Vector4[] validityColors = new Vector4[kProbesPerBatch]; + + for (int batchIndex = 0; batchIndex < probeMaps.Count; batchIndex++) + { + for (int indexInBatch = 0; indexInBatch < probeMaps[batchIndex].Length; indexInBatch++) + { + int probeIdx = probeMaps[batchIndex][indexInBatch]; + + var pos = cell.probePositions[probeIdx]; + positionBuffer[indexInBatch] = new Vector4(pos.x, pos.y, pos.z, 0.0f); + validityColors[indexInBatch] = Color.Lerp(Color.green, Color.red, cell.validity[probeIdx]); + } + + debugData.props[batchIndex].SetVectorArray("_Position", positionBuffer); + debugData.props[batchIndex].SetVectorArray("_Validity", validityColors); + } + + m_CellDebugData.Add(debugData); + } + } + } +} diff --git a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl new file mode 100644 index 0000000..8b2161d --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl @@ -0,0 +1,15 @@ +// +// This file was automatically generated. Please don't edit by hand. Execute Editor command [ Edit > Rendering > Generate Shader Includes ] instead +// + +#ifndef PROBEREFERENCEVOLUME_DEBUG_CS_HLSL +#define PROBEREFERENCEVOLUME_DEBUG_CS_HLSL +// +// UnityEngine.Rendering.DebugProbeShadingMode: static fields +// +#define DEBUGPROBESHADINGMODE_SH (0) +#define DEBUGPROBESHADINGMODE_VALIDITY (1) +#define DEBUGPROBESHADINGMODE_SIZE (2) + + +#endif diff --git a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl.meta b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl.meta new file mode 100644 index 0000000..456641b --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f6e06ceb4cc6a38458f4b614e8000dc8 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.meta b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.meta new file mode 100644 index 0000000..3977f01 --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.Debug.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f2e5e8e23a1880449ebe8c1baaa136f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs index bf98819..146ee90 100644 --- a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs +++ b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs @@ -8,6 +8,16 @@ namespace UnityEngine.Experimental.Rendering { + /// + /// Initialization parameters for the probe volume system. + /// + public struct ProbeVolumeSystemParameters + { + public ProbeVolumeTextureMemoryBudget memoryBudget; + public Mesh probeDebugMesh; + public Shader probeDebugShader; + } + /// /// Possible values for the probe volume memory budget (determines the size of the textures used). /// @@ -37,12 +47,9 @@ public enum ProbeVolumeSHBands /// /// The reference volume for the Probe Volume system. This defines the structure in which volume assets are loaded into. There must be only one, hence why it follow a singleton pattern. /// - public class ProbeReferenceVolume + public partial class ProbeReferenceVolume { - /// - /// The size of each chunk of allocation in the data pool. - /// - public static int s_ProbeIndexPoolAllocationSize = 128; + const int kProbeIndexPoolAllocationSize = 128; [System.Serializable] internal struct Cell @@ -221,39 +228,38 @@ public override bool Equals(object obj) public override int GetHashCode() => id; } - private int m_ID = 0; - private RefVolTransform m_Transform; - private float m_NormalBias; - private int m_MaxSubdivision; - private ProbeBrickPool m_Pool; - private ProbeBrickIndex m_Index; - private List[] m_TmpBricks = new List[2]; - private List m_TmpFlags = new List(); - private List m_TmpSrcChunks = new List(); - private List m_TmpDstChunks = new List(); - private float[] m_PositionOffsets = new float[ProbeBrickPool.kBrickProbeCountPerDim]; - private Dictionary> m_Registry = new Dictionary>(); + bool m_IsInitialized = false; + int m_ID = 0; + RefVolTransform m_Transform; + int m_MaxSubdivision; + ProbeBrickPool m_Pool; + ProbeBrickIndex m_Index; + List[] m_TmpBricks = new List[2]; + List m_TmpFlags = new List(); + List m_TmpSrcChunks = new List(); + List m_TmpDstChunks = new List(); + float[] m_PositionOffsets = new float[ProbeBrickPool.kBrickProbeCountPerDim]; + Dictionary> m_Registry = new Dictionary>(); internal Dictionary cells = new Dictionary(); - private Dictionary> m_AssetPathToBricks = new Dictionary>(); - - private bool m_BricksLoaded = false; + bool m_BricksLoaded = false; + Dictionary> m_AssetPathToBricks = new Dictionary>(); // Information of the probe volume asset that is being loaded (if one is pending) - private Dictionary m_PendingAssetsToBeLoaded = new Dictionary(); + Dictionary m_PendingAssetsToBeLoaded = new Dictionary(); // Information on probes we need to remove. - private Dictionary m_PendingAssetsToBeUnloaded = new Dictionary(); + Dictionary m_PendingAssetsToBeUnloaded = new Dictionary(); // Information of the probe volume asset that is being loaded (if one is pending) - private Dictionary m_ActiveAssets = new Dictionary(); + Dictionary m_ActiveAssets = new Dictionary(); - private bool m_NeedLoadAsset = false; - private bool m_ProbeReferenceVolumeInit = false; + bool m_NeedLoadAsset = false; + bool m_ProbeReferenceVolumeInit = false; // Similarly the index dimensions come from the authoring component; if a change happens // a pending request for re-init (and what it implies) is added from the editor. - private Vector3Int m_PendingIndexDimChange; - private bool m_NeedsIndexDimChange = false; + Vector3Int m_PendingIndexDimChange; + bool m_NeedsIndexDimChange = false; - internal float normalBiasFromProfile; + private int m_CBShaderID = Shader.PropertyToID("ShaderVariablesProbeVolumes"); ProbeVolumeTextureMemoryBudget m_MemoryBudget; @@ -262,7 +268,7 @@ public override bool Equals(object obj) /// public ProbeVolumeTextureMemoryBudget memoryBudget => m_MemoryBudget; - static private ProbeReferenceVolume _instance = new ProbeReferenceVolume(); + static ProbeReferenceVolume _instance = new ProbeReferenceVolume(); /// /// Get the instance of the probe reference volume (singleton). @@ -276,17 +282,37 @@ public static ProbeReferenceVolume instance } /// - /// Set the memory budget for the Probe Volume System. + /// Initialize the Probe Volume system /// - /// - public void SetMemoryBudget(ProbeVolumeTextureMemoryBudget budget) + /// Initialization parameters. + public void Initialize(in ProbeVolumeSystemParameters parameters) { - if (m_MemoryBudget != budget) + if (m_IsInitialized) { - m_MemoryBudget = budget; - Cleanup(); - InitProbeReferenceVolume(s_ProbeIndexPoolAllocationSize, m_MemoryBudget, m_PendingIndexDimChange); + Debug.LogError("Probe Volume System has already been initialized."); + return; } + + m_MemoryBudget = parameters.memoryBudget; + InitializeDebug(parameters.probeDebugMesh, parameters.probeDebugShader); + InitProbeReferenceVolume(kProbeIndexPoolAllocationSize, m_MemoryBudget, m_PendingIndexDimChange); + m_IsInitialized = true; + } + + /// + /// Cleanup the Probe Volume system. + /// + public void Cleanup() + { + if (!m_IsInitialized) + { + Debug.LogError("Probe Volume System has not been initialized first before calling cleanup."); + return; + } + + CleanupLoadedData(); + CleanupDebug(); + m_IsInitialized = false; } internal void AddPendingAssetLoading(ProbeVolumeAsset asset) @@ -347,27 +373,17 @@ internal void RemovePendingAsset(ProbeVolumeAsset asset) } } - private void PerformPendingIndexDimensionChangeAndInit() + void PerformPendingIndexDimensionChangeAndInit() { if (m_NeedsIndexDimChange) { - Cleanup(); - InitProbeReferenceVolume(s_ProbeIndexPoolAllocationSize, m_MemoryBudget, m_PendingIndexDimChange); + CleanupLoadedData(); + InitProbeReferenceVolume(kProbeIndexPoolAllocationSize, m_MemoryBudget, m_PendingIndexDimChange); m_NeedsIndexDimChange = false; } } - private void PerformPendingNormalBiasChange() - { - if (m_NormalBias != normalBiasFromProfile) - { - m_NormalBias = normalBiasFromProfile; - if (m_Index != null) - m_Index.WriteConstants(ref m_Transform, m_Pool.GetPoolDimensions(), m_NormalBias); - } - } - - private void LoadAsset(ProbeVolumeAsset asset) + void LoadAsset(ProbeVolumeAsset asset) { var path = asset.GetSerializedFullPath(); m_AssetPathToBricks[path] = new List(); @@ -391,7 +407,7 @@ private void LoadAsset(ProbeVolumeAsset asset) } } - private void PerformPendingLoading() + void PerformPendingLoading() { if ((m_PendingAssetsToBeLoaded.Count == 0 && m_ActiveAssets.Count == 0) || !m_NeedLoadAsset || !m_ProbeReferenceVolumeInit) return; @@ -419,7 +435,7 @@ private void PerformPendingLoading() m_PendingAssetsToBeLoaded.Clear(); } - private void PerformPendingDeletion() + void PerformPendingDeletion() { if (!m_ProbeReferenceVolumeInit) { @@ -441,7 +457,6 @@ private void PerformPendingDeletion() public void PerformPendingOperations() { PerformPendingDeletion(); - PerformPendingNormalBiasChange(); PerformPendingIndexDimensionChangeAndInit(); PerformPendingLoading(); } @@ -452,12 +467,17 @@ public void PerformPendingOperations() /// Size used for the chunk allocator that handles bricks. /// Probe reference volume memory budget. /// Dimensions of the index data structure. - public void InitProbeReferenceVolume(int allocationSize, ProbeVolumeTextureMemoryBudget memoryBudget, Vector3Int indexDimensions) + void InitProbeReferenceVolume(int allocationSize, ProbeVolumeTextureMemoryBudget memoryBudget, Vector3Int indexDimensions) { if (!m_ProbeReferenceVolumeInit) { Profiler.BeginSample("Initialize Reference Volume"); m_Pool = new ProbeBrickPool(allocationSize, memoryBudget); + if ((indexDimensions.x * (indexDimensions.y + 1) * indexDimensions.z) == 0) + { + // Give a momentarily dummy size to allow the system to function with no asset assigned. + indexDimensions = new Vector3Int(1, 1, 1); + } m_Index = new ProbeBrickIndex(indexDimensions); m_TmpBricks[0] = new List(); @@ -474,22 +494,17 @@ public void InitProbeReferenceVolume(int allocationSize, ProbeVolumeTextureMemor m_ProbeReferenceVolumeInit = true; - // Write constants on init to start with right data. - m_Index.WriteConstants(ref m_Transform, m_Pool.GetPoolDimensions(), m_NormalBias); - // Set the normalBiasFromProfile to avoid re-update of the constants up until the next change in profile editor - normalBiasFromProfile = m_NormalBias; + ClearDebugData(); } m_NeedLoadAsset = true; } - private ProbeReferenceVolume() + ProbeReferenceVolume() { m_Transform.posWS = Vector3.zero; m_Transform.rot = Quaternion.identity; m_Transform.scale = 1f; m_Transform.refSpaceToWS = Matrix4x4.identity; - - m_NormalBias = 0f; } /// @@ -516,8 +531,6 @@ internal void SetTRS(Vector3 position, Quaternion rotation, float minBrickSize) } internal void SetMaxSubdivision(int maxSubdivision) { m_MaxSubdivision = System.Math.Min(maxSubdivision, ProbeBrickIndex.kMaxSubdivisionLevels); } - internal void SetNormalBias(float normalBias) { m_NormalBias = normalBias; } - internal static int CellSize(int subdivisionLevel) { return (int)Mathf.Pow(ProbeBrickPool.kBrickCellCount, subdivisionLevel); } internal float BrickSize(int subdivisionLevel) { return m_Transform.scale * CellSize(subdivisionLevel); } internal float MinBrickSize() { return m_Transform.scale; } @@ -613,7 +626,7 @@ internal static void SubdivideBricks(List inBricks, List outSubdiv } // converts a volume into bricks, subdivides the bricks and culls subdivided volumes falling outside the original volume - private void ConvertVolume(Volume cellVolume, List subVolumes, SubdivisionDel subdivider, List outSortedBricks) + void ConvertVolume(Volume cellVolume, List subVolumes, SubdivisionDel subdivider, List outSortedBricks) { Profiler.BeginSample("ConvertVolume"); m_TmpBricks[0].Clear(); @@ -702,7 +715,7 @@ internal void ConvertBricks(List bricks, Vector3[] outProbePositions) } // Runtime API starts here - internal RegId AddBricks(List bricks, ProbeBrickPool.DataLocation dataloc) + RegId AddBricks(List bricks, ProbeBrickPool.DataLocation dataloc) { Profiler.BeginSample("AddBricks"); @@ -749,14 +762,13 @@ internal RegId AddBricks(List bricks, ProbeBrickPool.DataLocation dataloc // update the index m_Index.AddBricks(id, bricks, ch_list, m_Pool.GetChunkSize(), m_Pool.GetPoolWidth(), m_Pool.GetPoolHeight()); - m_Index.WriteConstants(ref m_Transform, m_Pool.GetPoolDimensions(), m_NormalBias); Profiler.EndSample(); return id; } - internal void ReleaseBricks(RegId id) + void ReleaseBricks(RegId id) { List ch_list; if (!m_Registry.TryGetValue(id, out ch_list)) @@ -773,7 +785,7 @@ internal void ReleaseBricks(RegId id) m_Registry.Remove(id); } - private void Transform(Volume inVolume, out Volume outVolume) + void Transform(Volume inVolume, out Volume outVolume) { Matrix4x4 m = GetRefSpaceToWS().inverse; @@ -787,7 +799,7 @@ private void Transform(Volume inVolume, out Volume outVolume) } // Creates bricks at the coarsest level for all areas that are overlapped by the pass in volume - private void Rasterize(Volume volume, List outBricks) + void Rasterize(Volume volume, List outBricks) { Profiler.BeginSample("Rasterize"); // Calculate bounding box for volume in refvol space @@ -823,10 +835,27 @@ private void Rasterize(Volume volume, List outBricks) Profiler.EndSample(); } + /// + /// Update the constant buffer used by Probe Volumes in shaders. + /// + /// A command buffer used to perform the data update. + /// Normal bias to apply to the position used to sample probe volumes. + public void UpdateConstantBuffer(CommandBuffer cmd, float normalBias) + { + ShaderVariablesProbeVolumes shaderVars; + shaderVars._WStoRS = Matrix4x4.Inverse(m_Transform.refSpaceToWS); + shaderVars._IndexDim = m_Index.GetIndexDimension(); + shaderVars._NormalBias = normalBias; + shaderVars._PoolDim = m_Pool.GetPoolDimensions(); + shaderVars.pad0 = 0; + + ConstantBuffer.PushGlobal(cmd, shaderVars, m_CBShaderID); + } + /// /// Cleanup loaded data. /// - public void Cleanup() + void CleanupLoadedData() { m_BricksLoaded = false; @@ -837,6 +866,7 @@ public void Cleanup() } m_ProbeReferenceVolumeInit = false; + ClearDebugData(); } } } diff --git a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoring.cs b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoring.cs index 1d9af10..04e969a 100644 --- a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoring.cs +++ b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeAuthoring.cs @@ -66,12 +66,6 @@ internal static ProbeReferenceVolumeProfile CreateReferenceVolumeProfile(Scene s } #endif - public enum ProbeShadingMode - { - Size, - SH, - Validity - } [SerializeField] private ProbeReferenceVolumeProfile m_Profile = null; @@ -86,21 +80,6 @@ public enum ProbeShadingMode internal float normalBias { get { return m_Profile.normalBias; } } #if UNITY_EDITOR - [SerializeField] - private bool m_DrawProbes; - [SerializeField] - private bool m_DrawBricks; - [SerializeField] - private bool m_DrawCells; - - // Debug shading - [SerializeField] - private ProbeShadingMode m_ProbeShading; - [SerializeField] - private float m_CullingDistance = 500; - [SerializeField] - private float m_Exposure; - // Dilation [SerializeField] private bool m_Dilate = false; @@ -132,7 +111,6 @@ internal void QueueAssetLoading() refVol.Clear(); refVol.SetTRS(transform.position, transform.rotation, m_Profile.brickSize); refVol.SetMaxSubdivision(m_Profile.maxSubdivision); - refVol.SetNormalBias(m_Profile.normalBias); refVol.AddPendingAssetLoading(volumeAsset); } @@ -204,7 +182,7 @@ private void OnDestroy() return true; Vector3 cellCenterWS = cellPosition * m_Profile.cellSize + originWS + Vector3.one * (m_Profile.cellSize / 2.0f); - if (Vector3.Distance(SceneView.lastActiveSceneView.camera.transform.position, cellCenterWS) > m_CullingDistance) + if (Vector3.Distance(SceneView.lastActiveSceneView.camera.transform.position, cellCenterWS) > ProbeReferenceVolume.instance.debugDisplay.cullingDistance) return true; var frustumPlanes = GeometryUtility.CalculateFrustumPlanes(SceneView.lastActiveSceneView.camera); @@ -213,12 +191,15 @@ private void OnDestroy() return !GeometryUtility.TestPlanesAABB(frustumPlanes, volumeAABB); } + // TODO: We need to get rid of Handles.DrawWireCube to be able to have those at runtime as well. private void OnDrawGizmos() { if (!enabled || !gameObject.activeSelf) return; - if (m_DrawBricks) + var debugDisplay = ProbeReferenceVolume.instance.debugDisplay; + + if (debugDisplay.drawBricks) { foreach (var cell in ProbeReferenceVolume.instance.cells.Values) { @@ -249,7 +230,7 @@ MeshGizmo AddBrickGizmo(ProbeReferenceVolume.Cell cell) } } - if (m_DrawCells) + if (debugDisplay.drawCells) { // Fetching this from components instead of from the reference volume allows the user to // preview how cells will look before they commit to a bake. diff --git a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeProfile.cs b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeProfile.cs index e61ac61..db75f7f 100644 --- a/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeProfile.cs +++ b/Runtime/Lighting/ProbeVolume/ProbeReferenceVolumeProfile.cs @@ -83,7 +83,6 @@ internal class ProbeReferenceVolumeProfileEditor : Editor { private SerializedProperty m_CellSize; private SerializedProperty m_MinDistanceBetweenProbes; - private SerializedProperty m_NormalBias; private SerializedProperty m_IndexDimensions; ProbeReferenceVolumeProfile profile => target as ProbeReferenceVolumeProfile; @@ -92,7 +91,6 @@ sealed class Styles // TODO: Better tooltip are needed here. public readonly GUIContent cellSizeStyle = new GUIContent("Brick Count Per Cell", "Determine how much bricks there is in a streamable unit."); public readonly GUIContent minDistanceBetweenProbes = new GUIContent("Min Distance Between Probes", "The minimal distance between two probes in meters."); - public readonly GUIContent normalBias = new GUIContent("Normal Bias", "The normal bias used when sampling the volume. It can reduce leaking."); public readonly GUIContent indexDimensions = new GUIContent("Index Dimensions", "The dimensions of the index buffer."); } @@ -102,7 +100,6 @@ private void OnEnable() { m_CellSize = serializedObject.FindProperty(nameof(ProbeReferenceVolumeProfile.cellSizeInBricks)); m_MinDistanceBetweenProbes = serializedObject.FindProperty(nameof(ProbeReferenceVolumeProfile.minDistanceBetweenProbes)); - m_NormalBias = serializedObject.FindProperty(nameof(ProbeReferenceVolumeProfile.normalBias)); } public override void OnInspectorGUI() @@ -113,9 +110,6 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(m_CellSize, s_Styles.cellSizeStyle); EditorGUILayout.PropertyField(m_MinDistanceBetweenProbes, s_Styles.minDistanceBetweenProbes); EditorGUILayout.HelpBox("Maximum subvision of the volume: " + profile.maxSubdivision, MessageType.Info); - EditorGUILayout.PropertyField(m_NormalBias, s_Styles.normalBias); - - ProbeReferenceVolume.instance.normalBiasFromProfile = m_NormalBias.floatValue; if (EditorGUI.EndChangeCheck()) { diff --git a/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl b/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl index f93625c..6ba6ede 100644 --- a/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl +++ b/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl @@ -1,10 +1,13 @@ #ifndef __PROBEVOLUME_HLSL__ #define __PROBEVOLUME_HLSL__ +#include "Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl" + #ifndef DECODE_SH #include "Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/DecodeSH.hlsl" #endif + // APV specific code struct APVConstants { @@ -16,7 +19,6 @@ struct APVConstants uint3 poolDim; // resolution of the brick pool }; -static const int kAPVConstantsSize = 12 + 1 + 3 + 3 + 3 + 3; struct APVResources { @@ -50,37 +52,6 @@ TEXTURE3D(_APVResL2_2); TEXTURE3D(_APVResL2_3); #endif -APVConstants LoadAPVConstants( StructuredBuffer index ) -{ - APVConstants apvc; - apvc.WStoRS[0][0] = asfloat( index[ 0] ); - apvc.WStoRS[1][0] = asfloat( index[ 1] ); - apvc.WStoRS[2][0] = asfloat( index[ 2] ); - apvc.WStoRS[0][1] = asfloat( index[ 3] ); - apvc.WStoRS[1][1] = asfloat( index[ 4] ); - apvc.WStoRS[2][1] = asfloat( index[ 5] ); - apvc.WStoRS[0][2] = asfloat( index[ 6] ); - apvc.WStoRS[1][2] = asfloat( index[ 7] ); - apvc.WStoRS[2][2] = asfloat( index[ 8] ); - apvc.WStoRS[0][3] = asfloat( index[ 9] ); - apvc.WStoRS[1][3] = asfloat( index[10] ); - apvc.WStoRS[2][3] = asfloat( index[11] ); - apvc.normalBias = asfloat( index[12] ); - apvc.centerRS.x = index[13]; - apvc.centerRS.y = index[14]; - apvc.centerRS.z = index[15]; - apvc.centerIS.x = index[16]; - apvc.centerIS.y = index[17]; - apvc.centerIS.z = index[18]; - apvc.indexDim.x = index[19]; - apvc.indexDim.y = index[20]; - apvc.indexDim.z = index[21]; - apvc.poolDim.x = index[22]; - apvc.poolDim.y = index[23]; - apvc.poolDim.z = index[24]; - return apvc; -} - #define APV_USE_BASE_OFFSET // We split the evaluation in several steps to make variants with different bands easier. @@ -106,7 +77,34 @@ void EvaluateAPVL1(APVResources apvRes, float3 L0, float L1Rx, float3 N, float3 l1_G = DecodeSH(L0.g, l1_G); l1_B = DecodeSH(L0.b, l1_B); - diffuseLighting = SHEvalLinearL1(N, l1_R, l1_G, l1_B); + diffuseLighting = SHEvalLinearL1(N, l1_R, l1_G, l1_B); + backDiffuseLighting = SHEvalLinearL1(backN, l1_R, l1_G, l1_B); +} + +// Temporary duplication +float3 EvaluateAPVL0Point(APVResources apvRes, float3 uvw, out float L1Rx) +{ + float4 L0_L1Rx = SAMPLE_TEXTURE3D_LOD(apvRes.L0_L1Rx, s_point_clamp_sampler, uvw, 0).rgba; + L1Rx = L0_L1Rx.w; + + return L0_L1Rx.xyz; +} + +void EvaluateAPVL1Point(APVResources apvRes, float3 L0, float L1Rx, float3 N, float3 backN, float3 uvw, out float3 diffuseLighting, out float3 backDiffuseLighting) +{ + float4 L1G_L1Ry = SAMPLE_TEXTURE3D_LOD(apvRes.L1G_L1Ry, s_point_clamp_sampler, uvw, 0).rgba; + float4 L1B_L1Rz = SAMPLE_TEXTURE3D_LOD(apvRes.L1B_L1Rz, s_point_clamp_sampler, uvw, 0).rgba; + + float3 l1_R = float3(L1Rx, L1G_L1Ry.w, L1B_L1Rz.w); + float3 l1_G = L1G_L1Ry.xyz; + float3 l1_B = L1B_L1Rz.xyz; + + // decode the L1 coefficients + l1_R = DecodeSH(L0.r, l1_R); + l1_G = DecodeSH(L0.g, l1_G); + l1_B = DecodeSH(L0.b, l1_B); + + diffuseLighting = SHEvalLinearL1(N, l1_R, l1_G, l1_B); backDiffuseLighting = SHEvalLinearL1(backN, l1_R, l1_G, l1_B); } @@ -114,10 +112,10 @@ void EvaluateAPVL1(APVResources apvRes, float3 L0, float L1Rx, float3 N, float3 void EvaluateAPVL1L2(APVResources apvRes, float3 L0, float L1Rx, float3 N, float3 backN, float3 uvw, out float3 diffuseLighting, out float3 backDiffuseLighting) { EvaluateAPVL1(apvRes, L0, L1Rx, N, backN, uvw, diffuseLighting, backDiffuseLighting); + float4 l2_R = SAMPLE_TEXTURE3D_LOD(apvRes.L2_0, s_linear_clamp_sampler, uvw, 0).rgba; float4 l2_G = SAMPLE_TEXTURE3D_LOD(apvRes.L2_1, s_linear_clamp_sampler, uvw, 0).rgba; float4 l2_B = SAMPLE_TEXTURE3D_LOD(apvRes.L2_2, s_linear_clamp_sampler, uvw, 0).rgba; - float4 l2_C = SAMPLE_TEXTURE3D_LOD(apvRes.L2_3, s_linear_clamp_sampler, uvw, 0).rgba; DecodeSH_L2(L0, l2_R, l2_G, l2_B, l2_C); @@ -125,6 +123,21 @@ void EvaluateAPVL1L2(APVResources apvRes, float3 L0, float L1Rx, float3 N, float diffuseLighting += SHEvalLinearL2(N, l2_R, l2_G, l2_B, l2_C); backDiffuseLighting += SHEvalLinearL2(backN, l2_R, l2_G, l2_B, l2_C); } + +void EvaluateAPVL1L2Point(APVResources apvRes, float3 L0, float L1Rx, float3 N, float3 backN, float3 uvw, out float3 diffuseLighting, out float3 backDiffuseLighting) +{ + EvaluateAPVL1Point(apvRes, L0, L1Rx, N, backN, uvw, diffuseLighting, backDiffuseLighting); + + float4 l2_R = SAMPLE_TEXTURE3D_LOD(apvRes.L2_0, s_point_clamp_sampler, uvw, 0).rgba; + float4 l2_G = SAMPLE_TEXTURE3D_LOD(apvRes.L2_1, s_point_clamp_sampler, uvw, 0).rgba; + float4 l2_B = SAMPLE_TEXTURE3D_LOD(apvRes.L2_2, s_point_clamp_sampler, uvw, 0).rgba; + float4 l2_C = SAMPLE_TEXTURE3D_LOD(apvRes.L2_3, s_point_clamp_sampler, uvw, 0).rgba; + + DecodeSH_L2(L0, l2_R, l2_G, l2_B, l2_C); + + diffuseLighting += SHEvalLinearL2(N, l2_R, l2_G, l2_B, l2_C); + backDiffuseLighting += SHEvalLinearL2(backN, l2_R, l2_G, l2_B, l2_C); +} #endif bool TryToGetPoolUVW(APVResources apvRes, float3 posWS, float3 normalWS, out float3 uvw) @@ -133,29 +146,30 @@ bool TryToGetPoolUVW(APVResources apvRes, float3 posWS, float3 normalWS, out flo // Note: we could instead early return when we know we'll have invalid UVs, but some bade code gen on Vulkan generates shader warnings if we do. bool hasValidUVW = true; - APVConstants apvConst = LoadAPVConstants(apvRes.index); // transform into APV space - float3 posRS = mul(apvConst.WStoRS, float4(posWS + normalWS * apvConst.normalBias, 1.0)); - posRS -= apvConst.centerRS; + float3 posRS = mul(_WStoRS, float4(posWS + normalWS * _NormalBias, 1.0)).xyz; + uint3 indexDim = (uint3)_IndexDim; + uint3 poolDim = (uint3)_PoolDim; + int3 centerIS = indexDim / 2; // check bounds #ifdef APV_USE_BASE_OFFSET - if (any(abs(posRS.xz) > float2(apvConst.indexDim.xz / 2))) + if (any(abs(posRS.xz) > float2(centerIS.xz))) #else - if (any(abs(posRS) > float3(apvConst.indexDim / 2))) + if (any(abs(posRS) > float3(centerIS))) #endif { hasValidUVW = false; } // convert to index - int3 index = apvConst.centerIS + floor(posRS); - index = index % apvConst.indexDim; + int3 index = centerIS + floor(posRS); + index = index % indexDim; #ifdef APV_USE_BASE_OFFSET // get the y-offset - int yoffset = apvRes.index[kAPVConstantsSize + index.z * apvConst.indexDim.x + index.x]; - if (yoffset == -1 || posRS.y < yoffset || posRS.y >= float(apvConst.indexDim.y)) + int yoffset = apvRes.index[index.z * indexDim.x + index.x]; + if (yoffset == -1 || posRS.y < yoffset || posRS.y >= float(indexDim.y)) { hasValidUVW = false; } @@ -164,8 +178,8 @@ bool TryToGetPoolUVW(APVResources apvRes, float3 posWS, float3 normalWS, out flo #endif // resolve the index - int base_offset = kAPVConstantsSize + apvConst.indexDim.x * apvConst.indexDim.z; - int flattened_index = index.z * (apvConst.indexDim.x * apvConst.indexDim.y) + index.x * apvConst.indexDim.y + index.y; + int base_offset = indexDim.x * indexDim.z; + int flattened_index = index.z * (indexDim.x * indexDim.y) + index.x * indexDim.y + index.y; uint packed_pool_idx = apvRes.index[base_offset + flattened_index]; // no valid brick loaded for this index, fallback to ambient probe @@ -180,16 +194,16 @@ bool TryToGetPoolUVW(APVResources apvRes, float3 posWS, float3 normalWS, out flo float cellSize = pow(3.0, subdiv); uint flattened_pool_idx = packed_pool_idx & ((1 << 28) - 1); uint3 pool_idx; - pool_idx.z = flattened_pool_idx / (apvConst.poolDim.x * apvConst.poolDim.y); - flattened_pool_idx -= pool_idx.z * (apvConst.poolDim.x * apvConst.poolDim.y); - pool_idx.y = flattened_pool_idx / apvConst.poolDim.x; - pool_idx.x = flattened_pool_idx - (pool_idx.y * apvConst.poolDim.x); - uvw = ((float3) pool_idx + 0.5) / (float3) apvConst.poolDim; + pool_idx.z = flattened_pool_idx / (poolDim.x * poolDim.y); + flattened_pool_idx -= pool_idx.z * (poolDim.x * poolDim.y); + pool_idx.y = flattened_pool_idx / poolDim.x; + pool_idx.x = flattened_pool_idx - (pool_idx.y * poolDim.x); + uvw = ((float3) pool_idx + 0.5) / _PoolDim; // calculate uv offset and scale float3 offset = frac(posRS / (float)cellSize); // [0;1] in brick space //offset = clamp( offset, 0.25, 0.75 ); // [0.25;0.75] in brick space (is this actually necessary?) - offset *= 3.0 / (float3) apvConst.poolDim; // convert brick footprint to texels footprint in pool texel space + offset *= 3.0 / _PoolDim; // convert brick footprint to texels footprint in pool texel space uvw += offset; // add the final offset return hasValidUVW; diff --git a/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs b/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs new file mode 100644 index 0000000..7df4fc6 --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs @@ -0,0 +1,20 @@ +using System; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Serialization; +using UnityEngine.Rendering; + +namespace UnityEngine.Experimental.Rendering +{ + /// + /// A volume component that holds settings for the Probe Volumes System per-camera options. + /// + [Serializable, VolumeComponentMenu("Lighting/Experimental/Probe Volumes Options")] + public sealed class ProbeVolumesOptions : VolumeComponent + { + /// + /// The overridden normal bias to be applied to the world position when sampling the Probe Volumes data structure. Units is meters. + /// + [Tooltip("The overridden normal bias to be applied to the world position when sampling the Probe Volumes data structure. Units is meters.")] + public ClampedFloatParameter normalBias = new ClampedFloatParameter(0.33f, 0.0f, 2.0f); + } +} diff --git a/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs.meta b/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs.meta new file mode 100644 index 0000000..bb65c73 --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42a9a5de28b23a2468327a4ad9eee228 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs new file mode 100644 index 0000000..86cabbf --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs @@ -0,0 +1,24 @@ +using UnityEngine.Rendering; + +namespace UnityEngine.Rendering +{ + /// + /// Defines the constant buffer register that will be used as binding point for the Probe Volumes constant buffer. + /// + public enum APVConstantBufferRegister + { + GlobalRegister = 5 + } + + [GenerateHLSL(needAccessors = false, generateCBuffer = true, constantRegister = (int)APVConstantBufferRegister.GlobalRegister)] + internal unsafe struct ShaderVariablesProbeVolumes + { + public Matrix4x4 _WStoRS; + + public Vector3 _IndexDim; + public float _NormalBias; + + public Vector3 _PoolDim; + public float pad0; + } +} diff --git a/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl new file mode 100644 index 0000000..4108132 --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl @@ -0,0 +1,18 @@ +// +// This file was automatically generated. Please don't edit by hand. Execute Editor command [ Edit > Rendering > Generate Shader Includes ] instead +// + +#ifndef SHADERVARIABLESPROBEVOLUMES_CS_HLSL +#define SHADERVARIABLESPROBEVOLUMES_CS_HLSL +// Generated from UnityEngine.Rendering.ShaderVariablesProbeVolumes +// PackingRules = Exact +GLOBAL_CBUFFER_START(ShaderVariablesProbeVolumes, b5) + float4x4 _WStoRS; + float3 _IndexDim; + float _NormalBias; + float3 _PoolDim; + float pad0; +CBUFFER_END + + +#endif diff --git a/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl.meta b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl.meta new file mode 100644 index 0000000..9edfb9e --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dcbd446e83bc87d40b82dd90f8814c3c +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.meta b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.meta new file mode 100644 index 0000000..ca7f568 --- /dev/null +++ b/Runtime/Lighting/ProbeVolume/ShaderVariablesProbeVolumes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6df0bea367f474d46865e94282c99503 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/RenderGraph/RenderGraph.cs b/Runtime/RenderGraph/RenderGraph.cs index 60d1c65..eed02b8 100644 --- a/Runtime/RenderGraph/RenderGraph.cs +++ b/Runtime/RenderGraph/RenderGraph.cs @@ -28,7 +28,7 @@ public class RenderGraphContext public ScriptableRenderContext renderContext; ///Command Buffer used for rendering. public CommandBuffer cmd; - ///Render Graph pooll used for temporary data. + ///Render Graph pool used for temporary data. public RenderGraphObjectPool renderGraphPool; ///Render Graph default resources. public RenderGraphDefaultResources defaultResources; diff --git a/Runtime/RenderGraph/RenderGraphResourceRegistry.cs b/Runtime/RenderGraph/RenderGraphResourceRegistry.cs index cd382dc..c0f9fef 100644 --- a/Runtime/RenderGraph/RenderGraphResourceRegistry.cs +++ b/Runtime/RenderGraph/RenderGraphResourceRegistry.cs @@ -497,14 +497,6 @@ void ValidateTextureDesc(in TextureDesc desc) { if (desc.width == 0 || desc.height == 0) throw new ArgumentException("Texture using Explicit size mode was create with either width or height at zero."); - if (desc.enableMSAA) - throw new ArgumentException("enableMSAA TextureDesc parameter is not supported for textures using Explicit size mode."); - } - - if (desc.sizeMode == TextureSizeMode.Scale || desc.sizeMode == TextureSizeMode.Functor) - { - if (desc.msaaSamples != MSAASamples.None) - throw new ArgumentException("msaaSamples TextureDesc parameter is not supported for textures using Scale or Functor size mode."); } #endif } diff --git a/Runtime/RenderGraph/RenderGraphResourceTexture.cs b/Runtime/RenderGraph/RenderGraphResourceTexture.cs index 3f6d77e..35a61af 100644 --- a/Runtime/RenderGraph/RenderGraphResourceTexture.cs +++ b/Runtime/RenderGraph/RenderGraphResourceTexture.cs @@ -124,9 +124,7 @@ public struct TextureDesc public int anisoLevel; ///Mip map bias. public float mipMapBias; - ///Textre is multisampled. Only supported for Scale and Functor size mode. - public bool enableMSAA; - ///Number of MSAA samples. Only supported for Explicit size mode. + ///Number of MSAA samples. public MSAASamples msaaSamples; ///Bind texture multi sampled. public bool bindTextureMS; @@ -244,17 +242,14 @@ public override int GetHashCode() case TextureSizeMode.Explicit: hashCode = hashCode * 23 + width; hashCode = hashCode * 23 + height; - hashCode = hashCode * 23 + (int)msaaSamples; break; case TextureSizeMode.Functor: if (func != null) hashCode = hashCode * 23 + func.GetHashCode(); - hashCode = hashCode * 23 + (enableMSAA ? 1 : 0); break; case TextureSizeMode.Scale: hashCode = hashCode * 23 + scale.x.GetHashCode(); hashCode = hashCode * 23 + scale.y.GetHashCode(); - hashCode = hashCode * 23 + (enableMSAA ? 1 : 0); break; } @@ -273,6 +268,7 @@ public override int GetHashCode() hashCode = hashCode * 23 + (isShadowMap ? 1 : 0); hashCode = hashCode * 23 + (bindTextureMS ? 1 : 0); hashCode = hashCode * 23 + (useDynamicScale ? 1 : 0); + hashCode = hashCode * 23 + (int)msaaSamples; #if UNITY_2020_2_OR_NEWER hashCode = hashCode * 23 + (fastMemoryDesc.inFastMemory ? 1 : 0); #endif @@ -350,11 +346,11 @@ public override void CreateGraphicsResource(string name = "") break; case TextureSizeMode.Scale: graphicsResource = RTHandles.Alloc(desc.scale, desc.slices, desc.depthBufferBits, desc.colorFormat, desc.filterMode, desc.wrapMode, desc.dimension, desc.enableRandomWrite, - desc.useMipMap, desc.autoGenerateMips, desc.isShadowMap, desc.anisoLevel, desc.mipMapBias, desc.enableMSAA, desc.bindTextureMS, desc.useDynamicScale, desc.memoryless, name); + desc.useMipMap, desc.autoGenerateMips, desc.isShadowMap, desc.anisoLevel, desc.mipMapBias, desc.msaaSamples, desc.bindTextureMS, desc.useDynamicScale, desc.memoryless, name); break; case TextureSizeMode.Functor: graphicsResource = RTHandles.Alloc(desc.func, desc.slices, desc.depthBufferBits, desc.colorFormat, desc.filterMode, desc.wrapMode, desc.dimension, desc.enableRandomWrite, - desc.useMipMap, desc.autoGenerateMips, desc.isShadowMap, desc.anisoLevel, desc.mipMapBias, desc.enableMSAA, desc.bindTextureMS, desc.useDynamicScale, desc.memoryless, name); + desc.useMipMap, desc.autoGenerateMips, desc.isShadowMap, desc.anisoLevel, desc.mipMapBias, desc.msaaSamples, desc.bindTextureMS, desc.useDynamicScale, desc.memoryless, name); break; } } diff --git a/Runtime/RenderPipeline/IOverrideCoreEditorResources.cs b/Runtime/RenderPipeline/IOverrideCoreEditorResources.cs deleted file mode 100644 index be84590..0000000 --- a/Runtime/RenderPipeline/IOverrideCoreEditorResources.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace UnityEngine.Rendering -{ - /// - /// Allows a render pipeline to override some of the default resources used in core. This interface needs to be implemented on the RenderPipelineAsset. - /// - public interface IOverrideCoreEditorResources - { -#if UNITY_EDITOR - /// - /// Overrides the shader used to show the probes in the Probe Volume system. This is useful when your probe relies on render pipeline specific data to be used, like exposure for example. - /// - /// The shader used to render the probe debug gizmo. - Shader GetProbeVolumeProbeShader(); -#endif - } -} diff --git a/Runtime/RenderPipeline/RenderPipelineResources.cs b/Runtime/RenderPipeline/RenderPipelineResources.cs new file mode 100644 index 0000000..a781784 --- /dev/null +++ b/Runtime/RenderPipeline/RenderPipelineResources.cs @@ -0,0 +1,15 @@ +namespace UnityEngine.Rendering +{ + /// + /// Base of resources assets in SRP + /// + public abstract class RenderPipelineResources : ScriptableObject + { + /// + /// Utility to add Reload All button at the end of your asset inspector. + /// It will provide your package path that you misu override in child class. + /// + protected virtual string packagePath => null; + internal string packagePath_Internal => packagePath; + } +} diff --git a/Runtime/RenderPipeline/RenderPipelineResources.cs.meta b/Runtime/RenderPipeline/RenderPipelineResources.cs.meta new file mode 100644 index 0000000..fcd2432 --- /dev/null +++ b/Runtime/RenderPipeline/RenderPipelineResources.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b43eb475bb161a44f9da1fc2fd1fff41 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Textures/BufferedRTHandleSystem.cs b/Runtime/Textures/BufferedRTHandleSystem.cs index c9d74c8..b8e89f0 100644 --- a/Runtime/Textures/BufferedRTHandleSystem.cs +++ b/Runtime/Textures/BufferedRTHandleSystem.cs @@ -123,15 +123,14 @@ public void ReleaseBuffer(int bufferId) } /// - /// Swap buffers Set the reference size for this RT Handle System () + /// Swap buffers Set the reference size for this RT Handle System () /// /// The width of the RTs of this buffer. /// The height of the RTs of this buffer. - /// Number of MSAA samples for this buffer. - public void SwapAndSetReferenceSize(int width, int height, MSAASamples msaaSamples) + public void SwapAndSetReferenceSize(int width, int height) { Swap(); - m_RTHandleSystem.SetReferenceSize(width, height, msaaSamples); + m_RTHandleSystem.SetReferenceSize(width, height); } /// diff --git a/Runtime/Textures/RTHandle.cs b/Runtime/Textures/RTHandle.cs index e06218a..d82f4a9 100644 --- a/Runtime/Textures/RTHandle.cs +++ b/Runtime/Textures/RTHandle.cs @@ -155,6 +155,9 @@ public void Release() /// Input size scaled by the RTHandle scale factor. public Vector2Int GetScaledSize(Vector2Int refSize) { + if (!useScaling) + return refSize; + if (scaleFunc != null) { return scaleFunc(refSize); diff --git a/Runtime/Textures/RTHandleSystem.cs b/Runtime/Textures/RTHandleSystem.cs index 48ff4f9..84d1fa8 100644 --- a/Runtime/Textures/RTHandleSystem.cs +++ b/Runtime/Textures/RTHandleSystem.cs @@ -53,8 +53,6 @@ internal enum ResizeMode // Parameters for auto-scaled Render Textures bool m_HardwareDynamicResRequested = false; - bool m_ScaledRTSupportsMSAA = false; - MSAASamples m_ScaledRTCurrentMSAASamples = MSAASamples.None; HashSet m_AutoSizedRTs; RTHandle[] m_AutoSizedRTsArray; // For fast iteration HashSet m_ResizeOnDemandRTs; @@ -96,9 +94,7 @@ public void Dispose() /// /// Initial reference rendering width. /// Initial reference rendering height. - /// Set to true if automatically scaled RTHandles should support MSAA - /// Number of MSAA samples for automatically scaled RTHandles. - public void Initialize(int width, int height, bool scaledRTsupportsMSAA, MSAASamples scaledRTMSAASamples) + public void Initialize(int width, int height) { if (m_AutoSizedRTs.Count != 0) { @@ -113,9 +109,6 @@ public void Initialize(int width, int height, bool scaledRTsupportsMSAA, MSAASam m_MaxWidths = width; m_MaxHeights = height; - m_ScaledRTSupportsMSAA = scaledRTsupportsMSAA; - m_ScaledRTCurrentMSAASamples = scaledRTMSAASamples; - m_HardwareDynamicResRequested = DynamicResolutionHandler.instance.RequestsHardwareDynamicResolution(); } @@ -146,7 +139,7 @@ public void ResetReferenceSize(int width, int height) { m_MaxWidths = width; m_MaxHeights = height; - SetReferenceSize(width, height, m_ScaledRTCurrentMSAASamples, reset: true); + SetReferenceSize(width, height, reset: true); } /// @@ -154,10 +147,9 @@ public void ResetReferenceSize(int width, int height) /// /// Reference rendering width for subsequent rendering. /// Reference rendering height for subsequent rendering. - /// Number of MSAA samples for multisampled textures for subsequent rendering. - public void SetReferenceSize(int width, int height, MSAASamples msaaSamples) + public void SetReferenceSize(int width, int height) { - SetReferenceSize(width, height, msaaSamples, false); + SetReferenceSize(width, height, false); } /// @@ -165,9 +157,8 @@ public void SetReferenceSize(int width, int height, MSAASamples msaaSamples) /// /// Reference rendering width for subsequent rendering. /// Reference rendering height for subsequent rendering. - /// Number of MSAA samples for multisampled textures for subsequent rendering. /// If set to true, the new width and height will override the old values even if they are not bigger. - public void SetReferenceSize(int width, int height, MSAASamples msaaSamples, bool reset) + public void SetReferenceSize(int width, int height, bool reset) { m_RTHandleProperties.previousViewportSize = m_RTHandleProperties.currentViewportSize; m_RTHandleProperties.previousRenderTargetSize = m_RTHandleProperties.currentRenderTargetSize; @@ -197,11 +188,9 @@ public void SetReferenceSize(int width, int height, MSAASamples msaaSamples, boo #endif bool sizeChanged = width > GetMaxWidth() || height > GetMaxHeight() || reset; - bool msaaSamplesChanged = (msaaSamples != m_ScaledRTCurrentMSAASamples); - - if (sizeChanged || msaaSamplesChanged) + if (sizeChanged) { - Resize(width, height, msaaSamples, sizeChanged, msaaSamplesChanged); + Resize(width, height, sizeChanged); } m_RTHandleProperties.currentViewportSize = new Vector2Int(width, height); @@ -303,18 +292,12 @@ void DemandResize(RTHandle rth) // Did the size change? var sizeChanged = rt.width != scaledSize.x || rt.height != scaledSize.y; - // If this is an MSAA texture, did the sample count change? - var msaaSampleChanged = rth.m_EnableMSAA && rt.antiAliasing != (int)m_ScaledRTCurrentMSAASamples; - if (sizeChanged || msaaSampleChanged) + if (sizeChanged) { // Free this render texture rt.Release(); - // Update the antialiasing count - if (rth.m_EnableMSAA) - rt.antiAliasing = (int)m_ScaledRTCurrentMSAASamples; - // Update the size rt.width = scaledSize.x; rt.height = scaledSize.y; @@ -329,7 +312,7 @@ void DemandResize(RTHandle rth) rth.m_Name, mips: rt.useMipMap, enableMSAA: rth.m_EnableMSAA, - msaaSamples: m_ScaledRTCurrentMSAASamples, + msaaSamples: (MSAASamples)rt.antiAliasing, dynamicRes: rt.useDynamicScale ); @@ -374,11 +357,10 @@ void Dispose(bool disposing) } } - void Resize(int width, int height, MSAASamples msaaSamples, bool sizeChanged, bool msaaSampleChanged) + void Resize(int width, int height, bool sizeChanged) { m_MaxWidths = Math.Max(width, m_MaxWidths); m_MaxHeights = Math.Max(height, m_MaxHeights); - m_ScaledRTCurrentMSAASamples = msaaSamples; var maxSize = new Vector2Int(m_MaxWidths, m_MaxHeights); @@ -390,12 +372,6 @@ void Resize(int width, int height, MSAASamples msaaSamples, bool sizeChanged, bo // Grab the RT Handle var rth = m_AutoSizedRTsArray[i]; - // If we are only processing MSAA sample count change, make sure this RT is an MSAA one - if (!sizeChanged && msaaSampleChanged && !rth.m_EnableMSAA) - { - continue; - } - // Force its new reference size rth.referenceSize = maxSize; @@ -411,14 +387,8 @@ void Resize(int width, int height, MSAASamples msaaSamples, bool sizeChanged, bo renderTexture.width = Mathf.Max(scaledSize.x, 1); renderTexture.height = Mathf.Max(scaledSize.y, 1); - // If this is a msaa texture, make sure to update its msaa count - if (rth.m_EnableMSAA) - { - renderTexture.antiAliasing = (int)m_ScaledRTCurrentMSAASamples; - } - // Regenerate the name - renderTexture.name = CoreUtils.GetRenderTargetAutoName(renderTexture.width, renderTexture.height, renderTexture.volumeDepth, renderTexture.graphicsFormat, renderTexture.dimension, rth.m_Name, mips: renderTexture.useMipMap, enableMSAA: rth.m_EnableMSAA, msaaSamples: m_ScaledRTCurrentMSAASamples, dynamicRes: renderTexture.useDynamicScale); + renderTexture.name = CoreUtils.GetRenderTargetAutoName(renderTexture.width, renderTexture.height, renderTexture.volumeDepth, renderTexture.graphicsFormat, renderTexture.dimension, rth.m_Name, mips: renderTexture.useMipMap, enableMSAA: rth.m_EnableMSAA, msaaSamples: (MSAASamples)renderTexture.antiAliasing, dynamicRes: renderTexture.useDynamicScale); // Create the render texture renderTexture.Create(); @@ -559,12 +529,12 @@ public RTHandle Alloc( /// Set to true if the depth buffer should be used as a shadow map. /// Anisotropic filtering level. /// Bias applied to mipmaps during filtering. - /// Enable MSAA for this RTHandle. + /// Number of MSAA samples. /// Set to true if the texture needs to be bound as a multisampled texture in the shader. /// Set to true to use hardware dynamic scaling. /// Use this property to set the render texture memoryless modes. /// Name of the RTHandle. - /// + /// A new RTHandle. public RTHandle Alloc( Vector2 scaleFactor, int slices = 1, @@ -579,17 +549,13 @@ public RTHandle Alloc( bool isShadowMap = false, int anisoLevel = 1, float mipMapBias = 0f, - bool enableMSAA = false, + MSAASamples msaaSamples = MSAASamples.None, bool bindTextureMS = false, bool useDynamicScale = false, RenderTextureMemoryless memoryless = RenderTextureMemoryless.None, string name = "" ) { - // If an MSAA target is requested, make sure the support was on - if (enableMSAA) - Debug.Assert(m_ScaledRTSupportsMSAA); - int width = Mathf.Max(Mathf.RoundToInt(scaleFactor.x * GetMaxWidth()), 1); int height = Mathf.Max(Mathf.RoundToInt(scaleFactor.y * GetMaxHeight()), 1); @@ -607,7 +573,7 @@ public RTHandle Alloc( isShadowMap, anisoLevel, mipMapBias, - enableMSAA, + msaaSamples, bindTextureMS, useDynamicScale, memoryless, @@ -647,12 +613,12 @@ public RTHandle Alloc( /// Set to true if the depth buffer should be used as a shadow map. /// Anisotropic filtering level. /// Bias applied to mipmaps during filtering. - /// Enable MSAA for this RTHandle. + /// Number of MSAA samples. /// Set to true if the texture needs to be bound as a multisampled texture in the shader. /// Set to true to use hardware dynamic scaling. /// Use this property to set the render texture memoryless modes. /// Name of the RTHandle. - /// + /// A new RTHandle. public RTHandle Alloc( ScaleFunc scaleFunc, int slices = 1, @@ -667,7 +633,7 @@ public RTHandle Alloc( bool isShadowMap = false, int anisoLevel = 1, float mipMapBias = 0f, - bool enableMSAA = false, + MSAASamples msaaSamples = MSAASamples.None, bool bindTextureMS = false, bool useDynamicScale = false, RenderTextureMemoryless memoryless = RenderTextureMemoryless.None, @@ -692,7 +658,7 @@ public RTHandle Alloc( isShadowMap, anisoLevel, mipMapBias, - enableMSAA, + msaaSamples, bindTextureMS, useDynamicScale, memoryless, @@ -721,13 +687,14 @@ RTHandle AllocAutoSizedRenderTexture( bool isShadowMap, int anisoLevel, float mipMapBias, - bool enableMSAA, + MSAASamples msaaSamples, bool bindTextureMS, bool useDynamicScale, RenderTextureMemoryless memoryless, string name ) { + bool enableMSAA = msaaSamples != MSAASamples.None; // Here user made a mistake in setting up msaa/bindMS, hence the warning if (!enableMSAA && bindTextureMS == true) { @@ -735,23 +702,13 @@ string name bindTextureMS = false; } - bool allocForMSAA = m_ScaledRTSupportsMSAA ? enableMSAA : false; - // Here we purposefully disable MSAA so we just force the bindMS param to false. - if (!allocForMSAA) - { - bindTextureMS = false; - } - // MSAA Does not support random read/write. - bool UAV = enableRandomWrite; - if (allocForMSAA && (UAV == true)) + if (enableMSAA && (enableRandomWrite == true)) { Debug.LogWarning("RTHandle that is MSAA-enabled cannot allocate MSAA RT with 'enableRandomWrite = true'."); - UAV = false; + enableRandomWrite = false; } - int msaaSamples = allocForMSAA ? (int)m_ScaledRTCurrentMSAASamples : 1; - // We need to handle this in an explicit way since GraphicsFormat does not expose depth formats. TODO: Get rid of this branch once GraphicsFormat'll expose depth related formats RenderTexture rt; if (isShadowMap || depthBufferBits != DepthBits.None) @@ -765,17 +722,17 @@ string name filterMode = filterMode, wrapMode = wrapMode, dimension = dimension, - enableRandomWrite = UAV, + enableRandomWrite = enableRandomWrite, useMipMap = useMipMap, autoGenerateMips = autoGenerateMips, anisoLevel = anisoLevel, mipMapBias = mipMapBias, - antiAliasing = msaaSamples, + antiAliasing = (int)msaaSamples, bindTextureMS = bindTextureMS, useDynamicScale = m_HardwareDynamicResRequested && useDynamicScale, memorylessMode = memoryless, stencilFormat = stencilFormat, - name = CoreUtils.GetRenderTargetAutoName(width, height, slices, colorFormat, dimension, name, mips: useMipMap, enableMSAA: allocForMSAA, msaaSamples: m_ScaledRTCurrentMSAASamples, dynamicRes: useDynamicScale) + name = CoreUtils.GetRenderTargetAutoName(width, height, slices, colorFormat, dimension, name, mips: useMipMap, enableMSAA: enableMSAA, msaaSamples: msaaSamples, dynamicRes: useDynamicScale) }; } else @@ -787,16 +744,16 @@ string name filterMode = filterMode, wrapMode = wrapMode, dimension = dimension, - enableRandomWrite = UAV, + enableRandomWrite = enableRandomWrite, useMipMap = useMipMap, autoGenerateMips = autoGenerateMips, anisoLevel = anisoLevel, mipMapBias = mipMapBias, - antiAliasing = msaaSamples, + antiAliasing = (int)msaaSamples, bindTextureMS = bindTextureMS, useDynamicScale = m_HardwareDynamicResRequested && useDynamicScale, memorylessMode = memoryless, - name = CoreUtils.GetRenderTargetAutoName(width, height, slices, colorFormat, dimension, name, mips: useMipMap, enableMSAA: allocForMSAA, msaaSamples: m_ScaledRTCurrentMSAASamples, dynamicRes: useDynamicScale) + name = CoreUtils.GetRenderTargetAutoName(width, height, slices, colorFormat, dimension, name, mips: useMipMap, enableMSAA: enableMSAA, msaaSamples: msaaSamples, dynamicRes: useDynamicScale) }; } diff --git a/Runtime/Textures/RTHandles.cs b/Runtime/Textures/RTHandles.cs index eb0eda0..912519c 100644 --- a/Runtime/Textures/RTHandles.cs +++ b/Runtime/Textures/RTHandles.cs @@ -106,12 +106,12 @@ public static RTHandle Alloc( /// Set to true if the depth buffer should be used as a shadow map. /// Anisotropic filtering level. /// Bias applied to mipmaps during filtering. - /// Enable MSAA for this RTHandle. + /// Number of MSAA samples. /// Set to true if the texture needs to be bound as a multisampled texture in the shader. /// Set to true to use hardware dynamic scaling. /// Use this property to set the render texture memoryless modes. /// Name of the RTHandle. - /// + /// A new RTHandle. public static RTHandle Alloc( Vector2 scaleFactor, int slices = 1, @@ -126,7 +126,7 @@ public static RTHandle Alloc( bool isShadowMap = false, int anisoLevel = 1, float mipMapBias = 0, - bool enableMSAA = false, + MSAASamples msaaSamples = MSAASamples.None, bool bindTextureMS = false, bool useDynamicScale = false, RenderTextureMemoryless memoryless = RenderTextureMemoryless.None, @@ -147,7 +147,7 @@ public static RTHandle Alloc( isShadowMap, anisoLevel, mipMapBias, - enableMSAA, + msaaSamples, bindTextureMS, useDynamicScale, memoryless, @@ -171,7 +171,7 @@ public static RTHandle Alloc( /// Set to true if the depth buffer should be used as a shadow map. /// Anisotropic filtering level. /// Bias applied to mipmaps during filtering. - /// Enable MSAA for this RTHandle. + /// Number of MSAA samples. /// Set to true if the texture needs to be bound as a multisampled texture in the shader. /// Set to true to use hardware dynamic scaling. /// Use this property to set the render texture memoryless modes. @@ -191,7 +191,7 @@ public static RTHandle Alloc( bool isShadowMap = false, int anisoLevel = 1, float mipMapBias = 0, - bool enableMSAA = false, + MSAASamples msaaSamples = MSAASamples.None, bool bindTextureMS = false, bool useDynamicScale = false, RenderTextureMemoryless memoryless = RenderTextureMemoryless.None, @@ -212,7 +212,7 @@ public static RTHandle Alloc( isShadowMap, anisoLevel, mipMapBias, - enableMSAA, + msaaSamples, bindTextureMS, useDynamicScale, memoryless, @@ -272,21 +272,9 @@ private static RTHandle Alloc(RTHandle tex) /// /// Initial reference rendering width. /// Initial reference rendering height. - /// Set to true if automatically scaled RTHandles should support MSAA - /// Number of MSAA samples for automatically scaled RTHandles. - public static void Initialize( - int width, - int height, - bool scaledRTsupportsMSAA, - MSAASamples scaledRTMSAASamples - ) + public static void Initialize(int width, int height) { - s_DefaultInstance.Initialize( - width, - height, - scaledRTsupportsMSAA, - scaledRTMSAASamples - ); + s_DefaultInstance.Initialize(width, height); } /// @@ -312,18 +300,9 @@ public static void SetHardwareDynamicResolutionState(bool hwDynamicResRequested) /// /// Reference rendering width for subsequent rendering. /// Reference rendering height for subsequent rendering. - /// Number of MSAA samples for multisampled textures for subsequent rendering. - public static void SetReferenceSize( - int width, - int height, - MSAASamples msaaSamples - ) + public static void SetReferenceSize(int width, int height) { - s_DefaultInstance.SetReferenceSize( - width, - height, - msaaSamples - ); + s_DefaultInstance.SetReferenceSize(width, height); } /// diff --git a/Runtime/Textures/TextureXR.cs b/Runtime/Textures/TextureXR.cs index 1d259e9..f47585e 100644 --- a/Runtime/Textures/TextureXR.cs +++ b/Runtime/Textures/TextureXR.cs @@ -92,6 +92,7 @@ public static TextureDimension dimension /// The default magenta texture. public static RTHandle GetMagentaTexture() { return useTexArray ? m_MagentaTexture2DArrayRTH : m_MagentaTextureRTH; } + static Texture2D m_BlackTexture; static Texture3D m_BlackTexture3D; static Texture2DArray m_BlackTexture2DArray; static RTHandle m_BlackTexture2DArrayRTH; @@ -161,9 +162,12 @@ public static void Initialize(CommandBuffer cmd, ComputeShader clearR32_UIntShad // Black RTHandles.Release(m_BlackTextureRTH); - m_BlackTextureRTH = RTHandles.Alloc(Texture2D.blackTexture); + m_BlackTexture = new Texture2D(1, 1, GraphicsFormat.R8G8B8A8_SRGB, TextureCreationFlags.None) { name = "Black Texture" }; + m_BlackTexture.SetPixel(0, 0, Color.black); + m_BlackTexture.Apply(); + m_BlackTextureRTH = RTHandles.Alloc(m_BlackTexture); RTHandles.Release(m_BlackTexture2DArrayRTH); - m_BlackTexture2DArray = CreateTexture2DArrayFromTexture2D(Texture2D.blackTexture, "Black Texture2DArray"); + m_BlackTexture2DArray = CreateTexture2DArrayFromTexture2D(m_BlackTexture, "Black Texture2DArray"); m_BlackTexture2DArrayRTH = RTHandles.Alloc(m_BlackTexture2DArray); RTHandles.Release(m_BlackTexture3DRTH); m_BlackTexture3D = CreateBlackTexture3D("Black Texture3D"); diff --git a/ShaderLibrary/AreaLighting.hlsl b/ShaderLibrary/AreaLighting.hlsl index 368095c..95a53c3 100644 --- a/ShaderLibrary/AreaLighting.hlsl +++ b/ShaderLibrary/AreaLighting.hlsl @@ -21,7 +21,8 @@ real3 ComputeEdgeFactor(real3 V1, real3 V2) if (V1oV2 < 0) { // Undo range reduction. - y = PI * rsqrt(saturate(1 - V1oV2 * V1oV2)) - y; + const float epsilon = 1e-5f; + y = PI * rsqrt(max(epsilon, saturate(1 - V1oV2 * V1oV2))) - y; } return V1xV2 * y; diff --git a/ShaderLibrary/Common.hlsl b/ShaderLibrary/Common.hlsl index ebd7569..3fd7994 100644 --- a/ShaderLibrary/Common.hlsl +++ b/ShaderLibrary/Common.hlsl @@ -787,8 +787,7 @@ float ComputeTextureLOD(float3 duvw_dx, float3 duvw_dy, float3 duvw_dz, float sc return max(0.5f * log2(d * (scale * scale)) - bias, 0.0); } - -uint GetMipCount(Texture2D tex) +uint GetMipCount(TEXTURE2D_PARAM(tex, smp)) { #if defined(SHADER_API_D3D11) || defined(SHADER_API_D3D12) || defined(SHADER_API_D3D11_9X) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_PSSL) #define MIP_COUNT_SUPPORTED 1 diff --git a/ShaderLibrary/Debug.hlsl b/ShaderLibrary/Debug.hlsl index 105bac1..01d22da 100644 --- a/ShaderLibrary/Debug.hlsl +++ b/ShaderLibrary/Debug.hlsl @@ -164,35 +164,35 @@ float4 GetMipLevelColor(float2 uv, float4 texelSize) return color; } -float3 GetDebugMipColor(float3 originalColor, Texture2D tex, float4 texelSize, float2 uv) +float3 GetDebugMipColor(float3 originalColor, float4 texelSize, float2 uv) { // https://aras-p.info/blog/2011/05/03/a-way-to-visualize-mip-levels/ - float4 mipColor= GetMipLevelColor(uv, texelSize); + float4 mipColor = GetMipLevelColor(uv, texelSize); return lerp(originalColor, mipColor.rgb, mipColor.a); } -float3 GetDebugMipCountColor(float3 originalColor, Texture2D tex) +float3 GetDebugMipCountColor(float3 originalColor, TEXTURE2D_PARAM(tex, smp)) { - uint mipCount = GetMipCount(tex); + uint mipCount = GetMipCount(TEXTURE2D_ARGS(tex, smp)); float4 mipColor = GetSimpleMipCountColor(mipCount); return lerp(originalColor, mipColor.rgb, mipColor.a); } -float3 GetDebugStreamingMipColor(Texture2D tex, float4 mipInfo) +float3 GetDebugStreamingMipColor(TEXTURE2D_PARAM(tex, smp), float4 mipInfo) { - uint mipCount = GetMipCount(tex); + uint mipCount = GetMipCount(TEXTURE2D_ARGS(tex, smp)); return GetStreamingMipColor(mipCount, mipInfo).xyz; } -float3 GetDebugStreamingMipColorBlended(float3 originalColor, Texture2D tex, float4 mipInfo) +float3 GetDebugStreamingMipColorBlended(float3 originalColor, TEXTURE2D_PARAM(tex, smp), float4 mipInfo) { - uint mipCount = GetMipCount(tex); + uint mipCount = GetMipCount(TEXTURE2D_ARGS(tex, smp)); float4 mipColor = GetStreamingMipColor(mipCount, mipInfo); return lerp(originalColor, mipColor.rgb, mipColor.a); } -float3 GetDebugMipColorIncludingMipReduction(float3 originalColor, Texture2D tex, float4 texelSize, float2 uv, float4 mipInfo) +float3 GetDebugMipColorIncludingMipReduction(float3 originalColor, TEXTURE2D_PARAM(tex, smp), float4 texelSize, float2 uv, float4 mipInfo) { uint originalTextureMipCount = uint(mipInfo.y); if (originalTextureMipCount != 0) @@ -204,7 +204,7 @@ float3 GetDebugMipColorIncludingMipReduction(float3 originalColor, Texture2D tex // w = 0 // Mip count has been reduced but the texelSize was not updated to take that into account - uint mipCount = GetMipCount(tex); + uint mipCount = GetMipCount(TEXTURE2D_ARGS(tex, smp)); uint mipReductionLevel = originalTextureMipCount - mipCount; uint mipReductionFactor = 1 << mipReductionLevel; if (mipReductionFactor) @@ -214,7 +214,7 @@ float3 GetDebugMipColorIncludingMipReduction(float3 originalColor, Texture2D tex texelSize.zw *= oneOverMipReductionFactor; } } - return GetDebugMipColor(originalColor, tex, texelSize, uv); + return GetDebugMipColor(originalColor, texelSize, uv); } // mipInfo : @@ -222,7 +222,7 @@ float3 GetDebugMipColorIncludingMipReduction(float3 originalColor, Texture2D tex // y = original mip count for texture // z = desired on screen mip level // w = 0 -float3 GetDebugMipReductionColor(Texture2D tex, float4 mipInfo) +float3 GetDebugMipReductionColor(TEXTURE2D_PARAM(tex, smp), float4 mipInfo) { float3 outColor = float3(1.0, 0.0, 1.0); // Can't calculate without original mip count - return magenta @@ -230,7 +230,7 @@ float3 GetDebugMipReductionColor(Texture2D tex, float4 mipInfo) if (originalTextureMipCount != 0) { // Mip count has been reduced but the texelSize was not updated to take that into account - uint mipCount = GetMipCount(tex); + uint mipCount = GetMipCount(TEXTURE2D_ARGS(tex, smp)); uint mipReductionLevel = originalTextureMipCount - mipCount; float mipCol = float(mipReductionLevel) / 14.0;