diff --git a/Packages/com.unity.render-pipelines.core/Documentation~/Images/Preferences/PopUpAdvanced.png b/Packages/com.unity.render-pipelines.core/Documentation~/Images/Preferences/PopUpAdvanced.png index b26b2626580..afa3fface6b 100644 Binary files a/Packages/com.unity.render-pipelines.core/Documentation~/Images/Preferences/PopUpAdvanced.png and b/Packages/com.unity.render-pipelines.core/Documentation~/Images/Preferences/PopUpAdvanced.png differ diff --git a/Packages/com.unity.render-pipelines.core/Documentation~/TableOfContents.md b/Packages/com.unity.render-pipelines.core/Documentation~/TableOfContents.md index 97e576f1ccf..a027111c0af 100644 --- a/Packages/com.unity.render-pipelines.core/Documentation~/TableOfContents.md +++ b/Packages/com.unity.render-pipelines.core/Documentation~/TableOfContents.md @@ -36,6 +36,7 @@ * [Customize the UI of a setting](customize-ui-for-a-setting.md) * [Get custom graphics settings](get-custom-graphics-settings.md) * [Include or exclude a setting in your build](choose-whether-unity-includes-a-graphics-setting-in-your-build.md) + * [Advanced Properties](advanced-properties.md) * [Shaders](shaders.md) * [Use shader methods from the SRP Core shader library](built-in-shader-methods.md) * [Synchronizing shader code and C#](generating-shader-includes.md) diff --git a/Packages/com.unity.render-pipelines.core/Documentation~/advanced-properties.md b/Packages/com.unity.render-pipelines.core/Documentation~/advanced-properties.md index 7796caa848f..79fa09eb1b4 100644 --- a/Packages/com.unity.render-pipelines.core/Documentation~/advanced-properties.md +++ b/Packages/com.unity.render-pipelines.core/Documentation~/advanced-properties.md @@ -12,7 +12,7 @@ There is a global state per user that stores if Unity displays **advanced proper ## Exposing advanced properties within the inspector Not every component or Volume Override includes advanced properties. -If one does, it has a contextual menu to the right of each property section header that includes additional properties. To expose advanced properties for that section, open the contextual menu and click **Advanced Properties**. +If one does, it has a contextual menu to the right of each property section header that includes additional properties. To expose advanced properties for that section, open the contextual menu and click **Show All Advanced Properties**. For an example, refer to the **Water Surface** component in [High Definition Render Pipeline (HDRP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/settings-and-properties-related-to-the-water-system.html). @@ -20,7 +20,7 @@ By default only standard properties are shown. ![](Images/Preferences/HDRP_WaterSurface_General.png) -When you select **Advanced Properties**: +When you select **Show All Advanced Properties**: ![](Images/Preferences/PopUpAdvanced.png) @@ -28,13 +28,13 @@ When you select **Advanced Properties**: ![](Images/Preferences/HDRP_WaterSurface_General_Visible.png) -For Volume Overrides, the already existing contextual menu has a **Advanced Properties** toggle as well. +For Volume Overrides, the already existing contextual menu has a **Show All Advanced Properties** toggle as well. ## Exposing advanced properties on preferences You can also access to this global preference by: -1. Open the **Graphics** tab in the **Preferences** window (menu: **Edit > Preferences > Graphics**). -2. Under **Properties**. Set **Advanced Properties** to **All Visible**. +1. Open the **Graphics** tab in the **Preferences** window (menu: **Edit > Preferences**, macOS: **Unity > Settings**). +2. Under **Graphics**, select **Properties**. Set **Advanced Properties** to **All Visible**. ![](Images/Preferences/AdvancedProperties_Settings.png) diff --git a/Packages/com.unity.render-pipelines.core/Editor/AssemblyInfo.cs b/Packages/com.unity.render-pipelines.core/Editor/AssemblyInfo.cs index 7d31d8580e1..8b43a084d74 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/AssemblyInfo.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/AssemblyInfo.cs @@ -4,6 +4,5 @@ [assembly: InternalsVisibleTo("Unity.RenderPipelines.Core.Editor.Tests")] [assembly: InternalsVisibleTo("Unity.RenderPipelines.HighDefinition.Editor.Tests")] [assembly: InternalsVisibleTo("Unity.RenderPipelines.Universal.Editor.Tests")] -[assembly: InternalsVisibleTo("Unity.Testing.VisualEffectGraph.EditorTests")] [assembly: InternalsVisibleTo("Assembly-CSharp-Editor-testable")] diff --git a/Packages/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs b/Packages/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs index 67ae557bf26..6e59bc9894c 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs @@ -30,7 +30,7 @@ public int selectedPanel get => Mathf.Max(0, DebugManager.instance.PanelIndex(selectedPanelDisplayName)); set { - var displayName = DebugManager.instance.PanelDiplayName(value); + var displayName = DebugManager.instance.PanelDisplayName(value); if (!string.IsNullOrEmpty(displayName)) selectedPanelDisplayName = displayName; } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.RenderingLayers.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.RenderingLayers.cs index cbfa0cf25f2..79829a9883c 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.RenderingLayers.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.RenderingLayers.cs @@ -116,6 +116,9 @@ static AccelStructAdapter BuildAccelerationStructure() if (mesh == null) continue; + if (renderer.component is SkinnedMeshRenderer) + continue; + int subMeshCount = mesh.subMeshCount; var matIndices = new uint[subMeshCount]; Array.Fill(matIndices, renderer.component.renderingLayerMask); // repurpose the material id as we don't need it here diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.SkyOcclusion.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.SkyOcclusion.cs index 44f6a5b2615..3207aa7e536 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.SkyOcclusion.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.SkyOcclusion.cs @@ -213,6 +213,9 @@ static AccelStructAdapter BuildAccelerationStructure() if (!s_TracingContext.TryGetMeshForAccelerationStructure(renderer.component, out var mesh)) continue; + if (renderer.component is SkinnedMeshRenderer) + continue; + int subMeshCount = mesh.subMeshCount; var matIndices = GetMaterialIndices(renderer.component); var perSubMeshMask = new uint[subMeshCount]; diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs index aa6ac50f95b..5cc06919cfc 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.VirtualOffset.cs @@ -140,6 +140,9 @@ static AccelStructAdapter BuildAccelerationStructure(int mask) if (!s_TracingContext.TryGetMeshForAccelerationStructure(renderer.component, out var mesh)) continue; + if (renderer.component is SkinnedMeshRenderer) + continue; + int subMeshCount = mesh.subMeshCount; var maskAndMatDummy = new uint[subMeshCount]; System.Array.Fill(maskAndMatDummy, 0xFFFFFFFF); diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs index 0e00537cab2..a6621e271af 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs @@ -1162,6 +1162,21 @@ static void BakeDelegate(ref float progress, ref bool done) } } + // Required by native side. + [Scripting.Preserve] + static bool CurrentSceneHasBakedData() + { + if (!ProbeReferenceVolume.instance.isInitialized || !ProbeReferenceVolume.instance.enabledBySRP) + return false; + + string sceneGUID = SceneManager.GetActiveScene().GetGUID(); + ProbeReferenceVolume.instance.TryGetPerSceneData(sceneGUID, out var sceneData); + if (sceneData == null || sceneData.bakingSet == null) + return false; + + return sceneData.bakingSet.HasBeenBaked(); + } + static void FinalizeBake(bool cleanup = true) { using (new BakingCompleteProfiling(BakingCompleteProfiling.Stages.FinalizingBake)) diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeSubdivisionContext.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeSubdivisionContext.cs index cd804267330..f54e06a7637 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeSubdivisionContext.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeSubdivisionContext.cs @@ -77,11 +77,24 @@ IEnumerator Subdivide(bool showProgress) var ctx = AdaptiveProbeVolumes.PrepareProbeSubdivisionContext(perSceneDataList, true); var contributors = GIContributors.Find(GIContributors.ContributorFilter.All); + var cullCtx = new ProbeVolume.CellCullingContext + { + ActiveCamera = null, + FrustumPlanes = stackalloc Plane[6] + }; + ProbeVolume.PrepareCellCulling(ref cullCtx); + + var sceneToBakingSetMap = ProbeVolumeBakingSet.SceneToBakingSet.Instance; + var probeRefVol = ProbeReferenceVolume.instance; + // Cull all the cells that are not visible (we don't need them for realtime debug) - ctx.cells.RemoveAll(c => + for (int i = ctx.cells.Count - 1; i >= 0; i--) { - return probeVolume.ShouldCullCell(c.position); - }); + var cell = ctx.cells[i]; + bool shouldRemove = probeVolume.ShouldCullCell(cullCtx, sceneToBakingSetMap, probeRefVol, cell.position); + if (shouldRemove) + ctx.cells.RemoveAt(i); + } Camera activeCamera = Camera.current ?? SceneView.lastActiveSceneView.camera; diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeGizmos.cs b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeGizmos.cs new file mode 100644 index 00000000000..284417560ac --- /dev/null +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeGizmos.cs @@ -0,0 +1,210 @@ +using System.Collections.Generic; +using UnityEditor; + +namespace UnityEngine.Rendering +{ + internal static class ProbeVolumeGizmos + { + static MeshGizmo _brickMeshGizmo; + static MeshGizmo _cellMeshGizmo; + static double _lastDrawAt = 0; + + static readonly string _gizmoPath = "Packages/com.unity.render-pipelines.core/Editor/Resources/Gizmos"; + static readonly string _probeAdjustmentVolumeIconPath = _gizmoPath + "/ProbeTouchupVolume.png"; + static readonly string _probeVolumeIconPath = _gizmoPath + "/ProbeVolume.png"; + + static ProbeVolumeGizmos() + { + EditorApplication.update += Update; + } + + static void Update() + { + bool resourcesAllocated = _brickMeshGizmo != null || _cellMeshGizmo != null; + + if (resourcesAllocated) + { + bool shouldCleanUp = EditorApplication.timeSinceStartup - _lastDrawAt > 1.0; + if (shouldCleanUp) + { + _brickMeshGizmo?.Dispose(); + _brickMeshGizmo = null; + _cellMeshGizmo?.Dispose(); + _cellMeshGizmo = null; + } + } + } + + [DrawGizmo(GizmoType.Active | GizmoType.Selected | GizmoType.NonSelected)] + static void DrawProbeAdjustmentVolumes(ProbeAdjustmentVolume volume, GizmoType gizmoType) + { + Gizmos.DrawIcon(volume.transform.position, _probeAdjustmentVolumeIconPath, true); + } + + [DrawGizmo(GizmoType.Active | GizmoType.Selected | GizmoType.NonSelected)] + static void DrawProbeVolumeGizmos(ProbeVolume volume, GizmoType gizmoType) + { + _lastDrawAt = EditorApplication.timeSinceStartup; + + Gizmos.DrawIcon(volume.transform.position, _probeVolumeIconPath, true); + + var probeRefVolume = ProbeReferenceVolume.instance; + var sceneToBakingSetMap = ProbeVolumeBakingSet.SceneToBakingSet.Instance; + var allVolumes = ProbeVolume.instances; + + if (!probeRefVolume.isInitialized || allVolumes.Count == 0) + return; + + // Only the first PV of the available ones will draw gizmos. + if (allVolumes[0] != volume) + return; + + var debugDisplay = probeRefVolume.probeVolumeDebug; + + float minBrickSize = probeRefVolume.MinBrickSize(); + var cellSizeInMeters = probeRefVolume.MaxBrickSize(); + var probeOffset = probeRefVolume.ProbeOffset() + ProbeVolumeDebug.currentOffset; + if (debugDisplay.realtimeSubdivision) + { + var bakingSet = ProbeVolumeBakingSet.GetBakingSetForScene(volume.gameObject.scene); + if (bakingSet == null) + return; + + // Overwrite settings with data from profile + minBrickSize = ProbeVolumeBakingSet.GetMinBrickSize(bakingSet.minDistanceBetweenProbes); + cellSizeInMeters = ProbeVolumeBakingSet.GetCellSizeInBricks(bakingSet.simplificationLevels) * minBrickSize; + probeOffset = bakingSet.probeOffset; + } + + if (debugDisplay.drawBricks) + { + var subDivColors = probeRefVolume.subdivisionDebugColors; + + if (_brickMeshGizmo == null) + _brickMeshGizmo = new MeshGizmo((int)(Mathf.Pow(3, ProbeBrickIndex.kMaxSubdivisionLevels) * MeshGizmo.vertexCountPerCube)); + _brickMeshGizmo.Clear(); + + if (debugDisplay.realtimeSubdivision) + { + // realtime subdiv cells are already culled + foreach (var kp in probeRefVolume.realtimeSubdivisionInfo) + { + var cellVolume = kp.Key; + + foreach (var brick in kp.Value) + DrawAndAddBrick(_brickMeshGizmo, brick, minBrickSize, probeOffset, subDivColors); + } + } + else + { + var cullCtx = new ProbeVolume.CellCullingContext + { + ActiveCamera = null, + FrustumPlanes = stackalloc Plane[6] + }; + ProbeVolume.PrepareCellCulling(ref cullCtx); + + foreach (var cell in probeRefVolume.cells.Values) + { + if (!cell.loaded) + continue; + + if (volume.ShouldCullCell(cullCtx, sceneToBakingSetMap, probeRefVolume, cell.desc.position)) + continue; + + if (cell.data.bricks == null) + continue; + + foreach (var brick in cell.data.bricks) + DrawAndAddBrick(_brickMeshGizmo, brick, minBrickSize, probeOffset, subDivColors); + } + } + + _brickMeshGizmo.RenderWireframe(Matrix4x4.identity, gizmoName: "Brick Gizmo Rendering"); + } + + if (debugDisplay.drawCells) + { + Color s_LoadedColor = new Color(0, 1, 0.5f, 0.2f); + Color s_UnloadedColor = new Color(1, 0.0f, 0.0f, 0.2f); + Color s_StreamingColor = new Color(0.0f, 0.0f, 1.0f, 0.2f); + Color s_LowScoreColor = new Color(0, 0, 0, 0.2f); + Color s_HighScoreColor = new Color(1, 1, 0, 0.2f); + + var oldGizmoMatrix = Gizmos.matrix; + Gizmos.matrix = Matrix4x4.identity; + + if (_cellMeshGizmo == null) + _cellMeshGizmo = new MeshGizmo(); + _cellMeshGizmo.Clear(); + + float minStreamingScore = probeRefVolume.minStreamingScore; + float streamingScoreRange = probeRefVolume.maxStreamingScore - probeRefVolume.minStreamingScore; + + if (debugDisplay.realtimeSubdivision) + { + foreach (var kp in probeRefVolume.realtimeSubdivisionInfo) + { + DrawAndAddCell(_cellMeshGizmo, kp.Key.center, s_LoadedColor, cellSizeInMeters); + } + } + else + { + var cullCtx = new ProbeVolume.CellCullingContext + { + ActiveCamera = null, + FrustumPlanes = stackalloc Plane[6] + }; + ProbeVolume.PrepareCellCulling(ref cullCtx); + + foreach (var cell in probeRefVolume.cells.Values) + { + if (volume.ShouldCullCell(cullCtx, sceneToBakingSetMap, probeRefVolume, cell.desc.position)) + continue; + + Color color; + if (debugDisplay.displayCellStreamingScore) + { + float lerpFactor = (cell.streamingInfo.streamingScore - minStreamingScore) / streamingScoreRange; + color = Color.Lerp(s_HighScoreColor, s_LowScoreColor, lerpFactor); + } + else + { + if (cell.streamingInfo.IsStreaming()) + color = s_StreamingColor; + else + color = cell.loaded ? s_LoadedColor : s_UnloadedColor; + } + + var positionF = new Vector4(cell.desc.position.x, cell.desc.position.y, cell.desc.position.z, 0.0f); + var center = (Vector4)probeOffset + positionF * cellSizeInMeters + cellSizeInMeters * 0.5f * Vector4.one; + DrawAndAddCell(_cellMeshGizmo, center, color, cellSizeInMeters); + } + } + + _cellMeshGizmo.RenderWireframe(Gizmos.matrix, gizmoName: "Brick Gizmo Rendering"); + Gizmos.matrix = oldGizmoMatrix; + } + } + + static void DrawAndAddCell(MeshGizmo meshGizmo, Vector4 center, Color color, float cellSizeInMeters) + { + Gizmos.color = color; + Gizmos.DrawCube(center, Vector3.one * cellSizeInMeters); + var wireColor = color; + wireColor.a = 1.0f; + meshGizmo.AddWireCube(center, Vector3.one * cellSizeInMeters, wireColor); + } + + static void DrawAndAddBrick(MeshGizmo meshGizmo, ProbeBrickIndex.Brick brick, float minBrickSize, Vector3 probeOffset, Color[] subDivColors) + { + if (brick.subdivisionLevel < 0) + return; + + float brickSize = minBrickSize * ProbeReferenceVolume.CellSize(brick.subdivisionLevel); + Vector3 scaledSize = new Vector3(brickSize, brickSize, brickSize); + Vector3 scaledPos = probeOffset + new Vector3(brick.position.x * minBrickSize, brick.position.y * minBrickSize, brick.position.z * minBrickSize) + scaledSize / 2; + meshGizmo.AddWireCube(scaledPos, scaledSize, subDivColors[brick.subdivisionLevel]); + } + } +} diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeGizmos.cs.meta b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeGizmos.cs.meta new file mode 100644 index 00000000000..569399895c3 --- /dev/null +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeGizmos.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1d0eb70f099740d48a54003f68140928 +timeCreated: 1760362000 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.core/Editor/PostProcessing/LensFlareDataSRPEditor.cs b/Packages/com.unity.render-pipelines.core/Editor/PostProcessing/LensFlareDataSRPEditor.cs index e66fec42a6d..a1cebf48590 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/PostProcessing/LensFlareDataSRPEditor.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/PostProcessing/LensFlareDataSRPEditor.cs @@ -760,7 +760,7 @@ void DrawSummary(Rect summaryRect, SerializedProperty element, int index) { SerializedProperty lensFlareDataSRP = element.FindPropertyRelative("lensFlareDataSRP"); fieldRect.MoveNext(); - EditorGUI.PropertyField(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP); + DrawLensFlareDataSRPFieldWithCycleDetection(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP); EditorGUIUtility.labelWidth = oldLabelWidth; return; } @@ -918,7 +918,7 @@ void DrawTypeCathegory(ref Rect remainingRect, SerializedProperty element) { SerializedProperty lensFlareDataSRP = element.FindPropertyRelative("lensFlareDataSRP"); fieldRect.MoveNext(); - EditorGUI.PropertyField(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP); + DrawLensFlareDataSRPFieldWithCycleDetection(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP); } break; } @@ -1247,6 +1247,67 @@ T GetEnum(SerializedProperty property) void SetEnum(SerializedProperty property, T value) => property.intValue = (int)(object)value; + + void DrawLensFlareDataSRPFieldWithCycleDetection(Rect rect, SerializedProperty lensFlareDataSRPProperty, GUIContent label) + { + LensFlareDataSRP currentAsset = target as LensFlareDataSRP; + + EditorGUI.BeginChangeCheck(); + LensFlareDataSRP newValue = EditorGUI.ObjectField(rect, label, lensFlareDataSRPProperty.objectReferenceValue, typeof(LensFlareDataSRP), false) as LensFlareDataSRP; + + if (EditorGUI.EndChangeCheck()) + { + // Check for cycles before setting the value + bool wouldCreateCycle = false; + + if (newValue != null && currentAsset != null) + { + // Direct self-reference check + if (currentAsset == newValue) + { + wouldCreateCycle = true; + } + else + { + // Multi-level cycle check - see if newValue already references currentAsset + HashSet visited = new HashSet(); + + // Recursive function to check if targetAsset is found in asset's dependency chain + bool CheckCycle(LensFlareDataSRP asset, LensFlareDataSRP targetAsset) + { + if (asset == null || visited.Contains(asset)) + return false; + + visited.Add(asset); + + foreach (var element in asset.elements) + { + if (element.flareType == SRPLensFlareType.LensFlareDataSRP && element.lensFlareDataSRP != null) + { + if (element.lensFlareDataSRP == targetAsset || CheckCycle(element.lensFlareDataSRP, targetAsset)) + return true; + } + } + return false; + } + + wouldCreateCycle = CheckCycle(newValue, currentAsset); + } + } + + if (wouldCreateCycle) + { + // Cycle detected - set to null and show a warning + lensFlareDataSRPProperty.objectReferenceValue = null; + Debug.LogWarning($"Cannot assign lens flare asset '{newValue.name}' because it would create a cyclic dependency. Setting to null to prevent infinite loop."); + } + else + { + lensFlareDataSRPProperty.objectReferenceValue = newValue; + } + } + } + #endregion } } diff --git a/Packages/com.unity.render-pipelines.core/Editor/Properties/AdvancedProperties.cs b/Packages/com.unity.render-pipelines.core/Editor/Properties/AdvancedProperties.cs index 21d8361a651..68071da68bc 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Properties/AdvancedProperties.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/Properties/AdvancedProperties.cs @@ -75,14 +75,14 @@ public static bool enabled } /// - /// Adds an entry to toggle Advanced Properties + /// Adds an entry to toggle Advanced Properties global option. /// /// The menu where to add the Advanced Properties entry. /// If the option is checked /// The toggle action public static void AddAdvancedPropertiesBoolMenuItem(this GenericMenu menu, Func hasMoreOptions, Action toggleMoreOptions) { - menu.AddItem(EditorGUIUtility.TrTextContent("Advanced Properties"), hasMoreOptions.Invoke(), () => toggleMoreOptions.Invoke()); + menu.AddItem(EditorGUIUtility.TrTextContent("Show All Advanced Properties"), hasMoreOptions.Invoke(), () => toggleMoreOptions.Invoke()); } /// diff --git a/Packages/com.unity.render-pipelines.core/Runtime/CommandBuffers/BaseCommandBufer.cs b/Packages/com.unity.render-pipelines.core/Runtime/CommandBuffers/BaseCommandBufer.cs index 047f8da0945..510506316ff 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/CommandBuffers/BaseCommandBufer.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/CommandBuffers/BaseCommandBufer.cs @@ -63,7 +63,7 @@ protected internal void ThrowIfRasterNotAllowed() /// Throws an exception if the texture handle is not properly registered for the pass or being used incorrectly. /// [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - protected internal void ValidateTextureHandle(TextureHandle h) + protected internal void ValidateTextureHandle(in TextureHandle h) { if(RenderGraph.enableValidityChecks) { @@ -91,7 +91,7 @@ protected internal void ValidateTextureHandle(TextureHandle h) /// Throws an exception if the texture handle is either not registered as a readable resource or misused as both an attachment and a regular texture. /// [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - protected internal void ValidateTextureHandleRead(TextureHandle h) + protected internal void ValidateTextureHandleRead(in TextureHandle h) { if (RenderGraph.enableValidityChecks) { @@ -118,7 +118,7 @@ protected internal void ValidateTextureHandleRead(TextureHandle h) /// Throws an exception if the texture handle is not registered for writing, attempts to write to a built-in texture, or is misused as both a writeable resource and a render target attachment. /// [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - protected internal void ValidateTextureHandleWrite(TextureHandle h) + protected internal void ValidateTextureHandleWrite(in TextureHandle h) { if(RenderGraph.enableValidityChecks) { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugDisplaySettingsUI.cs b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugDisplaySettingsUI.cs index 2dbc44e203a..ba1c864a7c2 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugDisplaySettingsUI.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugDisplaySettingsUI.cs @@ -32,6 +32,10 @@ private void Reset() /// to be registered public void RegisterDebug(IDebugDisplaySettings settings) { +#if UNITY_EDITOR + if (UnityEditor.BuildPipeline.isBuildingPlayer) + return; +#endif DebugManager debugManager = DebugManager.instance; List panels = new List(); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs index b90eed0d6da..f519eb4d8fe 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs @@ -297,12 +297,24 @@ public int PanelIndex([DisallowNull] string displayName) return -1; } + + /// + /// Returns the panel display name + /// + /// The panelIndex for the panel to get the name + /// The display name of the panel, or empty string otherwise + [Obsolete("Method is obsolete. Use PanelDisplayName instead. #from(6000.4) (UnityUpgradable) -> PanelDisplayName", true)] + public string PanelDiplayName(int panelIndex) + { + return PanelDisplayName(panelIndex); + } + /// /// Returns the panel display name /// /// The panelIndex for the panel to get the name /// The display name of the panel, or empty string otherwise - public string PanelDiplayName([DisallowNull] int panelIndex) + public string PanelDisplayName(int panelIndex) { if (panelIndex < 0 || panelIndex > m_Panels.Count - 1) return string.Empty; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs index 2f732228409..2803b3dce0d 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs @@ -574,9 +574,7 @@ IEnumerable cameras if (camera.cameraType != CameraType.Preview && camera.cameraType != CameraType.Reflection) { - if (!camera.TryGetComponent(out var additionalData)) - Debug.LogWarning($"Camera {camera.name} does not contain an additional camera data component. Open the Game Object in the inspector to add additional camera data."); - else + if (camera.TryGetComponent(out _)) m_Cameras.Add(camera); } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs index d4909830936..fe63c5bd774 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceCuller.cs @@ -848,7 +848,7 @@ unsafe public void Execute() allocInfo.drawCount = outIndirectCommandIndex; allocInfo.instanceCount = outIndirectVisibleInstanceIndex; - int drawAllocCount = allocInfo.drawCount + IndirectBufferContextStorage.kExtraDrawAllocationCount; + int drawAllocCount = allocInfo.drawCount; int drawAllocEnd = Interlocked.Add(ref UnsafeUtility.AsRef(allocCounters + (int)IndirectAllocator.NextDrawIndex), drawAllocCount); allocInfo.drawAllocIndex = drawAllocEnd - drawAllocCount; @@ -1758,6 +1758,7 @@ private static class ShaderIDs public static readonly int InstanceOcclusionCullerShaderVariables = Shader.PropertyToID("InstanceOcclusionCullerShaderVariables"); public static readonly int _DrawInfo = Shader.PropertyToID("_DrawInfo"); public static readonly int _InstanceInfo = Shader.PropertyToID("_InstanceInfo"); + public static readonly int _DispatchArgs = Shader.PropertyToID("_DispatchArgs"); public static readonly int _DrawArgs = Shader.PropertyToID("_DrawArgs"); public static readonly int _InstanceIndices = Shader.PropertyToID("_InstanceIndices"); public static readonly int _InstanceDataBuffer = Shader.PropertyToID("_InstanceDataBuffer"); @@ -2091,7 +2092,7 @@ public unsafe JobHandle CreateCullJobTree( cullingOutput = cullingOutput.drawCommands, indirectBufferLimits = indirectBufferLimits, visibleInstancesBufferHandle = m_IndirectStorage.visibleInstanceBufferHandle, - indirectArgsBufferHandle = m_IndirectStorage.indirectArgsBufferHandle, + indirectArgsBufferHandle = m_IndirectStorage.indirectDrawArgsBufferHandle, indirectBufferAllocInfo = indirectBufferAllocInfo, indirectInstanceInfoGlobalArray = m_IndirectStorage.instanceInfoGlobalArray, indirectDrawInfoGlobalArray = m_IndirectStorage.drawInfoGlobalArray, @@ -2386,7 +2387,7 @@ internal void EnsureValidOcclusionTestResults(int viewInstanceID) int kernel = m_CopyInstancesKernel; cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, m_IndirectStorage.drawInfoBuffer); cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, m_IndirectStorage.instanceInfoBuffer); - cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, m_IndirectStorage.argsBuffer); + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, m_IndirectStorage.drawArgsBuffer); cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, m_IndirectStorage.instanceBuffer); cmd.DispatchCompute(cs, kernel, (allocInfo.instanceCount + 63) / 64, 1, 1); @@ -2539,10 +2540,10 @@ private void AddOcclusionCullingDispatch( if (doCopyInstances) { int kernel = m_CopyInstancesKernel; - cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, m_IndirectStorage.drawInfoBuffer); - cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, m_IndirectStorage.instanceInfoBuffer); - cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, m_IndirectStorage.argsBuffer); - cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, m_IndirectStorage.instanceBuffer); + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, bufferHandles.drawInfoBuffer); + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, bufferHandles.instanceInfoBuffer); + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.drawArgsBuffer); + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, bufferHandles.instanceBuffer); cmd.DispatchCompute(cs, kernel, (allocInfo.instanceCount + 63) / 64, 1, 1); } @@ -2551,7 +2552,10 @@ private void AddOcclusionCullingDispatch( { int kernel = m_ResetDrawArgsKernel; cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, bufferHandles.drawInfoBuffer); - cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.argsBuffer); + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.drawArgsBuffer); + if (isSecondPass) + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DispatchArgs, bufferHandles.dispatchArgsBuffer); + cmd.DispatchCompute(cs, kernel, (allocInfo.drawCount + 63) / 64, 1, 1); } @@ -2560,7 +2564,7 @@ private void AddOcclusionCullingDispatch( int kernel = m_CullInstancesKernel; cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawInfo, bufferHandles.drawInfoBuffer); cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceInfo, bufferHandles.instanceInfoBuffer); - cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.argsBuffer); + cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._DrawArgs, bufferHandles.drawArgsBuffer); cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceIndices, bufferHandles.instanceBuffer); cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._InstanceDataBuffer, batchersContext.gpuInstanceDataBuffer); cmd.SetComputeBufferParam(cs, kernel, ShaderIDs._OcclusionDebugCounters, m_OcclusionEventDebugArray.CounterBuffer); @@ -2572,7 +2576,7 @@ private void AddOcclusionCullingDispatch( OcclusionCullingCommon.SetDebugPyramid(cmd, m_OcclusionTestShader, kernel, occluderHandles); if (isSecondPass) - cmd.DispatchCompute(cs, kernel, bufferHandles.argsBuffer, (uint)(GraphicsBuffer.IndirectDrawIndexedArgs.size * allocInfo.GetExtraDrawInfoSlotIndex())); + cmd.DispatchCompute(cs, kernel, bufferHandles.dispatchArgsBuffer, 0); else cmd.DispatchCompute(cs, kernel, (allocInfo.instanceCount + 63) / 64, 1, 1); } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceOcclusionCuller.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceOcclusionCuller.cs index 66adf030165..06bdadb5b66 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceOcclusionCuller.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceOcclusionCuller.cs @@ -560,14 +560,16 @@ internal struct IndirectBufferContextHandles { public BufferHandle instanceBuffer; public BufferHandle instanceInfoBuffer; - public BufferHandle argsBuffer; + public BufferHandle dispatchArgsBuffer; + public BufferHandle drawArgsBuffer; public BufferHandle drawInfoBuffer; public void UseForOcclusionTest(IBaseRenderGraphBuilder builder) { instanceBuffer = builder.UseBuffer(instanceBuffer, AccessFlags.ReadWrite); instanceInfoBuffer = builder.UseBuffer(instanceInfoBuffer, AccessFlags.Read); - argsBuffer = builder.UseBuffer(argsBuffer, AccessFlags.ReadWrite); + dispatchArgsBuffer = builder.UseBuffer(dispatchArgsBuffer, AccessFlags.ReadWrite); + drawArgsBuffer = builder.UseBuffer(drawArgsBuffer, AccessFlags.ReadWrite); drawInfoBuffer = builder.UseBuffer(drawInfoBuffer, AccessFlags.Read); } } @@ -575,7 +577,6 @@ public void UseForOcclusionTest(IBaseRenderGraphBuilder builder) internal struct IndirectBufferContextStorage : IDisposable { private const int kAllocatorCount = (int)IndirectAllocator.Count; - internal const int kExtraDrawAllocationCount = 1; // over-allocate by one for indirect args scratch space GPU-side internal const int kInstanceInfoGpuOffsetMultiplier = 2; // GPU side allocates storage for extra copy of instance list private IndirectBufferLimits m_BufferLimits; @@ -584,7 +585,8 @@ internal struct IndirectBufferContextStorage : IDisposable private GraphicsBuffer m_InstanceInfoBuffer; private NativeArray m_InstanceInfoStaging; - private GraphicsBuffer m_ArgsBuffer; + private GraphicsBuffer m_DispatchArgsBuffer; + private GraphicsBuffer m_DrawArgsBuffer; private GraphicsBuffer m_DrawInfoBuffer; private NativeArray m_DrawInfoStaging; @@ -596,11 +598,12 @@ internal struct IndirectBufferContextStorage : IDisposable public GraphicsBuffer instanceBuffer { get { return m_InstanceBuffer; } } public GraphicsBuffer instanceInfoBuffer { get { return m_InstanceInfoBuffer; } } - public GraphicsBuffer argsBuffer { get { return m_ArgsBuffer; } } + public GraphicsBuffer dispatchArgsBuffer { get { return m_DispatchArgsBuffer; } } + public GraphicsBuffer drawArgsBuffer { get { return m_DrawArgsBuffer; } } public GraphicsBuffer drawInfoBuffer { get { return m_DrawInfoBuffer; } } public GraphicsBufferHandle visibleInstanceBufferHandle { get { return m_InstanceBuffer.bufferHandle; } } - public GraphicsBufferHandle indirectArgsBufferHandle { get { return m_ArgsBuffer.bufferHandle; } } + public GraphicsBufferHandle indirectDrawArgsBufferHandle { get { return m_DrawArgsBuffer.bufferHandle; } } public IndirectBufferContextHandles ImportBuffers(RenderGraph renderGraph) { @@ -608,7 +611,8 @@ public IndirectBufferContextHandles ImportBuffers(RenderGraph renderGraph) { instanceBuffer = renderGraph.ImportBuffer(m_InstanceBuffer), instanceInfoBuffer = renderGraph.ImportBuffer(m_InstanceInfoBuffer), - argsBuffer = renderGraph.ImportBuffer(m_ArgsBuffer), + dispatchArgsBuffer = renderGraph.ImportBuffer(m_DispatchArgsBuffer), + drawArgsBuffer = renderGraph.ImportBuffer(m_DrawArgsBuffer), drawInfoBuffer = renderGraph.ImportBuffer(m_DrawInfoBuffer), }; } @@ -653,7 +657,9 @@ void FreeInstanceBuffers() void AllocateDrawBuffers(int maxDrawCount) { - m_ArgsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured | GraphicsBuffer.Target.IndirectArguments, (maxDrawCount + kExtraDrawAllocationCount) * (GraphicsBuffer.IndirectDrawIndexedArgs.size / sizeof(int)), sizeof(int)); + // Compute dispatch arguments are number of thread groups in X,Y and Z dimensions, hence 3 integers for the size. + m_DispatchArgsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured | GraphicsBuffer.Target.IndirectArguments, 3, sizeof(int)); + m_DrawArgsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured | GraphicsBuffer.Target.IndirectArguments, maxDrawCount * (GraphicsBuffer.IndirectDrawIndexedArgs.size / sizeof(int)), sizeof(int)); m_DrawInfoBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured, maxDrawCount, System.Runtime.InteropServices.Marshal.SizeOf()); m_DrawInfoStaging = new NativeArray(maxDrawCount, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); m_BufferLimits.maxDrawCount = maxDrawCount; @@ -661,7 +667,8 @@ void AllocateDrawBuffers(int maxDrawCount) void FreeDrawBuffers() { - m_ArgsBuffer.Release(); + m_DispatchArgsBuffer.Release(); + m_DrawArgsBuffer.Release(); m_DrawInfoBuffer.Release(); m_DrawInfoStaging.Dispose(); m_BufferLimits.maxDrawCount = 0; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs index 97a6a836071..c760fca8509 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/OcclusionCullingCommon.cs @@ -261,7 +261,7 @@ private class OcclusionTestOverlayPassData public BufferHandle debugPyramid; } - public void RenderDebugOcclusionTestOverlay(RenderGraph renderGraph, DebugDisplayGPUResidentDrawer debugSettings, int viewInstanceID, TextureHandle colorBuffer) + public void RenderDebugOcclusionTestOverlay(RenderGraph renderGraph, DebugDisplayGPUResidentDrawer debugSettings, int viewInstanceID, in TextureHandle colorBuffer) { if (debugSettings == null) return; @@ -328,7 +328,7 @@ class OccluderOverlayPassData public Vector2 validRange; } - public void RenderDebugOccluderOverlay(RenderGraph renderGraph, DebugDisplayGPUResidentDrawer debugSettings, Vector2 screenPos, float maxHeight, TextureHandle colorBuffer) + public void RenderDebugOccluderOverlay(RenderGraph renderGraph, DebugDisplayGPUResidentDrawer debugSettings, Vector2 screenPos, float maxHeight, in TextureHandle colorBuffer) { if (debugSettings == null) return; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeAdjustmentVolume.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeAdjustmentVolume.cs index 503baeee8ab..72f08c797de 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeAdjustmentVolume.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeAdjustmentVolume.cs @@ -227,11 +227,6 @@ internal Vector3 GetVirtualOffset() return Vector3.zero; return (transform.rotation * Quaternion.Euler(virtualOffsetRotation) * Vector3.forward) * virtualOffsetDistance; } - - void OnDrawGizmos() - { - Gizmos.DrawIcon(transform.position, ProbeVolume.s_gizmosLocationPath + "ProbeTouchupVolume.png", true); - } #endif // Migration related stuff @@ -259,7 +254,7 @@ void ISerializationCallbackReceiver.OnAfterDeserialize() { if (version == Version.Count) // deserializing and object without version version = Version.Initial; // reset to run the migration - + if (version < Version.Mode) { #pragma warning disable 618 // Type or member is obsolete diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs index 48e07b5e055..faef35fbfc0 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs @@ -1059,7 +1059,6 @@ public void Initialize(in ProbeVolumeSystemParameters parameters) #if UNITY_EDITOR UnityEditor.SceneManagement.EditorSceneManager.sceneSaving += ProbeVolumeBakingSet.OnSceneSaving; - ProbeVolumeBakingSet.SyncBakingSets(); #endif m_EnabledBySRP = true; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.cs index a6a719f22d1..402319fb0f8 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using UnityEngine.SceneManagement; @@ -178,24 +179,8 @@ internal void GetSubdivisionOverride(int maxSubdivisionLevel, out int minLevel, } } - // Momentarily moving the gizmo rendering for bricks and cells to Probe Volume itself, - // only the first probe volume in the scene will render them. The reason is that we dont have any - // other non-hidden component related to APV. - #region APVGizmo - internal static List instances = new(); - MeshGizmo brickGizmos; - MeshGizmo cellGizmo; - - void DisposeGizmos() - { - brickGizmos?.Dispose(); - brickGizmos = null; - cellGizmo?.Dispose(); - cellGizmo = null; - } - void OnEnable() { instances.Add(this); @@ -204,20 +189,34 @@ void OnEnable() void OnDisable() { instances.Remove(this); - DisposeGizmos(); } - // Only the first PV of the available ones will draw gizmos. - bool IsResponsibleToDrawGizmo() => instances.Count > 0 && instances[0] == this; + internal ref struct CellCullingContext + { + public Camera ActiveCamera; + public Span FrustumPlanes; + } + + internal static void PrepareCellCulling(ref CellCullingContext ctx) + { + ctx.ActiveCamera = Camera.current; +#if UNITY_EDITOR + if (ctx.ActiveCamera == null) + ctx.ActiveCamera = UnityEditor.SceneView.lastActiveSceneView.camera; +#endif - internal bool ShouldCullCell(Vector3 cellPosition) + Debug.Assert(ctx.FrustumPlanes.Length == 6); + GeometryUtility.CalculateFrustumPlanes(ctx.ActiveCamera, ctx.FrustumPlanes); + } + + internal bool ShouldCullCell(in CellCullingContext ctx, Dictionary sceneToBakingSetMap, ProbeReferenceVolume probeRefVolume, Vector3 cellPosition) { - var cellSizeInMeters = ProbeReferenceVolume.instance.MaxBrickSize(); - var probeOffset = ProbeReferenceVolume.instance.ProbeOffset() + ProbeVolumeDebug.currentOffset; - var debugDisplay = ProbeReferenceVolume.instance.probeVolumeDebug; + var cellSizeInMeters = probeRefVolume.MaxBrickSize(); + var probeOffset = probeRefVolume.ProbeOffset() + ProbeVolumeDebug.currentOffset; + var debugDisplay = probeRefVolume.probeVolumeDebug; if (debugDisplay.realtimeSubdivision) { - var bakingSet = ProbeVolumeBakingSet.GetBakingSetForScene(gameObject.scene); + var bakingSet = ProbeVolumeBakingSet.GetBakingSetForScene(sceneToBakingSetMap, gameObject.scene.GetGUID()); if (bakingSet == null) return true; @@ -225,193 +224,24 @@ internal bool ShouldCullCell(Vector3 cellPosition) cellSizeInMeters = ProbeVolumeBakingSet.GetMinBrickSize(bakingSet.minDistanceBetweenProbes) * ProbeVolumeBakingSet.GetCellSizeInBricks(bakingSet.simplificationLevels); probeOffset = bakingSet.probeOffset + ProbeVolumeDebug.currentOffset; } - Camera activeCamera = Camera.current; -#if UNITY_EDITOR - if (activeCamera == null) - activeCamera = UnityEditor.SceneView.lastActiveSceneView.camera; -#endif - if (activeCamera == null) + if (ctx.ActiveCamera == null) return true; - var cameraTransform = activeCamera.transform; + var cameraTransform = ctx.ActiveCamera.transform; Vector3 cellCenterWS = probeOffset + cellPosition * cellSizeInMeters + Vector3.one * (cellSizeInMeters / 2.0f); // Round down to cell size distance float roundedDownDist = Mathf.Floor(Vector3.Distance(cameraTransform.position, cellCenterWS) / cellSizeInMeters) * cellSizeInMeters; - if (roundedDownDist > ProbeReferenceVolume.instance.probeVolumeDebug.subdivisionViewCullingDistance) + if (roundedDownDist > probeRefVolume.probeVolumeDebug.subdivisionViewCullingDistance) return true; - var frustumPlanes = GeometryUtility.CalculateFrustumPlanes(activeCamera); var volumeAABB = new Bounds(cellCenterWS, cellSizeInMeters * Vector3.one); - return !GeometryUtility.TestPlanesAABB(frustumPlanes, volumeAABB); + return !GeometryUtility.TestPlanesAABB(ctx.FrustumPlanes, volumeAABB); } - - - struct CellDebugData - { - public Vector4 center; - public Color color; - } - - // Path to the gizmos location - internal readonly static string s_gizmosLocationPath = "Packages/com.unity.render-pipelines.core/Editor/Resources/Gizmos/"; - - // TODO: We need to get rid of Handles.DrawWireCube to be able to have those at runtime as well. - void OnDrawGizmos() - { - Gizmos.DrawIcon(transform.position, s_gizmosLocationPath + "ProbeVolume.png", true); - - if (!ProbeReferenceVolume.instance.isInitialized || !IsResponsibleToDrawGizmo()) - return; - - var debugDisplay = ProbeReferenceVolume.instance.probeVolumeDebug; - - float minBrickSize = ProbeReferenceVolume.instance.MinBrickSize(); - var cellSizeInMeters = ProbeReferenceVolume.instance.MaxBrickSize(); - var probeOffset = ProbeReferenceVolume.instance.ProbeOffset() + ProbeVolumeDebug.currentOffset; - if (debugDisplay.realtimeSubdivision) - { - var bakingSet = ProbeVolumeBakingSet.GetBakingSetForScene(gameObject.scene); - if (bakingSet == null) - return; - - // Overwrite settings with data from profile - minBrickSize = ProbeVolumeBakingSet.GetMinBrickSize(bakingSet.minDistanceBetweenProbes); - cellSizeInMeters = ProbeVolumeBakingSet.GetCellSizeInBricks(bakingSet.simplificationLevels) * minBrickSize; - probeOffset = bakingSet.probeOffset; - } - - if (debugDisplay.drawBricks) - { - var subdivColors = ProbeReferenceVolume.instance.subdivisionDebugColors; - - IEnumerable GetVisibleBricks() - { - if (debugDisplay.realtimeSubdivision) - { - // realtime subdiv cells are already culled - foreach (var kp in ProbeReferenceVolume.instance.realtimeSubdivisionInfo) - { - var cellVolume = kp.Key; - - foreach (var brick in kp.Value) - { - yield return brick; - } - } - } - else - { - foreach (var cell in ProbeReferenceVolume.instance.cells.Values) - { - if (!cell.loaded) - continue; - - if (ShouldCullCell(cell.desc.position)) - continue; - - if (cell.data.bricks == null) - continue; - - foreach (var brick in cell.data.bricks) - yield return brick; - } - } - } - - if (brickGizmos == null) - brickGizmos = new MeshGizmo((int)(Mathf.Pow(3, ProbeBrickIndex.kMaxSubdivisionLevels) * MeshGizmo.vertexCountPerCube)); - - brickGizmos.Clear(); - foreach (var brick in GetVisibleBricks()) - { - if (brick.subdivisionLevel < 0) - continue; - - float brickSize = minBrickSize * ProbeReferenceVolume.CellSize(brick.subdivisionLevel); - Vector3 scaledSize = new Vector3(brickSize, brickSize, brickSize); - Vector3 scaledPos = probeOffset + new Vector3(brick.position.x * minBrickSize, brick.position.y * minBrickSize, brick.position.z * minBrickSize) + scaledSize / 2; - brickGizmos.AddWireCube(scaledPos, scaledSize, subdivColors[brick.subdivisionLevel]); - } - - brickGizmos.RenderWireframe(Matrix4x4.identity, gizmoName: "Brick Gizmo Rendering"); - } - - if (debugDisplay.drawCells) - { - IEnumerable GetVisibleCellDebugData() - { - Color s_LoadedColor = new Color(0, 1, 0.5f, 0.2f); - Color s_UnloadedColor = new Color(1, 0.0f, 0.0f, 0.2f); - Color s_StreamingColor = new Color(0.0f, 0.0f, 1.0f, 0.2f); - Color s_LowScoreColor = new Color(0, 0, 0, 0.2f); - Color s_HighScoreColor = new Color(1, 1, 0, 0.2f); - - var prv = ProbeReferenceVolume.instance; - - float minStreamingScore = prv.minStreamingScore; - float streamingScoreRange = prv.maxStreamingScore - prv.minStreamingScore; - - if (debugDisplay.realtimeSubdivision) - { - foreach (var kp in prv.realtimeSubdivisionInfo) - { - var center = kp.Key.center; - yield return new CellDebugData { center = center, color = s_LoadedColor }; - } - } - else - { - foreach (var cell in ProbeReferenceVolume.instance.cells.Values) - { - if (ShouldCullCell(cell.desc.position)) - continue; - - var positionF = new Vector4(cell.desc.position.x, cell.desc.position.y, cell.desc.position.z, 0.0f); - var output = new CellDebugData(); - output.center = (Vector4)probeOffset + positionF * cellSizeInMeters + cellSizeInMeters * 0.5f * Vector4.one; - if (debugDisplay.displayCellStreamingScore) - { - float lerpFactor = (cell.streamingInfo.streamingScore - minStreamingScore) / streamingScoreRange; - output.color = Color.Lerp(s_HighScoreColor, s_LowScoreColor, lerpFactor); - } - else - { - if (cell.streamingInfo.IsStreaming()) - output.color = s_StreamingColor; - else - output.color = cell.loaded ? s_LoadedColor : s_UnloadedColor; - } - yield return output; - } - } - } - - var oldGizmoMatrix = Gizmos.matrix; - - if (cellGizmo == null) - cellGizmo = new MeshGizmo(); - cellGizmo.Clear(); - foreach (var cell in GetVisibleCellDebugData()) - { - Gizmos.color = cell.color; - Gizmos.matrix = Matrix4x4.identity; - - Gizmos.DrawCube(cell.center, Vector3.one * cellSizeInMeters); - var wireColor = cell.color; - wireColor.a = 1.0f; - cellGizmo.AddWireCube(cell.center, Vector3.one * cellSizeInMeters, wireColor); - } - cellGizmo.RenderWireframe(Gizmos.matrix, gizmoName: "Brick Gizmo Rendering"); - Gizmos.matrix = oldGizmoMatrix; - } - } - #endregion - #endif // UNITY_EDITOR } } // UnityEngine.Rendering.HDPipeline diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl index 58292d06a54..065960fa325 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl @@ -911,18 +911,24 @@ void EvaluateAdaptiveProbeVolume(in float3 posWS, in float3 normalWS, in float3 void EvaluateAdaptiveProbeVolume(in float3 posWS, in float2 positionSS, out float3 bakeDiffuseLighting) { APVResources apvRes = FillAPVResources(); - posWS = AddNoiseToSamplingPosition(posWS, positionSS, 1); posWS -= _APVWorldOffset; + float3 ambientProbe = EvaluateAmbientProbe(0); + float3 uvw; if (TryToGetPoolUVW(apvRes, posWS, 0, 0, uvw)) { bakeDiffuseLighting = SAMPLE_TEXTURE3D_LOD(apvRes.L0_L1Rx, s_linear_clamp_sampler, uvw, 0).rgb; + if (_APVSkyOcclusionWeight > 0) + { + float skyOcclusionL0 = kSHBasis0 * SAMPLE_TEXTURE3D_LOD(apvRes.SkyOcclusionL0L1, s_linear_clamp_sampler, uvw, 0).x; + bakeDiffuseLighting += ambientProbe * skyOcclusionL0; + } } else { - bakeDiffuseLighting = EvaluateAmbientProbe(0); + bakeDiffuseLighting = ambientProbe; } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.Editor.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.Editor.cs index 249a1ea2ba7..a8534637637 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.Editor.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.Editor.cs @@ -20,9 +20,24 @@ internal class SceneBakeData public Bounds bounds = new(); } + internal class SceneToBakingSet + { + static Dictionary sceneToBakingSet = null; + + internal static Dictionary Instance + { + get + { + if (sceneToBakingSet == null) + sceneToBakingSet = ProbeVolumeBakingSet.SyncBakingSets(); + + return sceneToBakingSet; + } + } + } + [SerializeField] SerializedDictionary m_SceneBakeData = new(); - internal static Dictionary sceneToBakingSet = new Dictionary(); /// /// Tries to add a scene to the baking set. @@ -42,7 +57,8 @@ internal void AddScene(string guid, SceneBakeData bakeData = null) { m_SceneGUIDs.Add(guid); m_SceneBakeData.Add(guid, bakeData != null ? bakeData : new SceneBakeData()); - sceneToBakingSet[guid] = new ProbeVolumeBakingSetWeakReference(this); + + SceneToBakingSet.Instance[guid] = new ProbeVolumeBakingSetWeakReference(this); EditorUtility.SetDirty(this); } @@ -55,7 +71,8 @@ public void RemoveScene(string guid) { m_SceneGUIDs.Remove(guid); m_SceneBakeData.Remove(guid); - sceneToBakingSet.Remove(guid); + + SceneToBakingSet.Instance.Remove(guid); EditorUtility.SetDirty(this); } @@ -64,8 +81,10 @@ internal void SetScene(string guid, int index, SceneBakeData bakeData = null) { var previousSceneGUID = m_SceneGUIDs[index]; m_SceneGUIDs[index] = guid; - sceneToBakingSet.Remove(previousSceneGUID); - sceneToBakingSet[guid] = new ProbeVolumeBakingSetWeakReference(this); + + SceneToBakingSet.Instance.Remove(previousSceneGUID); + SceneToBakingSet.Instance[guid] = new ProbeVolumeBakingSetWeakReference(this); + m_SceneBakeData.Add(guid, bakeData != null ? bakeData : new SceneBakeData()); EditorUtility.SetDirty(this); @@ -289,9 +308,9 @@ public string RenameScenario(string scenario, string newName) return newName; } - internal static void SyncBakingSets() + internal static Dictionary SyncBakingSets() { - sceneToBakingSet = new Dictionary(); + Dictionary sceneToBakingSet = new Dictionary(); var setGUIDs = AssetDatabase.FindAssets("t:" + nameof(ProbeVolumeBakingSet)); @@ -316,9 +335,12 @@ internal static void SyncBakingSets() reference.Unload(); } } + + return sceneToBakingSet; } - internal static ProbeVolumeBakingSet GetBakingSetForScene(string sceneGUID) => sceneToBakingSet.GetValueOrDefault(sceneGUID, null)?.Get(); + internal static ProbeVolumeBakingSet GetBakingSetForScene(Dictionary mapping, string sceneGUID) { return mapping.GetValueOrDefault(sceneGUID, null)?.Get(); } + internal static ProbeVolumeBakingSet GetBakingSetForScene(string sceneGUID) { return SceneToBakingSet.Instance.GetValueOrDefault(sceneGUID, null)?.Get(); } internal static ProbeVolumeBakingSet GetBakingSetForScene(Scene scene) => GetBakingSetForScene(scene.GetGUID()); internal void SetDefaults() diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.cs b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.cs index fb80883c6bd..ff5e52958b4 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingSet.cs @@ -26,6 +26,7 @@ public LogarithmicAttribute(int min, int max) /// /// An Asset which holds a set of settings to use with a . /// + [CoreRPHelpURL("probevolumes-usebakingsets", "com.unity.render-pipelines.high-definition")] public sealed partial class ProbeVolumeBakingSet : ScriptableObject, ISerializationCallbackReceiver { internal enum Version diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/CompilerContextData.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/CompilerContextData.cs index 0a008a7005b..49b0d721fbf 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/CompilerContextData.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/CompilerContextData.cs @@ -61,6 +61,7 @@ void AllocateNativeDataStructuresIfNeeded(int estimatedNumPasses) inputData = new NativeList(estimatedNumPasses * 2, AllocatorManager.Persistent); outputData = new NativeList(estimatedNumPasses * 2, AllocatorManager.Persistent); fragmentData = new NativeList(estimatedNumPasses * 4, AllocatorManager.Persistent); + sampledData = new NativeList(estimatedNumPasses * 2, AllocatorManager.Persistent); randomAccessResourceData = new NativeList(4, AllocatorManager.Persistent); // We assume not a lot of passes use random write nativePassData = new NativeList(estimatedNumPasses, AllocatorManager.Persistent);// assume nothing gets merged nativeSubPassData = new NativeList(estimatedNumPasses, AllocatorManager.Persistent);// there should "never" be more subpasses than graph passes @@ -90,6 +91,7 @@ public void Clear() inputData.Clear(); outputData.Clear(); fragmentData.Clear(); + sampledData.Clear(); randomAccessResourceData.Clear(); nativePassData.Clear(); nativeSubPassData.Clear(); @@ -101,20 +103,20 @@ public void Clear() public ResourcesData resources; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref ResourceUnversionedData UnversionedResourceData(ResourceHandle h) + public ref ResourceUnversionedData UnversionedResourceData(in ResourceHandle h) { return ref resources.unversionedData[h.iType].ElementAt(h.index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref ResourceVersionedData VersionedResourceData(ResourceHandle h) + public ref ResourceVersionedData VersionedResourceData(in ResourceHandle h) { return ref resources[h]; } // Iterate over all the readers of a particular resource [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ReadOnlySpan Readers(ResourceHandle h) + public ReadOnlySpan Readers(in ResourceHandle h) { int firstReader = resources.IndexReader(h, 0); int numReaders = resources[h].numReaders; @@ -123,7 +125,7 @@ public ReadOnlySpan Readers(ResourceHandle h) // Get the i'th reader of a resource [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref ResourceReaderData ResourceReader(ResourceHandle h, int i) + public ref ResourceReaderData ResourceReader(in ResourceHandle h, int i) { int numReaders = resources[h].numReaders; #if DEVELOPMENT_BUILD || UNITY_EDITOR @@ -144,6 +146,7 @@ public ref ResourceReaderData ResourceReader(ResourceHandle h, int i) public NativeList inputData; public NativeList outputData; public NativeList fragmentData; + public NativeList sampledData; public NativeList createData; public NativeList destroyData; public NativeList randomAccessResourceData; @@ -153,7 +156,7 @@ public ref ResourceReaderData ResourceReader(ResourceHandle h, int i) public NativeList nativeSubPassData; //Tighty packed list of per nrp subpasses // resources can be added as fragment both as input and output so make sure not to add them twice (return true upon new addition) - public bool TryAddToFragmentList(TextureAccess access, int listFirstIndex, int numItems, out string errorMessage) + public bool TryAddToFragmentList(in TextureAccess access, int listFirstIndex, int numItems, out string errorMessage) { errorMessage = null; #if DEVELOPMENT_BUILD || UNITY_EDITOR @@ -200,13 +203,13 @@ public bool TryAddToFragmentList(TextureAccess access, int listFirstIndex, int n public string GetPassName(int passId) => passNames[passId].name; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public string GetResourceName(ResourceHandle h) => resources.resourceNames[h.iType][h.index].name; + public string GetResourceName(in ResourceHandle h) => resources.resourceNames[h.iType][h.index].name; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public string GetResourceVersionedName(ResourceHandle h) => GetResourceName(h) + " V" + h.version; + public string GetResourceVersionedName(in ResourceHandle h) => GetResourceName(h) + " V" + h.version; // resources can be added as fragment both as input and output so make sure not to add them twice (return true upon new addition) - public bool TryAddToRandomAccessResourceList(ResourceHandle h, int randomWriteSlotIndex, bool preserveCounterValue, int listFirstIndex, int numItems, out string errorMessage) + public bool TryAddToRandomAccessResourceList(in ResourceHandle h, int randomWriteSlotIndex, bool preserveCounterValue, int listFirstIndex, int numItems, out string errorMessage) { errorMessage = null; for (var i = listFirstIndex; i < listFirstIndex + numItems; ++i) @@ -260,6 +263,46 @@ public TextureUVOrigin GetTextureUVOrigin(in TextureHandle targetHandle) } } + #region Helpers For Testing Only + + // Helper to loop over render graph passes + public ref struct PassIterator + { + readonly CompilerContextData m_Ctx; + int m_Index; + + public PassIterator(CompilerContextData ctx) + { + m_Ctx = ctx; + m_Index = -1; + } + + public ref readonly PassData Current => ref m_Ctx.passData.ElementAt(m_Index); + + public bool MoveNext() + { + return ++m_Index < m_Ctx.passData.Length; + } + + public PassIterator GetEnumerator() + { + return this; + } + } + + public PassIterator Passes => new PassIterator(this); + + // Use for testing only + internal List GetPasses() + { + var result = new List(); + foreach (ref readonly var pass in Passes) + { + result.Add(pass); + } + return result; + } + // Helper to loop over native passes public ref struct NativePassIterator { @@ -295,7 +338,6 @@ public NativePassIterator GetEnumerator() // the list may contain empty dummy entries after merging public NativePassIterator NativePasses => new NativePassIterator(this); - // Use for testing only internal List GetNativePasses() { @@ -306,6 +348,7 @@ internal List GetNativePasses() } return result; } + #endregion // IDisposable implementation @@ -329,6 +372,7 @@ void Cleanup() inputData.Dispose(); outputData.Dispose(); fragmentData.Dispose(); + sampledData.Dispose(); createData.Dispose(); destroyData.Dispose(); randomAccessResourceData.Dispose(); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs index f700f43386c..6c6e6726b60 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.Debug.cs @@ -55,7 +55,7 @@ internal static string MakePassBreakInfoMessage(CompilerContextData ctx, in Nati return msg; } - internal static string MakePassMergeMessage(CompilerContextData ctx, in PassData pass, in PassData prevPass, PassBreakAudit mergeResult) + internal static string MakePassMergeMessage(CompilerContextData ctx, in PassData pass, in PassData prevPass, in PassBreakAudit mergeResult) { string message = mergeResult.reason == PassBreakReason.Merged ? "The passes are compatible to be merged.\n\n" : @@ -276,8 +276,8 @@ internal void GenerateNativeCompilerDebugData(ref RenderGraph.DebugData debugDat debugPass.scriptInfo = graphPass.debugScriptInfo; #endif - debugPass.syncFromPassIndex = -1; // TODO async compute support - debugPass.syncToPassIndex = -1; // TODO async compute support + debugPass.syncFromPassIndex = passData.awaitingMyGraphicsFencePassId; + debugPass.syncToPassIndex = passData.waitOnGraphicsFencePassId; debugPass.nrpInfo = new RenderGraph.DebugData.PassData.NRPInfo(); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs index 9cb98202609..b42afccbc25 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/NativePassCompiler.cs @@ -1,6 +1,6 @@ using System; -using System.Diagnostics; using System.Collections.Generic; +using System.Diagnostics; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; @@ -24,6 +24,7 @@ internal struct RenderGraphInputInfo internal CommandBuffer previousCommandBuffer; Stack m_HasSideEffectPassIdCullingStack; List> m_UnusedVersionedResourceIdCullingStacks; + Dictionary> m_DelayedLastUseListPerPassMap; RenderGraphCompilationCache m_CompilationCache; @@ -46,6 +47,10 @@ public NativePassCompiler(RenderGraphCompilationCache cache) for (int type = 0; type < (int)RenderGraphResourceType.Count; ++type) m_UnusedVersionedResourceIdCullingStacks.Add(new Stack()); + m_DelayedLastUseListPerPassMap = new Dictionary>(k_EstimatedPassCount); + for (int passId = 0; passId < k_EstimatedPassCount; ++passId) + m_DelayedLastUseListPerPassMap.Add(passId, new List()); + m_TempMRTArrays = new RenderTargetIdentifier[RenderGraph.kMaxMRTCount][]; for (int i = 0; i < RenderGraph.kMaxMRTCount; ++i) m_TempMRTArrays[i] = new RenderTargetIdentifier[i + 1]; @@ -142,7 +147,7 @@ public void Compile(RenderGraphResourceRegistry resources) HandleExtendedFeatureFlags(); - FindResourceUsageRanges(); + FindResourceUsageRangeAndSynchronization(); DetectMemoryLessResources(); @@ -161,6 +166,11 @@ public void Clear(bool clearContextData) for (int type = 0; type < (int)RenderGraphResourceType.Count; ++type) m_UnusedVersionedResourceIdCullingStacks[type].Clear(); + + foreach (var resListPerPassId in m_DelayedLastUseListPerPassMap) + resListPerPassId.Value.Clear(); + + m_DelayedLastUseListPerPassMap.Clear(); } void SetPassStatesForNativePass(int nativePassId) @@ -436,6 +446,22 @@ void BuildGraph() ctxPass.numOutputs++; } + + // For raster passes, we do an extra step to monitor textures sampled in the pass + // It can be a breaking change reason later on when building a native render pass + if (type == (int)RenderGraphResourceType.Texture && ctxPass.type == RenderGraphPassType.Raster) + { + ctxPass.firstSampledOnlyRaster = ctx.sampledData.Length; + foreach (ref readonly var input in ctxPass.Inputs(ctx)) + { + // Check if this input is the shading rate image + if (!ctxPass.IsUsedAsFragment(input.resource, ctx)) + { + ctx.sampledData.Add(input.resource); + ctxPass.numSampledOnlyRaster++; + } + } + } } } } @@ -675,30 +701,99 @@ void TryMergeNativePasses() } } - void FindResourceUsageRanges() + bool FindFirstPassIdOnGraphicsQueueAwaitingFenceGoingForward(ref PassData startAsyncPass, out int firstPassIdAwaiting) + { + var ctx = contextData; + + Debug.Assert(startAsyncPass.asyncCompute && !startAsyncPass.culled); + + firstPassIdAwaiting = startAsyncPass.awaitingMyGraphicsFencePassId; + + // This async pass has no one waiting for it, try the next async passes + if (firstPassIdAwaiting == -1) + { + var nextPassIndex = startAsyncPass.passId + 1; + var lastPassIndex = ctx.passData.Length - 1; + + // Find the first async pass that is synchronized by the graphics queue + while (firstPassIdAwaiting == -1 && nextPassIndex <= lastPassIndex) + { + ref var nextPass = ref ctx.passData.ElementAt(nextPassIndex); + + if (nextPass.asyncCompute && !nextPass.culled) + firstPassIdAwaiting = nextPass.awaitingMyGraphicsFencePassId; + + nextPassIndex++; + } + + // We didn't find any fence, this should not happen? + if (nextPassIndex > lastPassIndex) + { + // For now we fallback to the last pass of the graph + firstPassIdAwaiting = lastPassIndex; + return false; + } + } + + // Found a pass awaiting a fence + return true; + } + + int FindFirstNonCulledPassIdGoingBackward(int startPassId, bool startPassIsIncluded) + { + var ctx = contextData; + + Debug.Assert(startPassId >= 0 && startPassId < ctx.passData.Length); + + var currPassId = startPassIsIncluded ? startPassId : Math.Max(0, startPassId - 1); + + ref var currPass = ref ctx.passData.ElementAt(currPassId); + + // If this pre pass is culled, fallback to the first previous one not culled + while (currPass.culled && currPassId > 0) + { + currPass = ref ctx.passData.ElementAt(--currPassId); + } + + return currPass.passId; + } + + void FindResourceUsageRangeAndSynchronization() { var ctx = contextData; using (new ProfilingScope(ProfilingSampler.Get(NativeCompilerProfileId.NRPRGComp_FindResourceUsageRanges))) { - // Find the passes that last use a resource - // First do a forward-pass increasing the refcount - // followed by another forward-pass decreasing it again (-> if we get 0, we must be the last ones using it) + // Algorithm is in two steps, traversing the list of passes twice - // TODO: I have a feeling this can be done more optimally by walking the graph instead of looping over all the passes twice - // to be investigated - // It also won't work if we start reordering passes. + // First forward traversal: + // - we find the passes that first use a resource + // - we increase the refcount of the last version for each resource used + // - we find where fences must be added in case of async compute/gfx queues and the related async pass dependencies for (int passIndex = 0; passIndex < ctx.passData.Length; passIndex++) { ref var pass = ref ctx.passData.ElementAt(passIndex); + if (pass.culled) continue; + // In case of an async pass, we need to extend the lifetime of the resource to the first pass on the graphics queue that waits for this async pass to be completed. + // By doing so, we ensure that the resource will not be released back to the pool right after adding the async pass commands to the async queue, + // as it could create a data race condition if a non async pass reuses the resource from the pool while the async pass is still processing it + // As contextData must be filled incrementally per pass, we store temporarily these delayed releases in a list. + // Here we clear this list before using it later in the second foward traversal. + ClearDelayedLastUseListAtPass(passIndex); + + pass.waitOnGraphicsFencePassId = -1; + pass.awaitingMyGraphicsFencePassId = -1; + pass.insertGraphicsFence = false; + // Loop over all the resources this pass needs (=inputs) foreach (ref readonly var input in pass.Inputs(ctx)) { var inputResource = input.resource; ref var pointTo = ref ctx.UnversionedResourceData(inputResource); + ref var pointToVer = ref ctx.VersionedResourceData(inputResource); pointTo.lastUsePassID = -1; // If nobody else is using it yet, @@ -718,15 +813,28 @@ void FindResourceUsageRanges() { pointTo.tag++; //Refcount of how many passes are using the last version of a resource } + + // Verify if this pass needs to wait on a fence due to its inputs + // If no RG pass writes to the resource, no need to wait for anyone + if (pointToVer.written) + { + ref var writingPass = ref ctx.passData.ElementAt(pointToVer.writePassId); + if (writingPass.asyncCompute != pass.asyncCompute) + { + // Find the last pass on the opposite queue that the current pass must wait on + var currWaitForPassId = pass.waitOnGraphicsFencePassId; + pass.waitOnGraphicsFencePassId = Math.Max(writingPass.passId, currWaitForPassId); + } + } } //Also look at outputs (but with version 1) for edge case were we do a Write (but no read) to a texture and the pass is manually excluded from culling //As it isn't read it won't be in the inputs array with V0 - foreach (ref readonly var output in pass.Outputs(ctx)) { var outputResource = output.resource; ref var pointTo = ref ctx.UnversionedResourceData(outputResource); + ref var pointToVer = ref ctx.VersionedResourceData(outputResource); // If nobody else is using it yet (no explicit read), // Mark this pass as the first using the resource. @@ -746,17 +854,41 @@ void FindResourceUsageRanges() Debug.Assert(pointTo.lastWritePassID == -1); // Only one can be the last writer pointTo.lastWritePassID = pass.passId; } + + // Resolve if this pass should insert a fence for its outputs + var numReaders = pointToVer.numReaders; + for (var i = 0; i < numReaders; ++i) + { + var readerIndex = ctx.resources.IndexReader(outputResource, i); + ref var readerData = ref ctx.resources.readerData[outputResource.iType].ElementAt(readerIndex); + ref var readerPass = ref ctx.passData.ElementAt(readerData.passId); + if (pass.asyncCompute != readerPass.asyncCompute) + { + // A subsequent pass on the opposite queue will read this resource written by the current pass, + // so this subsequent pass needs to wait for the completion of the current pass + // to do so, the current pass will insert a fence on its queue after its execution + pass.insertGraphicsFence = true; + + // Different async passes can wait for different resources + // Find the first pass on the opposite queue that will wait for this fence + var currFirstPassId = pass.awaitingMyGraphicsFencePassId; + pass.awaitingMyGraphicsFencePassId = currFirstPassId == -1 ? readerData.passId : Math.Min(currFirstPassId, readerData.passId); + } + } } } + // Second forward traversal: + // - we decrease the refcount to detect which is the last pass using the last version of a resource, i.e when we can release it + // - in case of async processing, we must delay the release to the first pass on gfx queue waiting for a fence for (int passIndex = 0; passIndex < ctx.passData.Length; passIndex++) { ref var pass = ref ctx.passData.ElementAt(passIndex); + if (pass.culled) continue; - pass.waitOnGraphicsFencePassId = -1; - pass.insertGraphicsFence = false; + bool isAsync = pass.asyncCompute; foreach (ref readonly var input in pass.Inputs(ctx)) { @@ -768,26 +900,22 @@ void FindResourceUsageRanges() var refC = pointTo.tag - 1; //Decrease refcount this pass is done using it if (refC == 0) // We're the last pass done using it, this pass should destroy it. { - pointTo.lastUsePassID = pass.passId; - pass.AddLastUse(inputResource, ctx); - } - - pointTo.tag = refC; - } - - // Resolve if this pass needs to wait on a fence due to its inputs - if (pass.waitOnGraphicsFencePassId == -1) - { - ref var pointToVer = ref ctx.VersionedResourceData(inputResource); - // If no RG pass writes to the resource, no need to wait for anyone - if (pointToVer.written) - { - ref var wPass = ref ctx.passData.ElementAt(pointToVer.writePassId); - if (wPass.asyncCompute != pass.asyncCompute) + if (isAsync) + { + // If no fence found, we fallback to the last non culled pass of the graph on graphics queue, not ideal but safe + bool foundFence = FindFirstPassIdOnGraphicsQueueAwaitingFenceGoingForward(ref pass, out int firstWaitingOrLastPassId); + var delayLastUsedPassId = FindFirstNonCulledPassIdGoingBackward(firstWaitingOrLastPassId, !foundFence); + pointTo.lastUsePassID = delayLastUsedPassId; + AddDelayedLastUseToPass(inputResource, delayLastUsedPassId); + } + else { - pass.waitOnGraphicsFencePassId = wPass.passId; + pointTo.lastUsePassID = pass.passId; + pass.AddLastUse(inputResource, ctx); } } + + pointTo.tag = refC; } } @@ -802,25 +930,57 @@ void FindResourceUsageRanges() var last = pointTo.latestVersionNumber; if (last == outputResource.version && pointToVer.numReaders == 0) { - pointTo.lastUsePassID = pass.passId; - pass.AddLastUse(outputResource, ctx); - } - - // Resolve if this pass should insert a fence for its outputs - var numReaders = pointToVer.numReaders; - for (var i = 0; i < numReaders; ++i) - { - var depIdx = ctx.resources.IndexReader(outputResource, i); - ref var dep = ref ctx.resources.readerData[outputResource.iType].ElementAt(depIdx); - ref var depPass = ref ctx.passData.ElementAt(dep.passId); - if (pass.asyncCompute != depPass.asyncCompute) + if (isAsync) { - pass.insertGraphicsFence = true; - break; + // If no fence found, we fallback to the last non culled pass of the graph, not ideal but safe + bool foundFence = FindFirstPassIdOnGraphicsQueueAwaitingFenceGoingForward(ref pass, out int firstWaitingOrLastPassId); + var delayLastUsedPassId = FindFirstNonCulledPassIdGoingBackward(firstWaitingOrLastPassId, !foundFence); + pointTo.lastUsePassID = delayLastUsedPassId; + AddDelayedLastUseToPass(outputResource, delayLastUsedPassId); + } + else + { + pointTo.lastUsePassID = pass.passId; + pass.AddLastUse(outputResource, ctx); } } } + + // Add any potential delayed resource releases to the contextData + AddLastUseFromDelayedList(ref pass); + } + } + } + + void ClearDelayedLastUseListAtPass(int passId) + { + if (m_DelayedLastUseListPerPassMap.TryGetValue(passId, out var lastUseListForPassId)) + { + lastUseListForPassId.Clear(); + } + } + + void AddDelayedLastUseToPass(in ResourceHandle releaseResource, int passId) + { + if (!m_DelayedLastUseListPerPassMap.TryGetValue(passId, out var lastUseListForPassId)) + { + lastUseListForPassId = new List(); + m_DelayedLastUseListPerPassMap.Add(passId, lastUseListForPassId); + } + + lastUseListForPassId.Add(releaseResource); + } + + public void AddLastUseFromDelayedList(ref PassData passData) + { + if (m_DelayedLastUseListPerPassMap.TryGetValue(passData.passId, out var lastUseListForPassId)) + { + foreach (var resource in lastUseListForPassId) + { + passData.AddLastUse(resource, contextData); } + + lastUseListForPassId.Clear(); } } @@ -890,7 +1050,7 @@ void PropagateTextureUVOrigin() } } - static bool IsGlobalTextureInPass(RenderGraphPass pass, ResourceHandle handle) + static bool IsGlobalTextureInPass(RenderGraphPass pass, in ResourceHandle handle) { foreach (var g in pass.setGlobalsList) { @@ -1561,7 +1721,7 @@ internal unsafe void ExecuteBeginRenderPass(InternalRenderGraphContext rgContext currBeginAttachment.clearColor = Color.red; currBeginAttachment.clearDepth = 1.0f; currBeginAttachment.clearStencil = 0; - var desc = resources.GetTextureResourceDesc(currAttachmentHandle, true); + ref readonly var desc = ref resources.GetTextureResourceDesc(currAttachmentHandle, true); if (i == 0 && nativePass.hasDepth) { // TODO: There seems to be no clear depth specified ?!?! @@ -1753,7 +1913,7 @@ private void ExecuteSetRenderTargets(RenderGraphPass pass, InternalRenderGraphCo } } - internal unsafe void ExecuteSetRandomWriteTarget(in CommandBuffer cmd, RenderGraphResourceRegistry resources, int index, ResourceHandle resource, bool preserveCounterValue = true) + internal unsafe void ExecuteSetRandomWriteTarget(in CommandBuffer cmd, RenderGraphResourceRegistry resources, int index, in ResourceHandle resource, bool preserveCounterValue = true) { if (resource.type == RenderGraphResourceType.Texture) { @@ -1845,8 +2005,7 @@ public void ExecuteGraph(InternalRenderGraphContext rgContext, RenderGraphResour // also make sure to insert fence=waits for multiple queue syncs if (passData.waitOnGraphicsFencePassId != -1) { - var fence = contextData.fences[passData.waitOnGraphicsFencePassId]; - rgContext.cmd.WaitOnAsyncGraphicsFence(fence, SynchronisationStageFlags.PixelProcessing); + rgContext.cmd.WaitOnAsyncGraphicsFence(contextData.fences[passData.waitOnGraphicsFencePassId], SynchronisationStageFlags.PixelProcessing); } if (passData.type == RenderGraphPassType.Raster && passData.mergeState <= PassMergeState.Begin) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs index 2b68c16b3f9..cdb8b770e6c 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs @@ -1,9 +1,7 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; -using Unity.Collections.LowLevel.Unsafe; -using UnityEngine.Rendering; -using System.Collections.Generic; using Unity.Collections; using UnityEngine.Experimental.Rendering; @@ -15,7 +13,7 @@ internal readonly struct PassInputData { public readonly ResourceHandle resource; - public PassInputData(ResourceHandle resource) + public PassInputData(in ResourceHandle resource) { this.resource = resource; } @@ -27,7 +25,7 @@ internal readonly struct PassOutputData { public readonly ResourceHandle resource; - public PassOutputData(ResourceHandle resource) + public PassOutputData(in ResourceHandle resource) { this.resource = resource; } @@ -42,7 +40,7 @@ internal readonly struct PassFragmentData public readonly int mipLevel; public readonly int depthSlice; - public PassFragmentData(ResourceHandle handle, AccessFlags flags, int mipLevel, int depthSlice) + public PassFragmentData(in ResourceHandle handle, AccessFlags flags, int mipLevel, int depthSlice) { resource = handle; accessFlags = flags; @@ -80,7 +78,7 @@ internal readonly struct PassRandomWriteData public readonly int index; public readonly bool preserveCounterValue; - public PassRandomWriteData(ResourceHandle resource, int index, bool preserveCounterValue) + public PassRandomWriteData(in ResourceHandle resource, int index, bool preserveCounterValue) { this.resource = resource; this.index = index; @@ -130,6 +128,8 @@ internal struct PassData public int numFragments; public int firstFragmentInput; //base+offset in CompilerContextData.fragmentData (use the Fragment inputs iterator to iterate this more easily) public int numFragmentInputs; + public int firstSampledOnlyRaster; //base+offset in CompilerContextData.sampledData (use the Sampled iterator to iterate this more easily) + public int numSampledOnlyRaster; public int firstRandomAccessResource; //base+offset in CompilerContextData.randomWriteData (use the Fragment inputs iterator to iterate this more easily) public int numRandomAccessResources; public int firstCreate; //base+offset in CompilerContextData.createData (use the InputNodes iterator to iterate this more easily) @@ -143,7 +143,8 @@ internal struct PassData public int fragmentInfoVolumeDepth; public int fragmentInfoSamples; - public int waitOnGraphicsFencePassId; // -1 if no fence wait is needed, otherwise the passId to wait on + public int waitOnGraphicsFencePassId; // -1 if no fence wait is needed, otherwise the highest/latest passId executed on the opposite (async compute or gfx) queue to wait on + public int awaitingMyGraphicsFencePassId; // -1 if no pass is awaiting the fence generated by this pass, otherwise the lowest/earliest passId executed on the opposite queue waiting for this pass to be completed public bool asyncCompute; public bool hasSideEffects; @@ -180,6 +181,8 @@ public PassData(in RenderGraphPass pass, int passIndex) numOutputs = 0; firstFragment = 0; numFragments = 0; + firstSampledOnlyRaster = 0; + numSampledOnlyRaster = 0; firstRandomAccessResource = 0; numRandomAccessResources = 0; firstFragmentInput = 0; @@ -198,6 +201,7 @@ public PassData(in RenderGraphPass pass, int passIndex) insertGraphicsFence = false; waitOnGraphicsFencePassId = -1; + awaitingMyGraphicsFencePassId = -1; hasShadingRateStates = pass.hasShadingRateStates; shadingRateFragmentSize = pass.shadingRateFragmentSize; @@ -231,6 +235,8 @@ public void ResetAndInitialize(in RenderGraphPass pass, int passIndex) numFragments = 0; firstFragmentInput = 0; numFragmentInputs = 0; + firstSampledOnlyRaster = 0; + numSampledOnlyRaster = 0; firstRandomAccessResource = 0; numRandomAccessResources = 0; firstCreate = 0; @@ -247,6 +253,7 @@ public void ResetAndInitialize(in RenderGraphPass pass, int passIndex) insertGraphicsFence = false; waitOnGraphicsFencePassId = -1; + awaitingMyGraphicsFencePassId = -1; hasShadingRateStates = pass.hasShadingRateStates; shadingRateFragmentSize = pass.shadingRateFragmentSize; @@ -268,6 +275,10 @@ public readonly ReadOnlySpan Inputs(CompilerContextData ctx) public readonly ReadOnlySpan Fragments(CompilerContextData ctx) => ctx.fragmentData.MakeReadOnlySpan(firstFragment, numFragments); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly ReadOnlySpan SampledTexturesIfRaster(CompilerContextData ctx) + => ctx.sampledData.MakeReadOnlySpan(firstSampledOnlyRaster, numSampledOnlyRaster); + // ShadingRateImageAttachment [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly PassFragmentData ShadingRateImage(CompilerContextData ctx) @@ -290,7 +301,7 @@ public ReadOnlySpan RandomWriteTextures(CompilerContextData public readonly ReadOnlySpan LastUsedResources(CompilerContextData ctx) => ctx.destroyData.MakeReadOnlySpan(firstDestroy, numDestroyed); - private bool TrySetupAndValidateFragmentInfo(ResourceHandle h, CompilerContextData ctx, out string errorMessage) + private bool TrySetupAndValidateFragmentInfo(in ResourceHandle h, CompilerContextData ctx, out string errorMessage) { errorMessage = null; @@ -349,14 +360,14 @@ private bool TrySetupAndValidateFragmentInfo(ResourceHandle h, CompilerContextDa } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void TryAddFragment(ResourceHandle h, CompilerContextData ctx, out string errorMessage) + internal void TryAddFragment(in ResourceHandle h, CompilerContextData ctx, out string errorMessage) { if (TrySetupAndValidateFragmentInfo(h, ctx, out errorMessage)) numFragments++; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void TryAddFragmentInput(ResourceHandle h, CompilerContextData ctx, out string errorMessage) + internal void TryAddFragmentInput(in ResourceHandle h, CompilerContextData ctx, out string errorMessage) { if (TrySetupAndValidateFragmentInfo(h, ctx, out errorMessage)) numFragmentInputs++; @@ -370,7 +381,7 @@ internal void AddRandomAccessResource() } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void AddFirstUse(ResourceHandle h, CompilerContextData ctx) + internal void AddFirstUse(in ResourceHandle h, CompilerContextData ctx) { // Already registered? Skip it foreach (ref readonly var res in FirstUsedResources(ctx)) @@ -394,7 +405,7 @@ internal void AddFirstUse(ResourceHandle h, CompilerContextData ctx) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void AddLastUse(ResourceHandle h, CompilerContextData ctx) + internal void AddLastUse(in ResourceHandle h, CompilerContextData ctx) { // Already registered? Skip it foreach (ref readonly var res in LastUsedResources(ctx)) @@ -420,7 +431,7 @@ internal void AddLastUse(ResourceHandle h, CompilerContextData ctx) // As it is ambiguous if this is an input our output version, the version is ignored // This checks use of both MRT attachment as well as input attachment [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal readonly bool IsUsedAsFragment(ResourceHandle h, CompilerContextData ctx) + internal readonly bool IsUsedAsFragment(in ResourceHandle h, CompilerContextData ctx) { //Only textures can be used as a fragment attachment. if (h.type != RenderGraphResourceType.Texture) return false; @@ -488,7 +499,7 @@ internal readonly struct NativePassAttachment public readonly int mipLevel; public readonly int depthSlice; - public NativePassAttachment(ResourceHandle handle, RenderBufferLoadAction loadAction, RenderBufferStoreAction storeAction, bool memoryless, int mipLevel, int depthSlice) + public NativePassAttachment(in ResourceHandle handle, RenderBufferLoadAction loadAction, RenderBufferStoreAction storeAction, bool memoryless, int mipLevel, int depthSlice) { this.handle = handle; this.loadAction = loadAction; @@ -808,10 +819,10 @@ static bool CanMergeMSAASamples(ref NativePassData nativePass, ref PassData pass return (nativePass.samples == passToMerge.fragmentInfoSamples) || (passToMerge.fragmentInfoSamples == 1 && passToMerge.extendedFeatureFlags.HasFlag(ExtendedFeatureFlags.MultisampledShaderResolve)); } - + static bool AreExtendedFeatureFlagsCompatible(ExtendedFeatureFlags flags0, ExtendedFeatureFlags flags1) { - // Which of the newly added flags are incompatible? + // Which of the newly added flags are incompatible? return true; } @@ -909,22 +920,22 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ } } - // Check the non-fragment inputs of this pass, if they are generated by the current open native pass we can't merge + // Check the non-fragment textures of this pass, if they are generated by the current open native pass we can't merge // as we need to commit the pixels to the texture - foreach (ref readonly var input in passToMerge.Inputs(contextData)) + foreach (ref readonly var sampledTexture in passToMerge.SampledTexturesIfRaster(contextData)) { - var inputResource = input.resource; - - ref readonly var inputDataVersioned = ref contextData.VersionedResourceData(inputResource); + ref readonly var sampledDataVersioned = ref contextData.VersionedResourceData(sampledTexture); - bool isWrittenInCurrNativePass = inputDataVersioned.written && (inputDataVersioned.writePassId >= nativePass.firstGraphPass && inputDataVersioned.writePassId < nativePass.lastGraphPass + 1); - - if (isWrittenInCurrNativePass) + // If the writing pass is culled, we don't need to break the native pass merge + // because the texture won't actually be written to, so there's no read-after-write conflict + bool isWritingPassCulled = contextData.passData[sampledDataVersioned.writePassId].culled; + if (!isWritingPassCulled) { - // If it's not used as a fragment, it's used as some sort of texture read or load so we need to break the current native render pass - // as we can't sample and write to it in the same native render pass - if (!passToMerge.IsUsedAsFragment(inputResource, contextData)) + bool isWrittenInCurrNativePass = sampledDataVersioned.written && (sampledDataVersioned.writePassId >= nativePass.firstGraphPass && sampledDataVersioned.writePassId < nativePass.lastGraphPass + 1); + if (isWrittenInCurrNativePass) { + // It's used as some sort of texture read or load so we need to break the current native render pass + // as we can't sample and write to it in the same native render pass return new PassBreakAudit(PassBreakReason.NextPassReadsTexture, passIdToMerge); } } @@ -936,52 +947,60 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ // We can't have more than the maximum amount of attachments in a given native renderpass int currAvailableAttachmentSlots = FixedAttachmentArray.MaxAttachments - nativePass.fragments.size; - foreach (ref readonly var fragment in passToMerge.Fragments(contextData)) + // Early exit: only build the HashSet and check if we actually have fragments to check against it + if (passToMerge.numFragments > 0) { - bool alreadyAttached = false; - - for (int i = 0; i < nativePass.fragments.size; ++i) + // Temporary cache of sampled textures in current Native Render Pass for conflict detection against fragments + using (HashSetPool.Get(out var tempSampledTextures)) { - if (PassFragmentData.SameSubResource(nativePass.fragments[i], fragment)) + var graphPasses = nativePass.GraphPasses(contextData); + foreach (ref readonly var graphPass in graphPasses) { - alreadyAttached = true; - break; + if (graphPass.numSampledOnlyRaster > 0) // Skip passes with no sampled textures + { + foreach (ref readonly var earlierInput in graphPass.SampledTexturesIfRaster(contextData)) + { + tempSampledTextures.Add(earlierInput.index); + } + } } - } - // This fragment is not attached to the native renderpass yet, we will need to attach it - if (!alreadyAttached) - { - // We already reached the maximum amount of attachments in this renderpass - // We can't add any new attachment, just start a new renderpass - if (currAvailableAttachmentSlots == 0) + foreach (ref readonly var fragment in passToMerge.Fragments(contextData)) { - return new PassBreakAudit(PassBreakReason.AttachmentLimitReached, passIdToMerge); - } - else - { - attachmentsToTryAdding.Add(fragment); - currAvailableAttachmentSlots--; - } - } + bool alreadyAttached = false; - // Check if this fragment is already sampled in the native renderpass as a standard texture - for (int i = nativePass.firstGraphPass; i <= nativePass.lastGraphPass; ++i) - { - ref var earlierPassData = ref contextData.passData.ElementAt(i); - foreach (ref readonly var earlierInput in earlierPassData.Inputs(contextData)) - { - // If this fragment is already used in current native render pass - if (earlierInput.resource.index == fragment.resource.index) + for (int i = 0; i < nativePass.fragments.size; ++i) + { + if (PassFragmentData.SameSubResource(nativePass.fragments[i], fragment)) + { + alreadyAttached = true; + break; + } + } + + // This fragment is not attached to the native renderpass yet, we will need to attach it + if (!alreadyAttached) { - // If it's not used as a fragment, it's used as some sort of texture read of load so we need to sync it out - if (!earlierPassData.IsUsedAsFragment(earlierInput.resource, contextData)) + // We already reached the maximum amount of attachments in this renderpass + // We can't add any new attachment, just start a new renderpass + if (currAvailableAttachmentSlots == 0) { - return new PassBreakAudit(PassBreakReason.NextPassTargetsTexture, passIdToMerge); + return new PassBreakAudit(PassBreakReason.AttachmentLimitReached, passIdToMerge); + } + else + { + attachmentsToTryAdding.Add(fragment); + currAvailableAttachmentSlots--; } } + + // Check if this fragment is already sampled in the native renderpass as a standard texture + // Before looking in the HashSet check if there is any sampled texture + if (tempSampledTextures.Contains(fragment.resource.index)) + return new PassBreakAudit(PassBreakReason.NextPassTargetsTexture, passIdToMerge); + } - } + } // Close the using block for HashSetPool } foreach (ref readonly var fragmentInput in passToMerge.FragmentInputs(contextData)) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/ResourcesData.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/ResourcesData.cs index e117c199ef9..37685bbe3b0 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/ResourcesData.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/ResourcesData.cs @@ -7,10 +7,16 @@ namespace UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler { // Data per usage of a resource(version) - internal struct ResourceReaderData + internal readonly struct ResourceReaderData { - public int passId; // Pass using this - public int inputSlot; // Nth input of the pass using this resource + public readonly int passId; // Pass using this + public readonly int inputSlot; // Nth input of the pass using this resource + + public ResourceReaderData(int _passId, int _inputSlot) + { + passId = _passId; + inputSlot = _inputSlot; + } } // Part of the data that remains the same for all versions of the resource @@ -41,7 +47,7 @@ internal struct ResourceUnversionedData public TextureUVOriginSelection textureUVOrigin; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public string GetName(CompilerContextData ctx, ResourceHandle h) => ctx.GetResourceName(h); + public string GetName(CompilerContextData ctx, in ResourceHandle h) => ctx.GetResourceName(h); public ResourceUnversionedData(TextureResource rll, ref RenderTargetInfo info, ref TextureDesc desc, bool isResourceShared) { @@ -58,7 +64,7 @@ public ResourceUnversionedData(TextureResource rll, ref RenderTargetInfo info, r volumeDepth = info.volumeDepth; msaaSamples = info.msaaSamples; - latestVersionNumber = rll.version; + latestVersionNumber = (int)rll.writeCount; clear = desc.clearBuffer; discard = desc.discardBuffer; @@ -84,7 +90,7 @@ public ResourceUnversionedData(IRenderGraphResource rll, ref BufferDesc _, bool volumeDepth = -1; msaaSamples = -1; - latestVersionNumber = rll.version; + latestVersionNumber = (int)rll.writeCount; clear = false; discard = false; @@ -110,7 +116,7 @@ public ResourceUnversionedData(IRenderGraphResource rll, ref RayTracingAccelerat volumeDepth = -1; msaaSamples = -1; - latestVersionNumber = rll.version; + latestVersionNumber = (int)rll.writeCount; clear = false; discard = false; @@ -137,7 +143,7 @@ internal struct ResourceVersionedData // Register the pass writing this resource version. A version can only be written by a single pass as every write should introduce a new distinct version. [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetWritingPass(CompilerContextData ctx, ResourceHandle h, int passId) + public void SetWritingPass(CompilerContextData ctx, in ResourceHandle h, int passId) { #if DEVELOPMENT_BUILD || UNITY_EDITOR if (written) @@ -154,7 +160,7 @@ public void SetWritingPass(CompilerContextData ctx, ResourceHandle h, int passId // Add an extra reader for this resource version. Resource versions can be read many times // The same pass can even read a resource twice (if it is passed to two separate input slots) [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void RegisterReadingPass(CompilerContextData ctx, ResourceHandle h, int passId, int index) + public void RegisterReadingPass(CompilerContextData ctx, in ResourceHandle h, int passId, int index) { #if DEVELOPMENT_BUILD || UNITY_EDITOR if (numReaders >= ctx.resources.MaxReaders[h.iType]) @@ -164,17 +170,13 @@ public void RegisterReadingPass(CompilerContextData ctx, ResourceHandle h, int p throw new Exception($"Maximum '{ctx.resources.MaxReaders}' passes can use a single graph output as input. Pass {passName} is trying to read {resourceName}."); } #endif - ctx.resources.readerData[h.iType][ctx.resources.IndexReader(h, numReaders)] = new ResourceReaderData - { - passId = passId, - inputSlot = index - }; + ctx.resources.readerData[h.iType][ctx.resources.IndexReader(h, numReaders)] = new ResourceReaderData(passId, index); numReaders++; } // Remove all the reads for the given pass of this resource version [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void RemoveReadingPass(CompilerContextData ctx, ResourceHandle h, int passId) + public void RemoveReadingPass(CompilerContextData ctx, in ResourceHandle h, int passId) { for (int r = 0; r < numReaders;) { @@ -333,7 +335,7 @@ public void Initialize(RenderGraphResourceRegistry resources) // Flatten array index [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int Index(ResourceHandle h) + public int Index(in ResourceHandle h) { #if UNITY_EDITOR // Hot path if (h.version < 0 || h.version >= MaxVersions[h.iType]) @@ -344,7 +346,7 @@ public int Index(ResourceHandle h) // Flatten array index [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int IndexReader(ResourceHandle h, int readerID) + public int IndexReader(in ResourceHandle h, int readerID) { #if UNITY_EDITOR // Hot path if (h.version < 0 || h.version >= MaxVersions[h.iType]) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.Compiler.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.Compiler.cs index 1c44fae3e45..dbe3f0dab2d 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.Compiler.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.Compiler.cs @@ -19,14 +19,12 @@ internal NativePassCompiler CompileNativeRenderGraph(int graphHash) if (!compilationIsCached) nativeCompiler.Compile(m_Resources); - var passData = nativeCompiler.contextData.passData; + ref var passData = ref nativeCompiler.contextData.passData; int numPasses = passData.Length; for (int i = 0; i < numPasses; ++i) { - if (passData.ElementAt(i).culled) - continue; - var rp = m_RenderPasses[i]; - m_RendererLists.AddRange(rp.usedRendererListList); + if (!passData.ElementAt(i).culled) + m_RendererLists.AddRange(m_RenderPasses[i].usedRendererListList); } m_Resources.CreateRendererLists(m_RendererLists, m_RenderGraphContext.renderContext, m_RendererListCulling); @@ -40,11 +38,6 @@ void ExecuteNativeRenderGraph() using (new ProfilingScope(m_RenderGraphContext.cmd, ProfilingSampler.Get(RenderGraphProfileId.ExecuteRenderGraph))) { nativeCompiler.ExecuteGraph(m_RenderGraphContext, m_Resources, m_RenderPasses); - - if (m_RenderGraphContext.contextlessTesting == false) - m_RenderGraphContext.renderContext.ExecuteCommandBuffer(m_RenderGraphContext.cmd); - - m_RenderGraphContext.cmd.Clear(); } } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs index 201b0ea333d..e161f8ddb4b 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs @@ -969,7 +969,7 @@ public TextureHandle CreateTexture(TextureHandle texture) { CheckNotUsedWhenExecuting(); - return m_Resources.CreateTexture(m_Resources.GetTextureResourceDesc(texture.handle)); + return m_Resources.CreateTexture(in m_Resources.GetTextureResourceDesc(texture.handle)); } /// @@ -1241,7 +1241,7 @@ public BufferHandle CreateBuffer(in BufferHandle graphicsBuffer) { CheckNotUsedWhenExecuting(); - return m_Resources.CreateBuffer(m_Resources.GetBufferResourceDesc(graphicsBuffer.handle)); + return m_Resources.CreateBuffer(in m_Resources.GetBufferResourceDesc(graphicsBuffer.handle)); } /// @@ -3036,7 +3036,7 @@ void GenerateCompilerDebugData(ref DebugData debugData) } else if (resourceType == RenderGraphResourceType.Buffer) { - var bufferDesc = m_Resources.GetBufferResourceDesc(handle, true); + ref readonly var bufferDesc = ref m_Resources.GetBufferResourceDesc(handle, true); var bufferData = new DebugData.BufferResourceData(); bufferData.count = bufferDesc.count; @@ -3120,7 +3120,7 @@ void GenerateCompilerDebugData(ref DebugData debugData) Dictionary registeredGlobals = new Dictionary(); - internal void SetGlobal(TextureHandle h, int globalPropertyId) + internal void SetGlobal(in TextureHandle h, int globalPropertyId) { if (!h.IsValid()) throw new ArgumentException("Attempting to register an invalid texture handle as a global"); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs index 8bdf1bfd889..3dfb424ed04 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs @@ -132,7 +132,7 @@ public TextureHandle CreateTransientTexture(in TextureDesc desc) /// A new transient TextureHandle. public TextureHandle CreateTransientTexture(in TextureHandle texture) { - var desc = m_Resources.GetTextureResourceDesc(texture.handle); + ref readonly var desc = ref m_Resources.GetTextureResourceDesc(texture.handle); var result = m_Resources.CreateTexture(desc, m_RenderPass.index); m_RenderPass.AddTransientResource(result.handle); return result; @@ -221,7 +221,7 @@ public BufferHandle CreateTransientBuffer(in BufferDesc desc) /// A new transient GraphicsBufferHandle. public BufferHandle CreateTransientBuffer(in BufferHandle graphicsbuffer) { - var desc = m_Resources.GetBufferResourceDesc(graphicsbuffer.handle); + ref readonly var desc = ref m_Resources.GetBufferResourceDesc(graphicsbuffer.handle); var result = m_Resources.CreateBuffer(desc, m_RenderPass.index); m_RenderPass.AddTransientResource(result.handle); return result; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilders.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilders.cs index f34f8a29503..0418d32c776 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilders.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilders.cs @@ -84,26 +84,26 @@ public void EnableFoveatedRasterization(bool value) public BufferHandle CreateTransientBuffer(in BufferDesc desc) { var result = m_Resources.CreateBuffer(desc, m_RenderPass.index); - UseResource(result.handle, AccessFlags.Write | AccessFlags.Read, isTransient: true); + UseTransientResource(result.handle); return result; } public BufferHandle CreateTransientBuffer(in BufferHandle computebuffer) { - var desc = m_Resources.GetBufferResourceDesc(computebuffer.handle); + ref readonly var desc = ref m_Resources.GetBufferResourceDesc(computebuffer.handle); return CreateTransientBuffer(desc); } public TextureHandle CreateTransientTexture(in TextureDesc desc) { var result = m_Resources.CreateTexture(desc, m_RenderPass.index); - UseResource(result.handle, AccessFlags.Write | AccessFlags.Read, isTransient: true); + UseTransientResource(result.handle); return result; } public TextureHandle CreateTransientTexture(in TextureHandle texture) { - var desc = m_Resources.GetTextureResourceDesc(texture.handle); + ref readonly var desc = ref m_Resources.GetTextureResourceDesc(texture.handle); return CreateTransientTexture(desc); } @@ -163,7 +163,7 @@ protected virtual void Dispose(bool disposing) } [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - private void ValidateWriteTo(in ResourceHandle handle) + private void CheckWriteTo(in ResourceHandle handle) { if (RenderGraph.enableValidityChecks) { @@ -201,57 +201,63 @@ private void ValidateWriteTo(in ResourceHandle handle) } } - private ResourceHandle UseResource(in ResourceHandle handle, AccessFlags flags, bool isTransient = false) + // Lifetime of a transient resource is one render graph pass + private ResourceHandle UseTransientResource(in ResourceHandle inputHandle) { - CheckResource(handle); + CheckResource(inputHandle); - // If we are not discarding the resource, add a "read" dependency on the current version - // this "Read" is a bit of a misnomer it really means more like "Preserve existing content or read" - if ((flags & AccessFlags.Discard) == 0) - { - ResourceHandle versioned; - if (!handle.IsVersioned) - { - versioned = m_Resources.GetLatestVersionHandle(handle); - } - else - { - versioned = handle; - } + ResourceHandle versionedHandle = inputHandle.IsVersioned ? inputHandle : m_Resources.GetLatestVersionHandle(inputHandle); - if (isTransient) - { - m_RenderPass.AddTransientResource(versioned); - return GetLatestVersionHandle(handle); - } + // Transient resources are always considered written and read in the render graph pass where they are used + // Compiler will take it into account later, no need to add them to read and write lists + m_RenderPass.AddTransientResource(versionedHandle); + + return versionedHandle; + } + + private ResourceHandle UseResource(in ResourceHandle inputHandle, AccessFlags flags) + { + CheckResource(inputHandle); + + bool discard = (flags & AccessFlags.Discard) != 0; + bool read = (flags & AccessFlags.Read) != 0; + bool write = (flags & AccessFlags.Write) != 0; - m_RenderPass.AddResourceRead(versioned); - m_Resources.IncrementReadCount(handle); + ResourceHandle versionedHandle = inputHandle.IsVersioned ? inputHandle : m_Resources.GetLatestVersionHandle(inputHandle); - if ((flags & AccessFlags.Read) == 0) + // If we are not discarding the current version and its data, add a "read" dependency on it + // this is a bit of a misnomer it really means more like "Preserve existing content or read" + if (!discard) + { + m_Resources.IncrementReadCount(versionedHandle); + m_RenderPass.AddResourceRead(versionedHandle); + + // Implicit read - not user-specified + if (!read) { - // Flag the resource as being an "implicit read" so that we can distinguish it from a user-specified read - m_RenderPass.implicitReadsList.Add(versioned); + m_RenderPass.implicitReadsList.Add(versionedHandle); } } else { // We are discarding it but we still read it, so we add a dependency on version "0" of this resource - if ((flags & AccessFlags.Read) != 0) + if (read) { - m_RenderPass.AddResourceRead(m_Resources.GetZeroVersionedHandle(handle)); - m_Resources.IncrementReadCount(handle); + var zeroVersionHandle = m_Resources.GetZeroVersionHandle(versionedHandle); + m_Resources.IncrementReadCount(zeroVersionHandle); + m_RenderPass.AddResourceRead(zeroVersionHandle); } } - if ((flags & AccessFlags.Write) != 0) + if (write) { - ValidateWriteTo(handle); - m_RenderPass.AddResourceWrite(m_Resources.GetNewVersionedHandle(handle)); - m_Resources.IncrementWriteCount(handle); + CheckWriteTo(inputHandle); + // New versioned written by this render graph pass + versionedHandle = m_Resources.IncrementWriteCount(inputHandle); + m_RenderPass.AddResourceWrite(versionedHandle); } - return GetLatestVersionHandle(handle); + return versionedHandle; } public BufferHandle UseBuffer(in BufferHandle input, AccessFlags flags) @@ -266,12 +272,11 @@ public BufferHandle UseBuffer(in BufferHandle input, AccessFlags flags) // for ample UseTexture(myTexV1, read) UseFragment(myTexV2, ReadWrite) as they are different versions // but for now we don't allow any of that. [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - private void CheckNotUseFragment(TextureHandle tex) + private void CheckNotUseFragment(in TextureHandle tex) { - if(RenderGraph.enableValidityChecks) + if (RenderGraph.enableValidityChecks) { - bool usedAsFragment = false; - usedAsFragment = (m_RenderPass.depthAccess.textureHandle.IsValid() && m_RenderPass.depthAccess.textureHandle.handle.index == tex.handle.index); + bool usedAsFragment = (m_RenderPass.depthAccess.textureHandle.IsValid() && m_RenderPass.depthAccess.textureHandle.handle.index == tex.handle.index); if (!usedAsFragment) { for (int i = 0; i <= m_RenderPass.colorBufferMaxIndex; i++) @@ -293,7 +298,7 @@ private void CheckNotUseFragment(TextureHandle tex) } [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - private void CheckTextureUVOriginIsValid(ResourceHandle handle, TextureResource texRes) + private void CheckTextureUVOriginIsValid(in ResourceHandle handle, TextureResource texRes) { if (texRes.textureUVOrigin == TextureUVOriginSelection.TopLeft) { @@ -345,9 +350,9 @@ public void SetGlobalTextureAfterPass(in TextureHandle input, int propertyId) // Shared validation between SetRenderAttachment/SetRenderAttachmentDepth [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] - private void CheckUseFragment(TextureHandle tex, bool isDepth) + private void CheckUseFragment(in TextureHandle tex, bool isDepth) { - if(RenderGraph.enableValidityChecks) + if (RenderGraph.enableValidityChecks) { // We ignore the version as we don't allow mixing UseTexture/UseFragment between different versions // even though it should theoretically work (and we might do so in the future) for now we're overly strict. @@ -533,22 +538,11 @@ public void UseRendererList(in RendererListHandle input) { m_RenderPass.UseRendererList(input); } - - private ResourceHandle GetLatestVersionHandle(in ResourceHandle handle) - { - // Transient resources can't be used outside the pass so can never be versioned - if (m_Resources.GetRenderGraphResourceTransientIndex(handle) >= 0) - { - return handle; - } - - return m_Resources.GetLatestVersionHandle(handle); - } - + [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] void CheckResource(in ResourceHandle res, bool checkTransientReadWrite = false) { - if(RenderGraph.enableValidityChecks) + if (RenderGraph.enableValidityChecks) { if (res.IsValid()) { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs index e92dea42a27..eeee3981578 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs @@ -368,7 +368,7 @@ void ComputeTextureHash(ref HashFNV1A32 generator, in ResourceHandle handle, Ren { var res = resources.GetTextureResource(handle); var graphicsResource = res.graphicsResource; - ref var desc = ref res.desc; + ref readonly var desc = ref res.desc; var externalTexture = graphicsResource.externalTexture; if (externalTexture != null) // External texture @@ -413,7 +413,7 @@ void ComputeTextureHash(ref HashFNV1A32 generator, in ResourceHandle handle, Ren } else { - var desc = resources.GetTextureResourceDesc(handle); + ref readonly var desc = ref resources.GetTextureResourceDesc(handle); generator.Append((int) desc.format); generator.Append((int) desc.dimension); generator.Append((int) desc.msaaSamples); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceAccelerationStructure.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceAccelerationStructure.cs index b5e2caaffcc..19c76e5d4bd 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceAccelerationStructure.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceAccelerationStructure.cs @@ -8,7 +8,7 @@ namespace UnityEngine.Rendering.RenderGraphModule /// [DebuggerDisplay("RayTracingAccelerationStructure ({handle.index})")] [MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")] - public struct RayTracingAccelerationStructureHandle + public readonly struct RayTracingAccelerationStructureHandle { private static RayTracingAccelerationStructureHandle s_NullHandle = new RayTracingAccelerationStructureHandle(); @@ -18,7 +18,7 @@ public struct RayTracingAccelerationStructureHandle /// A null ray tracing acceleration structure handle. public static RayTracingAccelerationStructureHandle nullHandle { get { return s_NullHandle; } } - internal ResourceHandle handle; + internal readonly ResourceHandle handle; internal RayTracingAccelerationStructureHandle(int handle) { this.handle = new ResourceHandle(handle, RenderGraphResourceType.AccelerationStructure, false); } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceBuffer.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceBuffer.cs index ce35d207bdd..97b8430077e 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceBuffer.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceBuffer.cs @@ -9,7 +9,7 @@ namespace UnityEngine.Rendering.RenderGraphModule /// [DebuggerDisplay("Buffer ({handle.index})")] [MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")] - public struct BufferHandle + public readonly struct BufferHandle { // Minor Warning: This calls the zeroing constructor this means that the embedded ResourceHandle struct will also be zero-ed // which then means ResourceHandle.type will be set to zero == Texture. As this is an "invalid" bufferhandle I guess setting it @@ -22,7 +22,7 @@ public struct BufferHandle /// A null graphics buffer handle. public static BufferHandle nullHandle { get { return s_NullHandle; } } - internal ResourceHandle handle; + internal readonly ResourceHandle handle; internal BufferHandle(in ResourceHandle h) { handle = h; } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs index 4358957dbbf..c0bd921cef7 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs @@ -348,10 +348,11 @@ void CheckHandleValidity(RenderGraphResourceType type, int index) } } - internal void IncrementWriteCount(in ResourceHandle res) + internal ResourceHandle IncrementWriteCount(in ResourceHandle res) { CheckHandleValidity(res); - m_RenderGraphResources[res.iType].resourceArray[res.index].IncrementWriteCount(); + var version = (int)m_RenderGraphResources[res.iType].resourceArray[res.index].IncrementWriteCount(); + return new ResourceHandle(res, version); } internal void IncrementReadCount(in ResourceHandle res) @@ -359,40 +360,20 @@ internal void IncrementReadCount(in ResourceHandle res) CheckHandleValidity(res); m_RenderGraphResources[res.iType].resourceArray[res.index].IncrementReadCount(); } - - internal void NewVersion(in ResourceHandle res) - { - CheckHandleValidity(res); - m_RenderGraphResources[res.iType].resourceArray[res.index].NewVersion(); - } - + internal ResourceHandle GetLatestVersionHandle(in ResourceHandle res) { CheckHandleValidity(res); - var ver = m_RenderGraphResources[res.iType].resourceArray[res.index].version; - return new ResourceHandle(res, ver); + var version = (int)m_RenderGraphResources[res.iType].resourceArray[res.index].writeCount; + return new ResourceHandle(res, version); } - internal int GetLatestVersionNumber(in ResourceHandle res) - { - CheckHandleValidity(res); - var ver = m_RenderGraphResources[res.iType].resourceArray[res.index].version; - return ver; - } - - internal ResourceHandle GetZeroVersionedHandle(in ResourceHandle res) + internal ResourceHandle GetZeroVersionHandle(in ResourceHandle res) { CheckHandleValidity(res); return new ResourceHandle(res, 0); } - internal ResourceHandle GetNewVersionedHandle(in ResourceHandle res) - { - CheckHandleValidity(res); - var ver = m_RenderGraphResources[res.iType].resourceArray[res.index].NewVersion(); - return new ResourceHandle(res, ver); - } - internal IRenderGraphResource GetResourceLowLevel(in ResourceHandle res) { CheckHandleValidity(res); @@ -750,7 +731,7 @@ internal void GetRenderTargetInfo(in ResourceHandle res, out RenderTargetInfo ou // we can't know from the size/format/... from the enum. It's implicitly defined by the current camera, // screen resolution,.... we can't even hope to know or replicate the size calculation here // so we just say we don't know what this rt is and rely on the user passing in the info to us. - var desc = GetTextureResourceDesc(res, true); + ref readonly var desc = ref GetTextureResourceDesc(res, true); #if DEVELOPMENT_BUILD || UNITY_EDITOR if (desc.width == 0 || desc.height == 0 || desc.slices == 0 || desc.msaaSamples == 0 || desc.format == GraphicsFormat.None) { @@ -773,7 +754,7 @@ internal void GetRenderTargetInfo(in ResourceHandle res, out RenderTargetInfo ou else { // Managed by rendergraph, it might not be created yet so we look at the desc to find out - var desc = GetTextureResourceDesc(res); + ref readonly var desc = ref GetTextureResourceDesc(res); var dim = desc.CalculateFinalDimensions(); outInfo = new RenderTargetInfo(); outInfo.width = dim.x; @@ -851,13 +832,13 @@ internal TextureResource GetTextureResource(int index) return m_RenderGraphResources[(int)RenderGraphResourceType.Texture].resourceArray[index] as TextureResource; } - internal TextureDesc GetTextureResourceDesc(in ResourceHandle handle, bool noThrowOnInvalidDesc = false) + internal ref readonly TextureDesc GetTextureResourceDesc(in ResourceHandle handle, bool noThrowOnInvalidDesc = false) { Debug.Assert(handle.type == RenderGraphResourceType.Texture); var texture = (m_RenderGraphResources[(int)RenderGraphResourceType.Texture].resourceArray[handle.index] as TextureResource); if (!texture.validDesc && !noThrowOnInvalidDesc) throw new ArgumentException("The passed in texture handle does not have a valid descriptor. (This is most commonly cause by the handle referencing a built-in texture such as the system back buffer.)", "handle"); - return texture.desc; + return ref texture.desc; } internal RendererListHandle CreateRendererList(in CoreRendererListDesc desc) @@ -952,13 +933,13 @@ internal BufferHandle CreateBuffer(in BufferDesc desc, int transientPassIndex = return new BufferHandle(newHandle); } - internal BufferDesc GetBufferResourceDesc(in ResourceHandle handle, bool noThrowOnInvalidDesc = false) + internal ref readonly BufferDesc GetBufferResourceDesc(in ResourceHandle handle, bool noThrowOnInvalidDesc = false) { Debug.Assert(handle.type == RenderGraphResourceType.Buffer); var buffer = (m_RenderGraphResources[(int)RenderGraphResourceType.Buffer].resourceArray[handle.index] as BufferResource); if (!buffer.validDesc && !noThrowOnInvalidDesc) throw new ArgumentException("The passed in buffer handle does not have a valid descriptor. (This is most commonly cause by importing the buffer.)", "handle"); - return buffer.desc; + return ref buffer.desc; } internal int GetBufferResourceCount() diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs index eca99c43982..ee59eda2f7e 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceTexture.cs @@ -14,7 +14,7 @@ internal readonly struct TextureAccess public readonly int depthSlice; public readonly AccessFlags flags; - public TextureAccess(TextureHandle handle, AccessFlags flags, int mipLevel, int depthSlice) + public TextureAccess(in TextureHandle handle, AccessFlags flags, int mipLevel, int depthSlice) { this.textureHandle = handle; this.flags = flags; @@ -22,7 +22,7 @@ public TextureAccess(TextureHandle handle, AccessFlags flags, int mipLevel, int this.depthSlice = depthSlice; } - public TextureAccess(TextureAccess access, TextureHandle handle) + public TextureAccess(in TextureAccess access, in TextureHandle handle) { this.textureHandle = handle; this.flags = access.flags; @@ -97,7 +97,7 @@ internal enum TextureUVOriginSelection /// [DebuggerDisplay("Texture ({handle.index})")] [MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")] - public struct TextureHandle + public readonly struct TextureHandle { private static TextureHandle s_NullHandle = new TextureHandle(); @@ -107,9 +107,9 @@ public struct TextureHandle /// A null texture handle. public static TextureHandle nullHandle { get { return s_NullHandle; } } - internal ResourceHandle handle; + internal readonly ResourceHandle handle; - private bool builtin; + private readonly bool builtin; internal TextureHandle(in ResourceHandle h) { @@ -514,7 +514,6 @@ public Vector2Int CalculateFinalDimensions() TextureSizeMode.Functor => RTHandles.CalculateDimensions(func), _ => throw new ArgumentOutOfRangeException() }; - } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs index cfcf52956bf..0a34696ee40 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs @@ -136,7 +136,6 @@ class IRenderGraphResource public int cachedHash; public int transientPassIndex; public int sharedResourceLastFrameUsed; - public int version; [MethodImpl(MethodImplOptions.AggressiveInlining)] public virtual void Reset(IRenderGraphResourcePool _ = null) @@ -150,7 +149,6 @@ public virtual void Reset(IRenderGraphResourcePool _ = null) requestFallBack = false; writeCount = 0; readCount = 0; - version = 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -166,9 +164,10 @@ public virtual bool IsCreated() } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual void IncrementWriteCount() + public virtual uint IncrementWriteCount() { writeCount++; + return writeCount; } // readCount is currently not used in the HDRP Compiler. @@ -178,13 +177,6 @@ public virtual void IncrementReadCount() readCount++; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public virtual int NewVersion() - { - version++; - return version; - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public virtual bool NeedsFallBack() { diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderPipelineResources/GPUDriven/InstanceOcclusionCullingKernels.compute b/Packages/com.unity.render-pipelines.core/Runtime/RenderPipelineResources/GPUDriven/InstanceOcclusionCullingKernels.compute index fd055762f53..6c9fc7378a6 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderPipelineResources/GPUDriven/InstanceOcclusionCullingKernels.compute +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderPipelineResources/GPUDriven/InstanceOcclusionCullingKernels.compute @@ -18,17 +18,22 @@ #define OCCLUSION_ANY_PASS #endif -#define DRAW_ARGS_INDEX(N) (5*(_DrawInfoAllocIndex + (N))) -#define DRAW_ARGS_INDEX_INDIRECT_DISPATCH DRAW_ARGS_INDEX(_DrawInfoCount) -#define DRAW_ARGS_INDEX_INSTANCE_COUNTER (DRAW_ARGS_INDEX_INDIRECT_DISPATCH + 3) +#define DRAW_ARGS_PARAMETER_COUNT 5 +#define DRAW_ARGS_INSTANCE_COUNT_PARAMETER_OFFSET 1 +#define DRAW_ARGS_INDEX(N) (DRAW_ARGS_PARAMETER_COUNT*(_DrawInfoAllocIndex + (N))) +#define DRAW_ARGS_INDEX_INDIRECT_DISPATCH DRAW_ARGS_INDEX(_DrawInfoCount) +#define DRAW_ARGS_INDEX_INSTANCE_COUNTER (DRAW_ARGS_INDEX_INDIRECT_DISPATCH + 3) #define INSTANCE_INFO_OFFSET_SECOND_PASS(N) (_InstanceInfoCount + (N)) // buffers allocate 2 sets of instance info per instance (for the second pass) #define INSTANCE_ALLOC_INDEX (_InstanceInfoAllocIndex/2) +#define THREAD_GROUP_SIZE 64 + StructuredBuffer _DrawInfo; RWStructuredBuffer _InstanceInfo; +RWStructuredBuffer _DispatchArgs; RWStructuredBuffer _DrawArgs; RWByteAddressBuffer _InstanceIndices; ByteAddressBuffer _InstanceDataBuffer; @@ -66,7 +71,7 @@ SphereBound LoadInstanceBoundingSphere(uint instanceID) return b; } -[numthreads(64,1,1)] +[numthreads(THREAD_GROUP_SIZE, 1, 1)] void ResetDrawArgs(uint drawInfoOffset : SV_DispatchThreadID) { if (drawInfoOffset < _DrawInfoCount) @@ -84,11 +89,11 @@ void ResetDrawArgs(uint drawInfoOffset : SV_DispatchThreadID) if (drawInfoOffset == 0) { #ifdef OCCLUSION_SECOND_PASS - // convert to dispatch args - uint argsBase = DRAW_ARGS_INDEX_INDIRECT_DISPATCH; - _DrawArgs[argsBase + 0] = (_DrawArgs[DRAW_ARGS_INDEX_INSTANCE_COUNTER] + 63)/64; - _DrawArgs[argsBase + 1] = 1; - _DrawArgs[argsBase + 2] = 1; + // convert to compute dispatch args + uint argsBase = 0; + _DispatchArgs[argsBase + 0] = (_DrawArgs[DRAW_ARGS_INDEX_INSTANCE_COUNTER] + (THREAD_GROUP_SIZE-1)) / THREAD_GROUP_SIZE; + _DispatchArgs[argsBase + 1] = 1; + _DispatchArgs[argsBase + 2] = 1; #else // zero the instance count _DrawArgs[DRAW_ARGS_INDEX_INSTANCE_COUNTER] = 0; @@ -96,7 +101,7 @@ void ResetDrawArgs(uint drawInfoOffset : SV_DispatchThreadID) } } -[numthreads(64, 1, 1)] +[numthreads(THREAD_GROUP_SIZE, 1, 1)] void CopyInstances(uint dispatchIdx : SV_DispatchThreadID) { if (dispatchIdx < _DrawInfoCount) @@ -133,7 +138,7 @@ uint GetPrimitiveCount(uint indexCount, uint topology, bool nativeQuads) } } -[numthreads(64,1,1)] +[numthreads(THREAD_GROUP_SIZE, 1, 1)] void CullInstances(uint instanceInfoOffset : SV_DispatchThreadID) { uint instanceInfoCount = GetInstanceInfoCount(); @@ -202,7 +207,7 @@ void CullInstances(uint instanceInfoOffset : SV_DispatchThreadID) { uint argsBase = DRAW_ARGS_INDEX(drawOffset); uint offsetWithinDraw = 0; - InterlockedAdd(_DrawArgs[argsBase + 1], 1 << _InstanceMultiplierShift, offsetWithinDraw); // IndirectDrawIndexedArgs.instanceCount + InterlockedAdd(_DrawArgs[argsBase + DRAW_ARGS_INSTANCE_COUNT_PARAMETER_OFFSET], 1 << _InstanceMultiplierShift, offsetWithinDraw); // IndirectDrawIndexedArgs.instanceCount offsetWithinDraw = offsetWithinDraw >> _InstanceMultiplierShift; IndirectDrawInfo drawInfo = LoadDrawInfo(drawOffset); diff --git a/Packages/com.unity.render-pipelines.core/Runtime/STP/STP.cs b/Packages/com.unity.render-pipelines.core/Runtime/STP/STP.cs index e37aa350392..a7bcbc6941f 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/STP/STP.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/STP/STP.cs @@ -1047,7 +1047,7 @@ class TaaData } // Internal helper function used to streamline usage of the render graph API - static TextureHandle UseTexture(IBaseRenderGraphBuilder builder, TextureHandle texture, AccessFlags flags = AccessFlags.Read) + static TextureHandle UseTexture(IBaseRenderGraphBuilder builder, in TextureHandle texture, AccessFlags flags = AccessFlags.Read) { builder.UseTexture(texture, flags); return texture; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs index a14bccf7ed8..35735aeb565 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Common/AccelStructAdapter.cs @@ -131,14 +131,14 @@ void AddHeightmap(TerrainDesc terrainDesc, ref List instanceHandles void AddTrees(TerrainDesc terrainDesc, ref List instanceHandles) { TerrainData terrainData = terrainDesc.terrain.terrainData; - float4x4 terrainLocalToWorld = terrainDesc.localToWorldMatrix; - float3 positionScale = new float3((float)terrainData.heightmapResolution, 1.0f, (float)terrainData.heightmapResolution) * terrainData.heightmapScale; - float3 positionOffset = new float3(terrainLocalToWorld[3].x, terrainLocalToWorld[3].y, terrainLocalToWorld[3].z); + Matrix4x4 terrainLocalToWorld = terrainDesc.localToWorldMatrix; + Vector3 positionScale = Vector3.Scale(new Vector3(terrainData.heightmapResolution, 1.0f, terrainData.heightmapResolution), terrainData.heightmapScale); + Vector3 positionOffset = terrainLocalToWorld.GetPosition(); foreach (var treeInstance in terrainData.treeInstances) { var localToWorld = Matrix4x4.TRS( - positionOffset + new float3(treeInstance.position) * positionScale, + positionOffset + Vector3.Scale(treeInstance.position, positionScale), Quaternion.AngleAxis(treeInstance.rotation, Vector3.up), new Vector3(treeInstance.widthScale, treeInstance.heightScale, treeInstance.widthScale)); diff --git a/Packages/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs b/Packages/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs index 6422e619858..7af25de6a5b 100644 --- a/Packages/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs +++ b/Packages/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs @@ -43,70 +43,112 @@ class RenderGraphTestPassData public BufferHandle[] buffers = new BufferHandle[8]; } - // Final output (back buffer) of render graph needs to be explicitly imported in order to know that the chain of dependency should not be culled. - [Test] - public void WriteToBackBufferNotCulled() + TextureDesc SimpleTextureDesc(string name, int w, int h, int samples) { - using (var builder = m_RenderGraph.AddUnsafePass("TestPass0", out var passData)) + TextureDesc result = new TextureDesc(w, h); + result.msaaSamples = (MSAASamples)samples; + result.format = GraphicsFormat.R8G8B8A8_UNorm; + result.name = name; + return result; + } + + class TestRenderTargets + { + public TextureHandle backBuffer; + public TextureHandle depthBuffer; + public TextureHandle[] extraTextures = new TextureHandle[10]; + public TextureHandle extraDepthBuffer; + public TextureHandle extraDepthBufferBottomLeft; + }; + + TestRenderTargets ImportAndCreateRenderTargets(RenderGraph g, TextureUVOrigin backBufferUVOrigin = TextureUVOrigin.BottomLeft) + { + TestRenderTargets result = new TestRenderTargets(); + var backBuffer = BuiltinRenderTextureType.CameraTarget; + var backBufferHandle = RTHandles.Alloc(backBuffer, "Backbuffer Color"); + var depthBuffer = BuiltinRenderTextureType.Depth; + var depthBufferHandle = RTHandles.Alloc(depthBuffer, "Backbuffer Depth"); + var extraDepthBufferHandle = RTHandles.Alloc(depthBuffer, "Extra Depth Buffer"); + var extraDepthBufferBottomLeftHandle = RTHandles.Alloc(depthBuffer, "Extra Depth Buffer Bottom Left"); + + ImportResourceParams importParams = new ImportResourceParams(); + importParams.textureUVOrigin = backBufferUVOrigin; + + RenderTargetInfo importInfo = new RenderTargetInfo(); + RenderTargetInfo importInfoDepth = new RenderTargetInfo(); + importInfo.width = 1024; + importInfo.height = 768; + importInfo.volumeDepth = 1; + importInfo.msaaSamples = 1; + importInfo.format = GraphicsFormat.R16G16B16A16_SFloat; + result.backBuffer = g.ImportTexture(backBufferHandle, importInfo, importParams); + + importInfoDepth = importInfo; + importInfoDepth.format = GraphicsFormat.D32_SFloat_S8_UInt; + result.depthBuffer = g.ImportTexture(depthBufferHandle, importInfoDepth, importParams); + + importInfo.format = GraphicsFormat.D24_UNorm; + result.extraDepthBuffer = g.ImportTexture(extraDepthBufferHandle, importInfoDepth, importParams); + + importParams.textureUVOrigin = TextureUVOrigin.BottomLeft; + result.extraDepthBufferBottomLeft = g.ImportTexture(extraDepthBufferBottomLeftHandle, importInfoDepth, importParams); + + for (int i = 0; i < result.extraTextures.Length; i++) { - builder.UseTexture(m_RenderGraph.ImportBackbuffer(0), AccessFlags.Write); - builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + result.extraTextures[i] = g.CreateTexture(SimpleTextureDesc("ExtraTexture" + i, 1024, 768, 1)); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); - - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(1, compiledPasses.size); - Assert.AreEqual(false, compiledPasses[0].culled); + return result; } - // If no back buffer is ever written to, everything should be culled. [Test] - public void NoWriteToBackBufferCulled() + public void NoWriteToImportedTextureCulled() { - using (var builder = m_RenderGraph.AddUnsafePass("TestPass0", out var passData)) + var renderTargets = ImportAndCreateRenderTargets(m_RenderGraph); + + using (var builder = m_RenderGraph.AddRasterRenderPass("TestPass0", out var passData)) { - builder.UseTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }), AccessFlags.WriteAll); - builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + builder.UseTexture(renderTargets.backBuffer, AccessFlags.Write); + builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(1, compiledPasses.size); - Assert.AreEqual(true, compiledPasses[0].culled); + Assert.AreEqual(1, compiledPasses.Count); + Assert.AreEqual(false, compiledPasses[0].culled); } - // Writing to imported resource is considered as a side effect so passes should not be culled. + // If no back buffer is ever written to, everything should be culled. [Test] - public void WriteToImportedTextureNotCulled() + public void WriteToRenderGraphTextureCulled() { - using (var builder = m_RenderGraph.AddUnsafePass("TestPass0", out var passData)) + using (var builder = m_RenderGraph.AddRasterRenderPass("TestPass0", out var passData)) { - builder.UseTexture(m_RenderGraph.ImportTexture(null), AccessFlags.Write); - builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + builder.UseTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }), AccessFlags.WriteAll); + builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(1, compiledPasses.size); - Assert.AreEqual(false, compiledPasses[0].culled); + Assert.AreEqual(1, compiledPasses.Count); + Assert.AreEqual(true, compiledPasses[0].culled); } [Test] public void WriteToImportedComputeBufferNotCulled() { - using (var builder = m_RenderGraph.AddUnsafePass("TestPass0", out var passData)) + using (var builder = m_RenderGraph.AddRasterRenderPass("TestPass0", out var passData)) { builder.UseBuffer(m_RenderGraph.ImportBuffer(null), AccessFlags.Write); - builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + builder.SetRenderFunc((RenderGraphTestPassData data, RasterGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(1, compiledPasses.size); + Assert.AreEqual(1, compiledPasses.Count); Assert.AreEqual(false, compiledPasses[0].culled); } @@ -142,14 +184,14 @@ public void PassWriteResourcePartialNotReadAfterNotCulled() using (var builder = m_RenderGraph.AddUnsafePass("TestPass3", out var passData)) { builder.UseTexture(texture1, AccessFlags.Read); - builder.UseTexture(m_RenderGraph.ImportBackbuffer(0), AccessFlags.Write); // Needed for the passes to not be culled + builder.UseBuffer(m_RenderGraph.ImportBuffer(null), AccessFlags.Write); builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(4, compiledPasses.size); + Assert.AreEqual(4, compiledPasses.Count); Assert.AreEqual(false, compiledPasses[0].culled); Assert.AreEqual(false, compiledPasses[1].culled); Assert.AreEqual(false, compiledPasses[2].culled); @@ -166,10 +208,10 @@ public void PassDisallowCullingNotCulled() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(1, compiledPasses.size); + Assert.AreEqual(1, compiledPasses.Count); Assert.AreEqual(false, compiledPasses[0].culled); } @@ -191,10 +233,10 @@ public void PartialUnusedProductNotCulled() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(2, compiledPasses.size); + Assert.AreEqual(2, compiledPasses.Count); Assert.AreEqual(false, compiledPasses[0].culled); Assert.AreEqual(false, compiledPasses[1].culled); } @@ -226,12 +268,24 @@ public void SimpleCreateReleaseTexture() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(4, compiledPasses.size); - Assert.Contains(texture.handle.index, compiledPasses[0].resourceCreateList[(int)RenderGraphResourceType.Texture]); - Assert.Contains(texture.handle.index, compiledPasses[3].resourceReleaseList[(int)RenderGraphResourceType.Texture]); + var firstUsedResPass0List = new List(); + foreach (ref readonly var res in compiledPasses[0].FirstUsedResources(result.contextData)) + { + firstUsedResPass0List.Add(res.index); + } + + var lastUsedResPass3List = new List(); + foreach (ref readonly var res in compiledPasses[3].LastUsedResources(result.contextData)) + { + lastUsedResPass3List.Add(res.index); + } + + Assert.AreEqual(4, compiledPasses.Count); + Assert.Contains(texture.handle.index, firstUsedResPass0List); + Assert.Contains(texture.handle.index, lastUsedResPass3List); } [Test] @@ -253,7 +307,7 @@ public void UseTransientOutsidePassRaiseException() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); }); } @@ -268,12 +322,24 @@ public void TransientCreateReleaseInSamePass() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); + + var firstUsedResList = new List(); + foreach (ref readonly var res in compiledPasses[0].FirstUsedResources(result.contextData)) + { + firstUsedResList.Add(res.index); + } + + var lastUsedResList = new List(); + foreach (ref readonly var res in compiledPasses[0].LastUsedResources(result.contextData)) + { + lastUsedResList.Add(res.index); + } - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(1, compiledPasses.size); - Assert.Contains(texture.handle.index, compiledPasses[0].resourceCreateList[(int)RenderGraphResourceType.Texture]); - Assert.Contains(texture.handle.index, compiledPasses[0].resourceReleaseList[(int)RenderGraphResourceType.Texture]); + Assert.AreEqual(1, compiledPasses.Count); + Assert.Contains(texture.handle.index, firstUsedResList); + Assert.Contains(texture.handle.index, lastUsedResList); } // Texture that should be released during an async pass should have their release delayed until the first pass that syncs with the compute pipe. @@ -345,12 +411,126 @@ public void AsyncPassReleaseTextureOnGraphicsPipe() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + // Final pass to ensure we don't simply allocate resource used by async queue until the end of the frame + using (var builder = m_RenderGraph.AddUnsafePass("TestPass6", out var passData)) + { + builder.UseTexture(texture3, AccessFlags.Read); + builder.UseTexture(m_RenderGraph.ImportBackbuffer(0), AccessFlags.Write); // Needed for the passes to not be culled + builder.EnableAsyncCompute(false); + builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + } + + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); + + var releasedResourcePass4List = new List(); + foreach (ref readonly var releasedRes in compiledPasses[4].LastUsedResources(result.contextData)) + { + releasedResourcePass4List.Add(releasedRes.index); + } + + Assert.AreEqual(7, compiledPasses.Count); + Assert.AreEqual(5, compiledPasses[2].awaitingMyGraphicsFencePassId); + Assert.AreEqual(2, compiledPasses[5].waitOnGraphicsFencePassId); + + Assert.Contains(texture0.handle.index, releasedResourcePass4List); + Assert.Contains(texture2.handle.index, releasedResourcePass4List); + } + + [Test] + public void AsyncPassReleaseTextureOnGraphicsPipeAtLastNonCulledPass_WhenNoFence() + { + TextureHandle texture0 = + m_RenderGraph.CreateTexture( + new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); + TextureHandle texture1 = + m_RenderGraph.CreateTexture( + new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); + TextureHandle texture2; // transient texture + TextureHandle texture3 = + m_RenderGraph.CreateTexture( + new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); + + // First pass creates and writes two textures. + using (var builder = m_RenderGraph.AddUnsafePass("Async_TestPass0", out var passData)) + { + builder.UseTexture(texture0, AccessFlags.Write); + builder.UseTexture(texture1, AccessFlags.Write); + builder.EnableAsyncCompute(true); + builder.AllowPassCulling(false); + builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + } + + // Second pass creates a transient texture => Create/Release should happen in this pass but we want to delay the release until the first graphics pipe pass that sync with async queue. + using (var builder = m_RenderGraph.AddUnsafePass("Async_TestPass1", out var passData)) + { + texture2 = builder.CreateTransientTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); + builder.UseTexture(texture0, AccessFlags.Write); + builder.EnableAsyncCompute(true); + builder.AllowPassCulling(false); + builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + } + + // This pass is the last to read texture0 => Release should happen in this pass but we want to delay the release until the first graphics pipe pass that sync with async queue. + using (var builder = m_RenderGraph.AddUnsafePass("Async_TestPass2", out var passData)) + { + builder.UseTexture(texture0, AccessFlags.Read); + builder.UseTexture(texture1, AccessFlags.Write); + builder.EnableAsyncCompute(true); + builder.AllowPassCulling(false); + builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + } + + // Just here to add "padding" to the number of passes to ensure resources are not released right at the first sync pass. + using (var builder = m_RenderGraph.AddUnsafePass("TestPass3", out var passData)) + { + builder.UseTexture(texture3, AccessFlags.Write); + builder.EnableAsyncCompute(false); + builder.AllowPassCulling(false); + builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + } + + // Final non culled pass where we should release textures as there is no sync with async queue + using (var builder = m_RenderGraph.AddUnsafePass("TestPass4", out var passData)) + { + builder.UseTexture(texture3, AccessFlags.Read); + builder.EnableAsyncCompute(false); + builder.AllowPassCulling(false); + builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + } + + // Final pass that will be culled, so we need to release before to avoid leaking + using (var builder = m_RenderGraph.AddUnsafePass("TestPass5", out var passData)) + { + builder.UseTexture(texture3, AccessFlags.Read); + builder.EnableAsyncCompute(false); + builder.AllowPassCulling(true); + builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); + } + + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); + + var releasedResourcePass4List = new List(); + foreach (ref readonly var releasedRes in compiledPasses[4].LastUsedResources(result.contextData)) + { + releasedResourcePass4List.Add(releasedRes.index); + } + + Assert.AreEqual(6, compiledPasses.Count); + Assert.AreEqual(true, compiledPasses[5].culled); + + // No sync between the two queues (for some probably weird/incorrect reasons but still worth considering) + Assert.AreEqual(-1, compiledPasses[0].awaitingMyGraphicsFencePassId); + Assert.AreEqual(-1, compiledPasses[1].awaitingMyGraphicsFencePassId); + Assert.AreEqual(-1, compiledPasses[2].waitOnGraphicsFencePassId); + Assert.AreEqual(-1, compiledPasses[3].waitOnGraphicsFencePassId); + Assert.AreEqual(-1, compiledPasses[4].waitOnGraphicsFencePassId); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(6, compiledPasses.size); - Assert.Contains(texture0.handle.index, compiledPasses[4].resourceReleaseList[(int)RenderGraphResourceType.Texture]); - Assert.Contains(texture2.handle.index, compiledPasses[4].resourceReleaseList[(int)RenderGraphResourceType.Texture]); + // As there is no fence, all resources used by the async queue should be released by the last pass + Assert.Contains(texture0.handle.index, releasedResourcePass4List); + Assert.Contains(texture1.handle.index, releasedResourcePass4List); + Assert.Contains(texture2.handle.index, releasedResourcePass4List); } [Test] @@ -379,10 +559,10 @@ public void TransientResourceNotCulled() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(3, compiledPasses.size); + Assert.AreEqual(3, compiledPasses.Count); Assert.AreEqual(false, compiledPasses[1].culled); } @@ -410,12 +590,12 @@ public void AsyncPassWriteWaitOnGraphicsPipe() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(3, compiledPasses.size); - Assert.AreEqual(0, compiledPasses[1].syncToPassIndex); - Assert.AreEqual(1, compiledPasses[2].syncToPassIndex); + Assert.AreEqual(3, compiledPasses.Count); + Assert.AreEqual(0, compiledPasses[1].waitOnGraphicsFencePassId); + Assert.AreEqual(1, compiledPasses[2].waitOnGraphicsFencePassId); } [Test] @@ -445,12 +625,12 @@ public void AsyncPassReadWaitOnGraphicsPipe() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(3, compiledPasses.size); - Assert.AreEqual(0, compiledPasses[1].syncToPassIndex); - Assert.AreEqual(1, compiledPasses[2].syncToPassIndex); + Assert.AreEqual(3, compiledPasses.Count); + Assert.AreEqual(0, compiledPasses[1].waitOnGraphicsFencePassId); + Assert.AreEqual(1, compiledPasses[2].waitOnGraphicsFencePassId); } [Test] @@ -480,11 +660,11 @@ public void GraphicsPassWriteWaitOnAsyncPipe() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(3, compiledPasses.size); - Assert.AreEqual(0, compiledPasses[1].syncToPassIndex); + Assert.AreEqual(3, compiledPasses.Count); + Assert.AreEqual(0, compiledPasses[1].waitOnGraphicsFencePassId); } [Test] @@ -506,11 +686,11 @@ public void GraphicsPassReadWaitOnAsyncPipe() builder.SetRenderFunc((RenderGraphTestPassData data, UnsafeGraphContext context) => { }); } - m_RenderGraph.CompileRenderGraph(m_RenderGraph.ComputeGraphHash()); + var result = m_RenderGraph.CompileNativeRenderGraph(m_RenderGraph.ComputeGraphHash()); + var compiledPasses = result.contextData.GetPasses(); - var compiledPasses = m_RenderGraph.GetCompiledPassInfos(); - Assert.AreEqual(2, compiledPasses.size); - Assert.AreEqual(0, compiledPasses[1].syncToPassIndex); + Assert.AreEqual(2, compiledPasses.Count); + Assert.AreEqual(0, compiledPasses[1].waitOnGraphicsFencePassId); } [Test] @@ -2112,64 +2292,6 @@ public void ResourcePool_TryGet() texturePool.Cleanup(); } - TextureDesc SimpleTextureDesc(string name, int w, int h, int samples) - { - TextureDesc result = new TextureDesc(w, h); - result.msaaSamples = (MSAASamples)samples; - result.format = GraphicsFormat.R8G8B8A8_UNorm; - result.name = name; - return result; - } - - class TestRenderTargets - { - public TextureHandle backBuffer; - public TextureHandle depthBuffer; - public TextureHandle[] extraTextures = new TextureHandle[10]; - public TextureHandle extraDepthBuffer; - public TextureHandle extraDepthBufferBottomLeft; - }; - - TestRenderTargets ImportAndCreateRenderTargets(RenderGraph g, TextureUVOrigin backBufferUVOrigin) - { - TestRenderTargets result = new TestRenderTargets(); - var backBuffer = BuiltinRenderTextureType.CameraTarget; - var backBufferHandle = RTHandles.Alloc(backBuffer, "Backbuffer Color"); - var depthBuffer = BuiltinRenderTextureType.Depth; - var depthBufferHandle = RTHandles.Alloc(depthBuffer, "Backbuffer Depth"); - var extraDepthBufferHandle = RTHandles.Alloc(depthBuffer, "Extra Depth Buffer"); - var extraDepthBufferBottomLeftHandle = RTHandles.Alloc(depthBuffer, "Extra Depth Buffer Bottom Left"); - - ImportResourceParams importParams = new ImportResourceParams(); - importParams.textureUVOrigin = backBufferUVOrigin; - - RenderTargetInfo importInfo = new RenderTargetInfo(); - RenderTargetInfo importInfoDepth = new RenderTargetInfo(); - importInfo.width = 1024; - importInfo.height = 768; - importInfo.volumeDepth = 1; - importInfo.msaaSamples = 1; - importInfo.format = GraphicsFormat.R16G16B16A16_SFloat; - result.backBuffer = g.ImportTexture(backBufferHandle, importInfo, importParams); - - importInfoDepth = importInfo; - importInfoDepth.format = GraphicsFormat.D32_SFloat_S8_UInt; - result.depthBuffer = g.ImportTexture(depthBufferHandle, importInfoDepth, importParams); - - importInfo.format = GraphicsFormat.D24_UNorm; - result.extraDepthBuffer = g.ImportTexture(extraDepthBufferHandle, importInfoDepth, importParams); - - importParams.textureUVOrigin = TextureUVOrigin.BottomLeft; - result.extraDepthBufferBottomLeft = g.ImportTexture(extraDepthBufferBottomLeftHandle, importInfoDepth, importParams); - - for (int i = 0; i < result.extraTextures.Length; i++) - { - result.extraTextures[i] = g.CreateTexture(SimpleTextureDesc("ExtraTexture" + i, 1024, 768, 1)); - } - - return result; - } - class UVOriginPassData { public TextureUVOrigin backBufferUVOrigin; diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/Material-Type.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/Material-Type.md index 5d64aec6bc8..78ee84189bb 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/Material-Type.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/Material-Type.md @@ -8,7 +8,7 @@ The **Material Type** property allows you to give your Material a type, which al | **Standard** | Applies the basic metallic Shader workflow to the Material. This is the default **Material Type**. | | **Anisotropy** | Applies the anisotropic workflow to the Material. The highlights of Anisotropic surfaces change in appearance as you view the Material from different angles. Use this **Material Type** to create Materials with anisotropic highlights. For example, brushed metal or velvet. | | **Iridescence** | Applies the Iridescence workflow to the Material. Iridescent surfaces appear to gradually change color as the angle of view or angle of illumination changes. Use this **Material Type** to create Materials like soap bubbles, iridescent metal, or insect wings. | -| **Specular Color** | Applies the Specular Color workflow to the Material. Use this **Material Type** to create Materials with a coloured specular highlight. This is similar to the [built-in Specular Shader](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterSpecular.html). | +| **Specular Color** | Applies the Specular Color workflow to the Material. Use this **Material Type** to create Materials with a coloured specular highlight. For more information, refer to [Metallic and specular workflows](https://docs.unity3d.com/Documentation/Manual/StandardShaderMetallicVsSpecular.html). | | **Translucent** | Applies the Translucent workflow to the Material. Use this **Material Type**, and a thickness map, to simulate a translucent object, such as a plant leaf. In contrast to **Subsurface Scattering** Materials, **Translucent** Materials do not blur light that transmits through the Material. | ![A detailed dragon statuette, rendered three times. The first dragon is iridescent, the second is a translucent green material, and the third has subsurface scattering.](Images/MaterialType1.png) diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-create-gameobject.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-create-gameobject.md index ae94a5da675..472f418a2fd 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-create-gameobject.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-create-gameobject.md @@ -19,6 +19,11 @@ To use a full-screen Custom Pass, you need to create a material for your Custom - [Create a Material from a full-screen shader graph](#material-from-fullscreen-shadergraph). - [Create a Material from a full-screen Custom Pass shader](#material-from-fullscreen-custompass). +You can also create the material and its shader directly from the **FullScreen Material** property in the [Custom Pass Volume](custom-pass-reference.md) Inspector by using the **New** dropdown with the following options: + +- **ShaderGraph**: Creates a new material or material variant from a new shader graph asset based on the **Fullscreen Basic HDRP** shader graph template. This is ideal for building fullscreen effects visually without writing shader code. +- **Handwritten Shader**: Creates a new handwritten shader using the HDRP fullscreen Custom Pass template. This is ideal if you prefer writing HLSL code for maximum control. + ### Create a Material from a full-screen Shader graph diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-reference.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-reference.md index 655306dcae3..27c7e2f555f 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-reference.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/custom-pass-reference.md @@ -21,7 +21,7 @@ Configure a full-screen Custom Pass in the **Custom Passes** panel using the fol | Target Depth Buffer | Select the buffer where Unity writes and tests the depth and stencil data.
This buffer does not contain transparent objects that have **Depth Write** enabled in the [shader properties](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/Lit-Shader.html).

When the Target Color Buffer and The Target Buffer are both set to **None** Unity does not execute a Custom Pass because there is no buffer to render to. | | Clear Flags | A clear flag discards the contents of a buffer before Unity executes this Custom Pass.
This property assigns a clear flag to one of the following buffers:
**None:** Doesn’t clear any buffers in this pass.
**Color:** Clears the depth buffer.
**Depth:** Clears the depth buffer and the stencil buffer.
**All:** Clears the data in the color, depth, and stencil buffers. | | Fetch Color Buffer | Enable this checkbox to allow this Custom Pass to read data from the color buffer.
This applies even when you enable [Multisampling anti-aliasing (MSAA)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/MSAA.html).

When you enable**Fetch Color Buffer** and MSAA, it forces the color buffer to resolve, and the Custom Pass uses one of the following injection points:
Before PreRefraction
Before Transparent
After Opaque Depth And Normal

A Custom Pass can’t read and write to the same render target. This means that you can’t enable **Fetch Color Buffer** and use **Target Color Buffer** at the same time. | -| FullScreen Material | The material this Custom Pass renders in your scene. | +| FullScreen Material | The material this Custom Pass renders in your scene. Use the **New** dropdown to create a new material and its associated shader from a template. The options are the following:
  • **ShaderGraph**: Creates a new material or material variant from a new shader graph asset based on the **Fullscreen Basic HDRP** shader graph template, which uses the default [**HDRP Fullscreen** material type](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/fullscreen-master-stack-reference.html).
    **Note**: To define if Unity creates a material or a material variant from the shader graph asset, refer to the **Graph Template Workflow** option in the [Shader Graph Preferences](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html?subfolder=/manual/Shader-Graph-Preferences.html).
  • **Handwritten Shader**: Creates a new handwritten shader using the HDRP fullscreen Custom Pass template.
| | Pass Name | Select the shader [Pass name](https://docs.unity3d.com/Manual/SL-Pass.html) that Unity uses to draw the full-screen quad. | ## Draw renderers Custom Pass properties diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/decal-projector-reference.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/decal-projector-reference.md index b2ae3dc79f0..a2118fd228b 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/decal-projector-reference.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/decal-projector-reference.md @@ -34,7 +34,7 @@ Using the Inspector allows you to change all of the Decal Projector properties, | **Size** | The size of the projector influence box, and thus the decal along the projected plane. The projector scales the decal to match the **Width** (along the local x-axis) and **Height** (along the local y-axis) components of the **Size**. | | **Projection Depth** | The depth of the projector influence box. The projector scales the decal to match **Projection Depth**. The Decal Projector component projects decals along the local z-axis. | | **Pivot** | The offset position of the transform regarding the projection box. To rotate the projected texture around a specific position, adjust the **X** and **Y** values. To set a depth offset for the projected texture, adjust the **Z** value. | -| **Material** | The decal Material to project. The decal Material must use a HDRP/Decal Shader. | +| **Material** | The decal Material to project. The decal Material must use a HDRP/Decal Shader. Use the **New** dropdown to create a new material and its associated shader from a template. The options are the following:
  • **HDRP Decal**: Creates a new decal Material that uses the default HDRP Decal Shader. This provides a ready‑to‑use decal shader set up for HDRP’s decal system.
  • **ShaderGraph Decal**: Creates a new material or material variant from a new shader graph asset based on the **Decal Simple** shader graph template, which uses the default [**HDRP Decal** material type](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/decal-master-stack-reference.html). This is recommended for building decals visually without writing shader code.
    **Note**: To define if Unity creates a material or a material variant from the shader graph asset, refer to the **Graph Template Workflow** option in the [Shader Graph Preferences](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html?subfolder=/manual/Shader-Graph-Preferences.html).
| | **Decal Layer** | The layer that specifies the Materials to project the decal onto. Any Mesh Renderers or Terrain that uses a matching Decal Layer receives the decal. | | **Draw Distance** | The distance from the Camera to the Decal at which this projector stops projecting the decal and HDRP no longer renders the decal. | | **Start Fade** | Use the slider to set the distance from the Camera at which the projector begins to fade out the decal. Scales from 0 to 1 and represents a percentage of the **Draw Distance**. A value of 0.9 begins fading the decal out at 90% of the **Draw Distance** and finished fading it out at the **Draw Distance**. | diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/shadows-visualize-and-adjust.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/shadows-visualize-and-adjust.md index 89986a1f7fe..347a8f9d0e6 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/shadows-visualize-and-adjust.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/shadows-visualize-and-adjust.md @@ -1,4 +1,4 @@ -## Visualize and adjust shadows +# Visualize and adjust shadows You can use the Shadows override to visualize the cascade sizes in the Inspector, and the boundaries of the cascades as they appear inside your Scene in real time. @@ -9,7 +9,8 @@ In the Inspector, use the **Cascade Splits** bar to see the size of each cascade In the Scene view and the Game view, the cascade visualization feature allows you to see the boundaries of each cascade in your Scene. Each color represents a separate cascade, and the colors match those in the **Cascade Splits** bar. This allows you to see which colored area matches which cascade. -![Cascade visualization example.](/Images/Override-Shadows3.png) +![A visualization of shadow cascades in the default Unity sample scene. Each shadow cascade displays as a concentric coloured circle.](Images/Override-Shadows3.png)
+A visualization of shadow cascades in the default Unity sample scene. Each shadow cascade displays as a concentric coloured circle. To enable the cascade visualization feature, select **Show Cascades** at the top of the list of **Shadows** properties. You can now see the shadow maps in the Scene view and the Game view. diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/base-color-parametrization.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/base-color-parametrization.md index bbc2a172f35..b6f657ea342 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/base-color-parametrization.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/base-color-parametrization.md @@ -2,5 +2,5 @@ Base Color Parametrization N/A N/A -Specifies the method to set color and reflectance properties of the material. The options are:
Base Metallic: Applies the basic metallic Shader workflow to the material. In the StackLit shader, when Metallic is 0, Dielectric Ior determines the specular color of the base layer.
Specular Color: Applies the Specular Color workflow to the material. Use this to create Materials with a coloured specular highlight. This is similar to the built-in Specular Shader. +Specifies the method to set color and reflectance properties of the material. The options are:
Base Metallic: Applies the basic metallic Shader workflow to the material. In the StackLit shader, when Metallic is 0, Dielectric Ior determines the specular color of the base layer.
Specular Color: Applies the Specular Color workflow to the material. Use this to create Materials with a coloured specular highlight. For more information, refer to Metallic and specular workflows. diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/material-type.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/material-type.md index 81f9c1eb1d0..25d0c2b2fc0 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/material-type.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/material-type.md @@ -2,5 +2,5 @@ Material Type N/A N/A -Specifies a type for the material. This allows you to customize the material with different settings depending on the type you select. The options are:
• Subsurface Scattering: Applies the subsurface scattering workflow to the material. Subsurface scattering simulates the way light interacts with and penetrates translucent objects, such as skin or plant leaves. When light penetrates the surface of a subsurface scattering material, it scatters and blurs before exiting the surface at a different point.
• Standard: Applies the basic metallic Shader workflow to the material. This is the default Material Type.
• Anisotropy: Applies the anisotropic workflow to the material. The highlights of Anisotropic surfaces change in appearance as you view the material from different angles. Use this Material Type to create materials with anisotropic highlights. For example, brushed metal or velvet.
• Iridescence: Applies the Iridescence workflow to the material. Iridescent surfaces appear to gradually change color as the angle of view or angle of illumination changes. Use this Material Type to create materials like soap bubbles, iridescent metal, or insect wings.
• Specular Color: Applies the Specular Color workflow to the material. Use this Material Type to create Materials with a coloured specular highlight. This is similar to the built-in Specular Shader.
• Translucent: Applies the Translucent workflow to the material. Use this Material Type, and a thickness map, to simulate a translucent material. In contrast to Subsurface Scattering materials, Translucent materials do not blur light that transmits through the material.
For more information about the feature and for the list of properties each Material Type exposes, see the Material Type documentation. +Specifies a type for the material. This allows you to customize the material with different settings depending on the type you select. The options are:
• Subsurface Scattering: Applies the subsurface scattering workflow to the material. Subsurface scattering simulates the way light interacts with and penetrates translucent objects, such as skin or plant leaves. When light penetrates the surface of a subsurface scattering material, it scatters and blurs before exiting the surface at a different point.
• Standard: Applies the basic metallic Shader workflow to the material. This is the default Material Type.
• Anisotropy: Applies the anisotropic workflow to the material. The highlights of Anisotropic surfaces change in appearance as you view the material from different angles. Use this Material Type to create materials with anisotropic highlights. For example, brushed metal or velvet.
• Iridescence: Applies the Iridescence workflow to the material. Iridescent surfaces appear to gradually change color as the angle of view or angle of illumination changes. Use this Material Type to create materials like soap bubbles, iridescent metal, or insect wings.
• Specular Color: Applies the Specular Color workflow to the material. Use this Material Type to create Materials with a coloured specular highlight. For more information, refer to Metallic and specular workflows.
• Translucent: Applies the Translucent workflow to the material. Use this Material Type, and a thickness map, to simulate a translucent material. In contrast to Subsurface Scattering materials, Translucent materials do not blur light that transmits through the material.
For more information about the feature and for the list of properties each Material Type exposes, see the Material Type documentation. diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/use-decals.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/use-decals.md index 26d9f17088a..4097f3c7781 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/use-decals.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/use-decals.md @@ -8,6 +8,10 @@ The High Definition Render Pipeline (HDRP) includes the following ways to create To use these methods, you need to create a decal Material. A decal Material is a Material that uses the [Decal Shader](Decal-Shader.md) or [Decal Master Stack](master-stack-decal.md). You can then place or project your decal Material into a Scene. +You can also create the decal Material and its shader directly from the **Material** field in the [Decal Projector](decal-projector-reference.md) Inspector by using the **New** dropdown with the following options: +- **HDRP Decal**: Creates a new decal Material that uses the default HDRP Decal Shader. +- **ShaderGraph Decal**: Creates a new material or material variant from a new shader graph asset based on the **Decal Simple** shader graph template, which uses the default [**HDRP Decal** material type](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/decal-master-stack-reference.html). This is ideal for building custom decals visually without writing shader code. + ![Decal shader.](Images/HDRPFeatures-DecalShader.png) ## Decal Layers diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightEditor.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightEditor.cs index 5e1f6f62032..517a2e41035 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightEditor.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightEditor.cs @@ -66,6 +66,9 @@ void OnUndoRedo() foreach (var hdLightData in m_AdditionalLightDatas) if (hdLightData != null) { + if (hdLightData.lightIdxForCachedShadows >= 0) // If it is within the cached system we need to evict it. + HDShadowManager.cachedShadowManager.EvictLight(hdLightData, hdLightData.legacyLight.type); + hdLightData.UpdateAreaLightEmissiveMesh(); hdLightData.UpdateRenderEntity(); } diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/ShaderPass.template.hlsl b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/ShaderPass.template.hlsl index d5fbc8ec195..9510cb8e922 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/ShaderPass.template.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/ShaderPass.template.hlsl @@ -89,7 +89,7 @@ void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDes // Just use the value passed through via the slot (not active otherwise) #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) // If we have bent normal and ambient occlusion, process a specular occlusion - surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #endif diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/ShaderPass.template.hlsl b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/ShaderPass.template.hlsl index f462d96f711..18543296072 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/ShaderPass.template.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/ShaderPass.template.hlsl @@ -96,7 +96,7 @@ void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDes // Just use the value passed through via the slot (not active otherwise) #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) // If we have bent normal and ambient occlusion, process a specular occlusion - surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #endif diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/ShaderPass.template.hlsl b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/ShaderPass.template.hlsl index c0b26b4ba29..b6bda6e4bae 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/ShaderPass.template.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/ShaderPass.template.hlsl @@ -136,7 +136,7 @@ void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDes // Just use the value passed through via the slot (not active otherwise) #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) // If we have bent normal and ambient occlusion, process a specular occlusion - surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, N, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, N, surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(N, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #endif diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/ShaderPass.template.hlsl b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/ShaderPass.template.hlsl index c9a5e99713d..0acc9e1d765 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/ShaderPass.template.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/ShaderPass.template.hlsl @@ -132,7 +132,7 @@ void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDes // Just use the value passed through via the slot (not active otherwise) #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) // If we have bent normal and ambient occlusion, process a specular occlusion - surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); #endif diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 5ea69f4da34..7ded743ff74 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -2125,6 +2125,11 @@ void UnregisterRenderingDebug() internal void RegisterDebug() { +#if UNITY_EDITOR + if (UnityEditor.BuildPipeline.isBuildingPlayer) + return; +#endif + RegisterMaterialDebug(); RegisterLightingDebug(); RegisterRenderingDebug(); @@ -2142,6 +2147,9 @@ internal void UnregisterDebug() void UnregisterDebugItems(string panelName, DebugUI.Widget[] items) { + if (items == null || items.Length == 0) + return; + var panel = DebugManager.instance.GetPanel(panelName); if (panel != null) panel.children.Remove(items); diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/NVIDIADebugView.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/NVIDIADebugView.cs index 8dbe3cb690f..7117e788231 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/NVIDIADebugView.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/NVIDIADebugView.cs @@ -31,18 +31,12 @@ private enum DeviceState private GraphicsDeviceDebugView m_DebugView = null; - private class Container where T : struct - { - public T data = new T(); - } - private class Data { public DeviceState deviceState = DeviceState.Unknown; public bool dlssSupported = false; - public Container[] dlssFeatureInfos = null; + public DLSSDebugFeatureInfos[] dlssFeatureInfos = null; } - private Data m_Data = new Data(); private void InternalReset() @@ -92,39 +86,20 @@ private void InternalUpdate() bool isPluginLoaded = NVUnityPlugin.IsLoaded(); m_Data.deviceState = isPluginLoaded ? DeviceState.DeviceCreationFailed : DeviceState.MissingPluginDLL; m_Data.dlssSupported = false; - ClearFeatureStateContainer(m_Data.dlssFeatureInfos); } UpdateDebugUITable(); } - private static void ClearFeatureStateContainer(Container[] containerArray) - { - for (int i = 0; i < containerArray.Length; ++i) - { - containerArray[i].data = new DLSSDebugFeatureInfos(); - } - } - - private static void TranslateDlssFeatureArray(Container[] containerArray, in GraphicsDeviceDebugView debugView) + private static void TranslateDlssFeatureArray(DLSSDebugFeatureInfos[] featureArray, in GraphicsDeviceDebugView debugView) { - ClearFeatureStateContainer(containerArray); - if (!debugView.dlssFeatureInfos.Any()) - return; - - //copy data over - int i = 0; - foreach (var featureInfo in debugView.dlssFeatureInfos) - { - if (i == containerArray.Length) - break; - containerArray[i++].data = featureInfo; - } + new Span(featureArray).Clear(); // Clear the local array first. + debugView.dlssFeatureInfosSpan.CopyTo(featureArray); // Directly copy the data from the source span to the destination array. } -#endregion + #endregion -#region Debug User Interface + #region Debug User Interface private const int MaxDebugRows = 4; private DebugUI.Container m_DebugWidget = null; @@ -161,7 +136,7 @@ private DebugUI.Widget InternalCreateWidget() m_DlssViewStateTable = new DebugUI.Table() { - displayName = "DLSS Slot ID", + displayName = "Feature Slot ID", isReadOnly = true }; @@ -199,7 +174,7 @@ private DebugUI.Widget InternalCreateWidget() } }; - m_Data.dlssFeatureInfos = new Container[MaxDebugRows]; + m_Data.dlssFeatureInfos = new DLSSDebugFeatureInfos[MaxDebugRows]; m_DlssViewStateTableRows = new DebugUI.Table.Row[m_Data.dlssFeatureInfos.Length]; String resToString(uint a, uint b) @@ -209,22 +184,17 @@ String resToString(uint a, uint b) for (int r = 0; r < m_Data.dlssFeatureInfos.Length; ++r) { - var c = new Container() - { - data = new DLSSDebugFeatureInfos() - }; - m_Data.dlssFeatureInfos[r] = c; - - string GetPresetLabel(DLSSQuality quality) + int currentIndex = r; + string GetPresetLabel(DLSSQuality quality, int index) { DLSSPreset presetValue = DLSSPreset.Preset_Default; switch (quality) { - case DLSSQuality.DLAA: presetValue = c.data.initData.presetDlaaMode; break; - case DLSSQuality.Balanced: presetValue = c.data.initData.presetBalancedMode; break; - case DLSSQuality.MaximumQuality: presetValue = c.data.initData.presetQualityMode; break; - case DLSSQuality.UltraPerformance: presetValue = c.data.initData.presetUltraPerformanceMode; break; - case DLSSQuality.MaximumPerformance: presetValue = c.data.initData.presetPerformanceMode; break; + case DLSSQuality.DLAA: presetValue = m_Data.dlssFeatureInfos[index].initData.presetDlaaMode; break; + case DLSSQuality.Balanced: presetValue = m_Data.dlssFeatureInfos[index].initData.presetBalancedMode; break; + case DLSSQuality.MaximumQuality: presetValue = m_Data.dlssFeatureInfos[index].initData.presetQualityMode; break; + case DLSSQuality.UltraPerformance: presetValue = m_Data.dlssFeatureInfos[index].initData.presetUltraPerformanceMode; break; + case DLSSQuality.MaximumPerformance: presetValue = m_Data.dlssFeatureInfos[index].initData.presetPerformanceMode; break; } string presetLabel = presetValue.ToString(); int delimiterIndex = presetLabel.IndexOf(" - "); // trim explanation from explanation separator token @@ -239,28 +209,28 @@ string GetPresetLabel(DLSSQuality quality) { new DebugUI.Value() { - getter = () => c.data.validFeature ? "Valid" : "-" + getter = () => m_Data.dlssFeatureInfos[currentIndex].validFeature ? "Valid" : "-" }, new DebugUI.Value() { - getter = () => c.data.validFeature ? resToString(c.data.execData.subrectWidth, c.data.execData.subrectHeight) : "-" + getter = () => m_Data.dlssFeatureInfos[currentIndex].validFeature ? resToString(m_Data.dlssFeatureInfos[currentIndex].execData.subrectWidth, m_Data.dlssFeatureInfos[currentIndex].execData.subrectHeight) : "-" }, new DebugUI.Value() { - getter = () => c.data.validFeature ? resToString(c.data.initData.outputRTWidth, c.data.initData.outputRTHeight) : "-" + getter = () => m_Data.dlssFeatureInfos[currentIndex].validFeature ? resToString(m_Data.dlssFeatureInfos[currentIndex].initData.outputRTWidth, m_Data.dlssFeatureInfos[currentIndex].initData.outputRTHeight) : "-" }, new DebugUI.Value() { - getter = () => c.data.validFeature ? c.data.initData.quality.ToString() : "-" + getter = () => m_Data.dlssFeatureInfos[currentIndex].validFeature ? m_Data.dlssFeatureInfos[currentIndex].initData.quality.ToString() : "-" }, new DebugUI.Value() { - getter = () => c.data.validFeature ? GetPresetLabel(c.data.initData.quality) : "-" + getter = () => m_Data.dlssFeatureInfos[currentIndex].validFeature ? GetPresetLabel(m_Data.dlssFeatureInfos[currentIndex].initData.quality, currentIndex) : "-" } } }; - dlssStateRow.isHiddenCallback = () => !c.data.validFeature; - m_DlssViewStateTableRows[r] = dlssStateRow; + dlssStateRow.isHiddenCallback = () => !m_Data.dlssFeatureInfos[currentIndex].validFeature; + m_DlssViewStateTableRows[currentIndex] = dlssStateRow; } m_DlssViewStateTable.children.Add(m_DlssViewStateTableRows); m_DlssViewStateTable.isHiddenCallback = () => @@ -281,8 +251,32 @@ private void UpdateDebugUITable() { for (int r = 0; r < m_DlssViewStateTableRows.Length; ++r) { - var d = m_Data.dlssFeatureInfos[r].data; - m_DlssViewStateTableRows[r].displayName = d.validFeature ? Convert.ToString(d.featureSlot) : ""; + var d = m_Data.dlssFeatureInfos[r]; + m_DlssViewStateTableRows[r].displayName = ""; + if(d.validFeature) + { + // we know we dont support more than 16 features at one time on the plugin side. + // here's an allocation-free way to setup display name string values. + switch (d.featureSlot) + { + case 0: m_DlssViewStateTableRows[r].displayName = "0"; break; + case 1: m_DlssViewStateTableRows[r].displayName = "1"; break; + case 2: m_DlssViewStateTableRows[r].displayName = "2"; break; + case 3: m_DlssViewStateTableRows[r].displayName = "3"; break; + case 4: m_DlssViewStateTableRows[r].displayName = "4"; break; + case 5: m_DlssViewStateTableRows[r].displayName = "5"; break; + case 6: m_DlssViewStateTableRows[r].displayName = "6"; break; + case 7: m_DlssViewStateTableRows[r].displayName = "7"; break; + case 8: m_DlssViewStateTableRows[r].displayName = "8"; break; + case 9: m_DlssViewStateTableRows[r].displayName = "9"; break; + case 10: m_DlssViewStateTableRows[r].displayName = "10"; break; + case 11: m_DlssViewStateTableRows[r].displayName = "11"; break; + case 12: m_DlssViewStateTableRows[r].displayName = "12"; break; + case 13: m_DlssViewStateTableRows[r].displayName = "13"; break; + case 14: m_DlssViewStateTableRows[r].displayName = "14"; break; + case 15: m_DlssViewStateTableRows[r].displayName = "15"; break; + } + } } } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index e49112855c2..a243153a539 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -19,6 +19,7 @@ struct TimelineWorkaround { public float oldSpotAngle; public Color oldLightColor; + public float oldLightIntensity; public Vector3 oldLossyScale; public bool oldDisplayAreaLightEmissiveMesh; public float oldLightColorTemperature; @@ -2767,12 +2768,14 @@ internal static void TickLateUpdate() #endif if (lightData.legacyLight.color != lightData.timelineWorkaround.oldLightColor + || lightData.legacyLight.intensity != lightData.timelineWorkaround.oldLightIntensity || lightData.timelineWorkaround.oldLossyScale != lightData.transform.lossyScale || lightData.displayAreaLightEmissiveMesh != lightData.timelineWorkaround.oldDisplayAreaLightEmissiveMesh || lightData.legacyLight.colorTemperature != lightData.timelineWorkaround.oldLightColorTemperature) { lightData.UpdateAreaLightEmissiveMesh(); lightData.timelineWorkaround.oldLightColor = lightData.legacyLight.color; + lightData.timelineWorkaround.oldLightIntensity = lightData.legacyLight.intensity; lightData.timelineWorkaround.oldLossyScale = lightData.transform.lossyScale; lightData.timelineWorkaround.oldDisplayAreaLightEmissiveMesh = lightData.displayAreaLightEmissiveMesh; lightData.timelineWorkaround.oldLightColorTemperature = lightData.legacyLight.colorTemperature; diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 4e897240238..afbaf51ebdc 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -1273,6 +1273,7 @@ internal static void SetExposureTextureToEmpty(RTHandle exposureTexture) bool IsExposureFixed(HDCamera camera) => m_Exposure.mode.value == ExposureMode.Fixed || m_Exposure.mode.value == ExposureMode.UsePhysicalCamera #if UNITY_EDITOR || (camera.camera.cameraType == CameraType.SceneView && HDAdditionalSceneViewSettings.sceneExposureOverriden) + || (UnityEditor.SceneView.lastActiveSceneView != null && UnityEditor.SceneView.lastActiveSceneView.isUsingSceneFiltering) #endif ; diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index a1c16e3eac7..123d9a35453 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -2322,8 +2322,7 @@ protected override void Render(ScriptableRenderContext renderContext, List [SupportedOnRenderPipeline(typeof(HDRenderPipelineAsset))] [Serializable, VolumeComponentMenu("Rendering/High Quality Lines")] + [HDRPHelpURL("Override-High-Quality-Lines")] [DisplayInfo(name = "High Quality Line Rendering")] public class HighQualityLineRenderingVolumeComponent : VolumeComponent { diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DLSSPass.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DLSSPass.cs index 9c21adc7bbc..79ef8444e1b 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DLSSPass.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DLSSPass.cs @@ -78,7 +78,7 @@ public void Render( #region private members, nvidia specific code #if ENABLE_NVIDIA && ENABLE_NVIDIA_MODULE - private static uint s_ExpectedDeviceVersion = 0x05; + private static uint s_ExpectedDeviceVersion = 0x06; private UpscalerCameras m_CameraStates = new UpscalerCameras(); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs index 660a9f08a15..781b51c001f 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs @@ -440,7 +440,7 @@ private void OnSelectionChanged() private void RefreshView() { PopulateData(); - batchListView.RefreshItems(); + batchListView?.RefreshItems(); OnSelectionChanged(); ResetDirty(); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Overrides/SortingGroupEditor2DURP.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/Overrides/SortingGroupEditor2DURP.cs index f83941d3845..a840eff2323 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Overrides/SortingGroupEditor2DURP.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/Overrides/SortingGroupEditor2DURP.cs @@ -12,23 +12,25 @@ internal class SortingGroupEditor2DURP : Editor { private static class Styles { - public static GUIContent flattenGroup = EditorGUIUtility.TrTextContent("Sort 3D as 2D", "Clears z values on 3D meshes affected by a Sorting Group allowing them to sort with other 2D objects and Sort 3D as 2D sorting groups."); + public static GUIContent sort3DAs2D = EditorGUIUtility.TrTextContent("Sort 3D as 2D", "Clears z values on 3D meshes affected by a Sorting Group allowing them to sort with other 2D objects and Sort 3D as 2D sorting groups."); } private SerializedProperty m_SortingOrder; private SerializedProperty m_SortingLayerID; + private SerializedProperty m_Sort3DAs2D; public virtual void OnEnable() { alwaysAllowExpansion = true; - m_SortingOrder = serializedObject.FindProperty("m_SortingOrder"); + m_SortingOrder = serializedObject.FindProperty("m_SortingOrder"); m_SortingLayerID = serializedObject.FindProperty("m_SortingLayerID"); + m_Sort3DAs2D = serializedObject.FindProperty("m_Sort3DAs2D"); } public RenderAs2D TryToFindCreatedRenderAs2D(SortingGroup sortingGroup) { RenderAs2D[] renderAs2Ds = sortingGroup.GetComponents(); - foreach(RenderAs2D renderAs2D in renderAs2Ds) + foreach (RenderAs2D renderAs2D in renderAs2Ds) { if (renderAs2D.IsOwner(sortingGroup)) return renderAs2D; @@ -49,39 +51,30 @@ void DirtyScene() UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEngine.SceneManagement.SceneManager.GetActiveScene()); } - void RenderFlattening() + void RenderSort3DAs2D() { - - bool tryToFlatten = TryToFindCreatedRenderAs2D(serializedObject.targetObject as SortingGroup) != null; - bool result = DrawToggleWithLayout(tryToFlatten, Styles.flattenGroup); - - if (tryToFlatten != result) + EditorGUILayout.PropertyField(m_Sort3DAs2D, Styles.sort3DAs2D); + foreach (var target in targets) { - tryToFlatten = result; - foreach (Object targetObject in serializedObject.targetObjects) + SortingGroup sortingGroup = (SortingGroup)target; + if (sortingGroup.sort3DAs2D) { - SortingGroup sortingGroup = targetObject as SortingGroup; - RenderAs2D renderAs2D = TryToFindCreatedRenderAs2D(sortingGroup); + GameObject go = sortingGroup.gameObject; + go.TryGetComponent(out RenderAs2D renderAs2D); - if (tryToFlatten) + if (renderAs2D != null && !renderAs2D.IsOwner(sortingGroup)) { - if (!renderAs2D) - { - Material mat = AssetDatabase.LoadAssetAtPath("Packages/com.unity.render-pipelines.universal/Runtime/Materials/RenderAs2D-Flattening.mat"); - RenderAs2D newRenderAs2D = sortingGroup.gameObject.AddComponent(); - newRenderAs2D.Init(sortingGroup); - newRenderAs2D.material = mat; - newRenderAs2D.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy; - DirtyScene(); - } + Component.DestroyImmediate(renderAs2D, true); + renderAs2D = null; } - else + + if(renderAs2D == null) { - if (renderAs2D) - { - Component.DestroyImmediate(renderAs2D); - DirtyScene(); - } + Material mat = AssetDatabase.LoadAssetAtPath("Packages/com.unity.render-pipelines.universal/Runtime/Materials/RenderAs2D-Flattening.mat"); + renderAs2D = go.AddComponent(); + renderAs2D.Init(sortingGroup); + renderAs2D.material = mat; + EditorUtility.SetDirty(sortingGroup.gameObject); } } } @@ -95,7 +88,7 @@ public override void OnInspectorGUI() if (rpAsset != null && (rpAsset.scriptableRenderer is Renderer2D)) { SortingLayerEditorUtility.RenderSortingLayerFields(m_SortingOrder, m_SortingLayerID); - RenderFlattening(); + RenderSort3DAs2D(); } else base.OnInspectorGUI(); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/MeshNormalPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/MeshNormalPass.hlsl index e7e373d02c0..e8b4c147048 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/MeshNormalPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/MeshNormalPass.hlsl @@ -6,7 +6,6 @@ PackedVaryings vert(Attributes input) { Varyings output = (Varyings)0; output = BuildVaryings(input); - output.normalWS = TransformObjectToWorldDir(input.normalOS); PackedVaryings packedOutput = PackVaryings(output); return packedOutput; } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/SpriteNormalPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/SpriteNormalPass.hlsl index e1d9bcb94d4..dc7e96bf0c3 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/SpriteNormalPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Includes/SpriteNormalPass.hlsl @@ -3,10 +3,12 @@ PackedVaryings vert(Attributes input) { Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(input); + + SetUpSpriteInstanceProperties(); input.positionOS = UnityFlipSprite(input.positionOS, unity_SpriteProps.xy); output = BuildVaryings(input); output.color *= unity_SpriteColor; - output.normalWS = -GetViewForwardDir(); PackedVaryings packedOutput = PackVaryings(output); return packedOutput; } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Nodes/SpriteSkinningNode.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Nodes/SpriteSkinningNode.cs index 33bedac0e30..c9a8e716d99 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Nodes/SpriteSkinningNode.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Nodes/SpriteSkinningNode.cs @@ -7,21 +7,13 @@ namespace UnityEditor.ShaderGraph { [Title("Input", "Mesh Deformation", "Sprite Skinning")] - class SpriteSkinningNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction, IMayRequireVertexSkinning, IMayRequirePosition, IMayRequireNormal, IMayRequireTangent + class SpriteSkinningNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction, IMayRequireVertexSkinning, IMayRequirePosition { public const int kPositionSlotId = 0; - public const int kNormalSlotId = 1; - public const int kTangentSlotId = 2; public const int kPositionOutputSlotId = 3; - public const int kNormalOutputSlotId = 4; - public const int kTangentOutputSlotId = 5; public const string kSlotPositionName = "Vertex Position"; - public const string kSlotNormalName = "Vertex Normal"; - public const string kSlotTangentName = "Vertex Tangent"; public const string kOutputSlotPositionName = "Skinned Position"; - public const string kOutputSlotNormalName = "Skinned Normal"; - public const string kOutputSlotTangentName = "Skinned Tangent"; public SpriteSkinningNode() { @@ -33,12 +25,8 @@ public SpriteSkinningNode() public sealed override void UpdateNodeAfterDeserialization() { AddSlot(new PositionMaterialSlot(kPositionSlotId, kSlotPositionName, kSlotPositionName, CoordinateSpace.Object, ShaderStageCapability.Vertex)); - AddSlot(new NormalMaterialSlot(kNormalSlotId, kSlotNormalName, kSlotNormalName, CoordinateSpace.Object, ShaderStageCapability.Vertex)); - AddSlot(new TangentMaterialSlot(kTangentSlotId, kSlotTangentName, kSlotTangentName, CoordinateSpace.Object, ShaderStageCapability.Vertex)); AddSlot(new Vector3MaterialSlot(kPositionOutputSlotId, kOutputSlotPositionName, kOutputSlotPositionName, SlotType.Output, Vector3.zero, ShaderStageCapability.Vertex)); - AddSlot(new Vector3MaterialSlot(kNormalOutputSlotId, kOutputSlotNormalName, kOutputSlotNormalName, SlotType.Output, Vector3.zero, ShaderStageCapability.Vertex)); - AddSlot(new Vector3MaterialSlot(kTangentOutputSlotId, kOutputSlotTangentName, kOutputSlotTangentName, SlotType.Output, Vector3.zero, ShaderStageCapability.Vertex)); - RemoveSlotsNameNotMatching(new[] { kPositionSlotId, kNormalSlotId, kTangentSlotId, kPositionOutputSlotId, kNormalOutputSlotId, kTangentOutputSlotId }); + RemoveSlotsNameNotMatching(new[] { kPositionSlotId, kPositionOutputSlotId }); } bool IsSpriteSubTarget() @@ -91,22 +79,6 @@ public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapabil return NeededCoordinateSpace.None; } - public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability = ShaderStageCapability.All) - { - if (stageCapability == ShaderStageCapability.Vertex || stageCapability == ShaderStageCapability.All) - return NeededCoordinateSpace.Object; - else - return NeededCoordinateSpace.None; - } - - public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability = ShaderStageCapability.All) - { - if (stageCapability == ShaderStageCapability.Vertex || stageCapability == ShaderStageCapability.All) - return NeededCoordinateSpace.Object; - else - return NeededCoordinateSpace.None; - } - public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) { base.CollectShaderProperties(properties, generationMode); @@ -117,23 +89,16 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (generationMode.IsPreview() || !IsSpriteSubTarget()) { sb.AppendLine("$precision3 {0} = 0;", GetVariableNameForSlot(kPositionOutputSlotId)); - sb.AppendLine("$precision3 {0} = 0;", GetVariableNameForSlot(kNormalOutputSlotId)); - sb.AppendLine("$precision3 {0} = 0;", GetVariableNameForSlot(kTangentOutputSlotId)); } else { sb.AppendLine("$precision3 {0} = {1};", GetVariableNameForSlot(kPositionOutputSlotId), GetSlotValue(kPositionSlotId, generationMode)); - sb.AppendLine("$precision3 {0} = {1};", GetVariableNameForSlot(kNormalOutputSlotId), GetSlotValue(kNormalSlotId, generationMode)); - sb.AppendLine("$precision3 {0} = {1};", GetVariableNameForSlot(kTangentOutputSlotId), GetSlotValue(kTangentSlotId, generationMode)); sb.AppendLine($"{GetFunctionName()}(" + $"IN.BoneIndices, " + $"IN.BoneWeights, " + $"{GetSlotValue(kPositionSlotId, generationMode)}, " + - $"{GetSlotValue(kNormalSlotId, generationMode)}, " + - $"{GetSlotValue(kTangentSlotId, generationMode)}, " + $"{GetVariableNameForSlot(kPositionOutputSlotId)}, " + - $"{GetVariableNameForSlot(kNormalOutputSlotId)}, " + - $"{GetVariableNameForSlot(kTangentOutputSlotId)}, unity_SpriteProps.z);"); + $"unity_SpriteProps.z);"); } } @@ -145,19 +110,14 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener "uint4 indices, " + "$precision4 weights, " + "$precision3 positionIn, " + - "$precision3 normalIn, " + - "$precision3 tangentIn, " + "out $precision3 positionOut, " + - "out $precision3 normalOut, " + - "out $precision3 tangentOut, in float offset)"); + "in float offset)"); sb.AppendLine("{"); using (sb.IndentScope()) { if (generationMode.IsPreview() || !IsSpriteSubTarget()) { sb.AppendLine("positionOut = positionIn;"); - sb.AppendLine("normalOut = normalIn;"); - sb.AppendLine("tangentOut = tangentIn;"); } else { @@ -166,8 +126,6 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener using (sb.IndentScope()) { sb.AppendLine("positionOut = UnitySkinSprite(positionIn, indices, weights, offset, 1.0f );"); - sb.AppendLine("normalOut = UnitySkinSprite(normalIn, indices, weights, offset, 0 );"); - sb.AppendLine("tangentOut = UnitySkinSprite(tangentIn, indices, weights, offset, 0 );"); } sb.AppendLine("}"); sb.AppendLine("#else"); @@ -175,8 +133,6 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener using (sb.IndentScope()) { sb.AppendLine("positionOut = positionIn;"); - sb.AppendLine("normalOut = normalIn;"); - sb.AppendLine("tangentOut = tangentIn;"); } sb.AppendLine("}"); sb.AppendLine("#endif"); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteCustomLitSubTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteCustomLitSubTarget.cs index 6ea3d606033..24f5e85e858 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteCustomLitSubTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteCustomLitSubTarget.cs @@ -159,6 +159,7 @@ public static PassDescriptor Normal(UniversalTarget target) renderStates = target.sort3DAs2DCompatible ? Universal2DSubTargetDescriptors.RenderStateCollections.Sort3DAs2DCompatible : CoreRenderStates.Default, pragmas = CorePragmas._2DDefault, defines = new DefineCollection(), + keywords = SpriteCustomLitKeywords.Normal, includes = target.sort3DAs2DCompatible ? UniversalMeshLitInfo.Includes.Normal : SpriteCustomLitIncludes.Normal, // Custom Interpolator Support @@ -284,6 +285,11 @@ static class SpriteCustomLitKeywords { CoreKeywordDescriptors.UseSkinnedSprite }, }; + public static KeywordCollection Normal = new KeywordCollection + { + { CoreKeywordDescriptors.UseSkinnedSprite }, + }; + public static KeywordCollection Forward = new KeywordCollection { { CoreKeywordDescriptors.DebugDisplay }, diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteLitSubTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteLitSubTarget.cs index 9ac3fa8e090..e508428815b 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteLitSubTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/ShaderGraph/Targets/UniversalSpriteLitSubTarget.cs @@ -182,6 +182,7 @@ public static PassDescriptor Normal(UniversalTarget target) renderStates = target.sort3DAs2DCompatible ? Universal2DSubTargetDescriptors.RenderStateCollections.Sort3DAs2DCompatible : CoreRenderStates.Default, pragmas = CorePragmas._2DDefault, defines = new DefineCollection(), + keywords = SpriteLitKeywords.Normal, includes = target.sort3DAs2DCompatible ? UniversalMeshLitInfo.Includes.Normal : SpriteLitIncludes.Normal, // Custom Interpolator Support @@ -303,6 +304,11 @@ static class SpriteLitKeywords { CoreKeywordDescriptors.UseSkinnedSprite }, }; + public static KeywordCollection Normal = new KeywordCollection + { + { CoreKeywordDescriptors.UseSkinnedSprite }, + }; + public static KeywordCollection Forward = new KeywordCollection { { CoreKeywordDescriptors.DebugDisplay }, diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUISubTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUISubTarget.cs index fe6a61cbae9..d86aad86f18 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUISubTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUISubTarget.cs @@ -84,10 +84,10 @@ public override PassDescriptor GenerateUIPassDescriptor(bool isSRP) result.Add(RenderState.Blend(Blend.One, Blend.OneMinusSrcAlpha, Blend.One, Blend.OneMinusSrcAlpha)); break; case AlphaMode.Additive: - result.Add(RenderState.Blend(Blend.SrcAlpha, Blend.One, Blend.One, Blend.One)); + result.Add(RenderState.Blend(Blend.SrcAlpha, Blend.One, Blend.One, Blend.OneMinusSrcAlpha)); break; case AlphaMode.Multiply: - result.Add(RenderState.Blend(Blend.DstColor, Blend.OneMinusSrcAlpha, Blend.Zero, Blend.One)); + result.Add(RenderState.Blend(Blend.DstColor, Blend.Zero, Blend.Zero, Blend.One)); break; } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs index d06f48f892f..655724dddb6 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs @@ -55,7 +55,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData builder.SetRenderAttachment(universal2DResourceData.normalsTexture[batchIndex], 0); // Depth needed for sprite mask stencil or z test for 3d meshes - if (rendererData.useDepthStencilBuffer) + if (Renderer2D.IsDepthUsageAllowed(frameData, rendererData)) { var depth = universal2DResourceData.normalsDepth.IsValid() ? universal2DResourceData.normalsDepth : commonResourceData.activeDepthTexture; builder.SetRenderAttachmentDepth(depth); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs index f798e4e548c..e3137dd820e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs @@ -181,7 +181,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData // Set color and depth attachments builder.SetRenderAttachment(commonResourceData.activeColorTexture, 0); - if (rendererData.useDepthStencilBuffer) + if (Renderer2D.IsDepthUsageAllowed(frameData, rendererData)) builder.SetRenderAttachmentDepth(commonResourceData.activeDepthTexture); builder.AllowGlobalStateModification(true); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs index dd83f85e91d..013ace4f4fc 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs @@ -149,15 +149,28 @@ public Renderer2D(Renderer2DData data) : base(data) #endif } - private bool IsPixelPerfectCameraEnabled(UniversalCameraData cameraData) + internal static bool IsDepthUsageAllowed(ContextContainer frameData, Renderer2DData rendererData) { - PixelPerfectCamera ppc = null; + UniversalCameraData cameraData = frameData.Get(); + + bool allowDepth = rendererData.useDepthStencilBuffer; + + // 3D Render Textures with depth/stencil buffer are not supported + if (cameraData.targetTexture != null) + allowDepth &= cameraData.targetTexture.dimension != TextureDimension.Tex3D; + + return allowDepth; + } + + private bool IsPixelPerfectCameraEnabled(UniversalCameraData cameraData, out PixelPerfectCamera ppc) + { + ppc = null; // Pixel Perfect Camera doesn't support camera stacking. if (cameraData.renderType == CameraRenderType.Base && cameraData.resolveFinalTarget) cameraData.camera.TryGetComponent(out ppc); - return ppc != null && ppc.enabled && ppc.cropFrame != PixelPerfectCamera.CropFrame.None; + return ppc != null && ppc.enabled; } private RenderPassInputSummary GetRenderPassInputs(UniversalCameraData cameraData) @@ -197,7 +210,7 @@ ImportResourceSummary GetImportResourceSummary(RenderGraph renderGraph, Universa // Clear back buffer color if pixel perfect crop frame is used // Non-base cameras the back buffer should never be cleared - bool ppcEnabled = IsPixelPerfectCameraEnabled(cameraData); + bool ppcEnabled = IsPixelPerfectCameraEnabled(cameraData, out var ppc) && ppc.cropFrame != PixelPerfectCamera.CropFrame.None; bool clearColorBackbufferOnFirstUse = (cameraData.renderType == CameraRenderType.Base) && (!m_CreateColorTexture || ppcEnabled); bool clearDepthBackbufferOnFirstUse = (cameraData.renderType == CameraRenderType.Base) && !m_CreateColorTexture; @@ -238,6 +251,12 @@ ImportResourceSummary GetImportResourceSummary(RenderGraph renderGraph, Universa bool isBuiltInTexture = cameraData.targetTexture == null; + bool useActualBackbufferOrienation = !cameraData.isSceneViewCamera && !cameraData.isPreviewCamera && cameraData.targetTexture == null; + TextureUVOrigin backbufferTextureUVOrigin = useActualBackbufferOrienation ? (SystemInfo.graphicsUVStartsAtTop ? TextureUVOrigin.TopLeft : TextureUVOrigin.BottomLeft) : TextureUVOrigin.BottomLeft; + + output.backBufferColorParams.textureUVOrigin = backbufferTextureUVOrigin; + output.backBufferDepthParams.textureUVOrigin = backbufferTextureUVOrigin; + #if ENABLE_VR && ENABLE_XR_MODULE if (cameraData.xr.enabled) { @@ -544,7 +563,7 @@ void CreateCameraNormalsTextures(RenderGraph renderGraph, RenderTextureDescripto for (int i = 0; i < resourceData.normalsTexture.Length; ++i) resourceData.normalsTexture[i] = UniversalRenderer.CreateRenderGraphTexture(renderGraph, desc, "_NormalMap", true, RendererLighting.k_NormalClearColor); - if (m_Renderer2DData.useDepthStencilBuffer) + if (IsDepthUsageAllowed(frameData, m_Renderer2DData)) { // Normals pass can reuse active depth if same dimensions, if not create a new depth texture #if !(ENABLE_VR && ENABLE_XR_MODULE) @@ -669,7 +688,7 @@ internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRe DebugHandler?.Setup(renderGraph, cameraData.isPreviewCamera); - SetupRenderGraphCameraProperties(renderGraph, commonResourceData.isActiveTargetBackBuffer, commonResourceData.activeColorTexture); + SetupRenderGraphCameraProperties(renderGraph, commonResourceData.activeColorTexture); #if VISUAL_EFFECT_GRAPH_0_0_1_OR_NEWER ProcessVFXCameraCommand(renderGraph); @@ -835,8 +854,7 @@ private void OnAfterRendering(RenderGraph renderGraph) bool applyPostProcessing = cameraData.postProcessEnabled && m_PostProcessPassRenderGraph != null; bool anyPostProcessing = postProcessingData.isEnabled && m_PostProcessPassRenderGraph != null; - cameraData.camera.TryGetComponent(out var ppc); - bool requirePixelPerfectUpscale = IsPixelPerfectCameraEnabled(cameraData) && ppc.requiresUpscalePass; + bool requirePixelPerfectUpscale = IsPixelPerfectCameraEnabled(cameraData, out var ppc) && ppc.requiresUpscalePass; // When using Upscale Render Texture on a Pixel Perfect Camera, we want all post-processing effects done with a low-res RT, // and only upscale the low-res RT to fullscreen when blitting it to camera target. Also, final post processing pass is not run in this case, diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowProvider/ShadowMesh2D.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowProvider/ShadowMesh2D.cs index a0c9a165228..2ff85eca9ee 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowProvider/ShadowMesh2D.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowProvider/ShadowMesh2D.cs @@ -320,7 +320,7 @@ public override void SetShape(NativeArray vertices, NativeArray in { if (AreDegenerateVertices(vertices) || indices == null || indices.Length == 0) { - m_Mesh.Clear(); + m_Mesh?.Clear(); return; } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/URP2D_GraphicsExtensions.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/URP2D_GraphicsExtensions.cs new file mode 100644 index 00000000000..4de8027b452 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/URP2D_GraphicsExtensions.cs @@ -0,0 +1,38 @@ +using UnityEngine; + +namespace UnityEngine.Rendering.Universal +{ + /// + /// Class URP2D_GraphicsExtensions provides additional functions to extend built in graphics classes in URP2D + /// + public static class URP2D_GraphicsExtensions + { + /// + /// Gets the SpriteMaskInteraction state for MeshRenderer + /// + /// The instance to query. + /// Returns the SpriteMaskInteraction + public static SpriteMaskInteraction GetSpriteMaskInteraction(this MeshRenderer meshRenderer) { return meshRenderer.Internal_GetSpriteMaskInteraction(); } + + /// + /// Gets the SpriteMaskInteraction state for SkinnedMeshRenderer + /// + /// The instance to query. + /// Returns the SpriteMaskInteraction + public static SpriteMaskInteraction GetSpriteMaskInteraction(this SkinnedMeshRenderer skinnedMeshRenderer) { return skinnedMeshRenderer.Internal_GetSpriteMaskInteraction(); } + + /// + /// Sets the SpriteMaskInteraction state for SkinnedMeshRenderer + /// + /// The instance to modify. + /// The mask interaction state to set. + public static void SetSpriteMaskInteraction(this MeshRenderer meshRenderer, SpriteMaskInteraction maskInteraction) { meshRenderer.Internal_SetSpriteMaskInteraction(maskInteraction); } + + /// + /// Sets the SpriteMaskInteraction state for SkinnedMeshRenderer + /// + /// The instance to modify. + /// The mask interaction state to set. + public static void SetSpriteMaskInteraction(this SkinnedMeshRenderer skinnedMeshRenderer, SpriteMaskInteraction maskInteraction) { skinnedMeshRenderer.Internal_SetSpriteMaskInteraction(maskInteraction); } + } +} diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/URP2D_GraphicsExtensions.cs.meta b/Packages/com.unity.render-pipelines.universal/Runtime/2D/URP2D_GraphicsExtensions.cs.meta new file mode 100644 index 00000000000..002f7c35532 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/URP2D_GraphicsExtensions.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9d9379906932aeb42948429db294542e \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Decal/DBuffer/DBufferDepthCopyPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Decal/DBuffer/DBufferDepthCopyPass.cs index 6b6802001a5..9642a4b242f 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Decal/DBuffer/DBufferDepthCopyPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Decal/DBuffer/DBufferDepthCopyPass.cs @@ -36,7 +36,7 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer if (!hasCompatibleDepth) { //Here we assume that when using depth priming, there is no prepass to the cameraDepthTexture but a copy, so that the texture is a color format. - var source = (useDepthPriming) ? resourceData.cameraDepth : resourceData.cameraDepthTexture; + var source = (useDepthPriming || universalRenderer.usesDeferredLighting) ? resourceData.cameraDepth : resourceData.cameraDepthTexture; Debug.Assert(source.IsValid(), "DBufferCopyDepthPass needs a valid cameraDepth or cameraDepth texture to copy from. You might be using depth priming, with MSAA and direct to backbuffer rendering, which is not supported."); Debug.Assert(GraphicsFormatUtility.IsDepthFormat(source.GetDescriptor(renderGraph).format), "DBufferCopyDepthPass assumes source has a depth format."); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ForwardLights.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ForwardLights.cs index c25268a4c64..1e755d75d60 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ForwardLights.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ForwardLights.cs @@ -223,6 +223,13 @@ out int wordsPerTile var localLights = lights.GetSubArray(firstLocalLightIdx, localLightCount); var reflectionProbeCount = math.min(probes.Length, UniversalRenderPipeline.maxVisibleReflectionProbes); + // Ensure reflection probes without textures aren't used. + for (var i = 0; i < probes.Length; i++) + { + if (!probes[i].texture) + reflectionProbeCount--; + } + var itemsPerTile = localLights.Length + reflectionProbeCount; wordsPerTile = (itemsPerTile + 31) / 32; @@ -255,11 +262,12 @@ out int wordsPerTile // Should probe come after otherProbe? static bool IsProbeGreater(VisibleReflectionProbe probe, VisibleReflectionProbe otherProbe) { - return probe.importance < otherProbe.importance || - (probe.importance == otherProbe.importance && probe.bounds.extents.sqrMagnitude > otherProbe.bounds.extents.sqrMagnitude); + return otherProbe.texture != null && (probe.texture == null || probe.importance < otherProbe.importance || + (probe.importance == otherProbe.importance && probe.bounds.extents.sqrMagnitude > otherProbe.bounds.extents.sqrMagnitude)); } - for (var i = 1; i < reflectionProbeCount; i++) + // Used probes.Length to check that we use the most relevant probes. + for (var i = 1; i < probes.Length; i++) { var probe = probes[i]; var j = i - 1; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs index 3a789a6b712..fcb93d919e5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs @@ -99,14 +99,6 @@ public void Dispose() [Obsolete(DeprecationMessage.CompatibilityScriptingAPIObsoleteFrom2023_3)] public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) { -#if UNITY_ANDROID - // Mali Valhall + SSAO compatibility: Override timing when accessing depth data - if (PlatformAutoDetect.isRunningOnMaliValhallGPU && renderingData.cameraData.postProcessEnabled) - { - renderPassEvent = RenderPassEvent.AfterRenderingOpaques; - } -#endif - // Disable obsolete warning for internal usage #pragma warning disable CS0618 #if UNITY_EDITOR @@ -128,6 +120,7 @@ public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderin private class PassData { internal TextureHandle source; + internal TextureHandle destination; internal UniversalCameraData cameraData; internal Material copyDepthMaterial; internal int msaaSamples; @@ -159,11 +152,14 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData cmd.SetFoveatedRenderingMode(FoveatedRenderingMode.Disabled); } #endif - ExecutePass(CommandBufferHelpers.GetRasterCommandBuffer(cmd), m_PassData, this.source); + + // We must perform a yflip if we're rendering into the backbuffer and we have a flipped source texture. + bool yflip = m_PassData.isDstBackbuffer && cameraData.IsHandleYFlipped(source); + ExecutePass(CommandBufferHelpers.GetRasterCommandBuffer(cmd), m_PassData, this.source, yflip); } #endif - private static void ExecutePass(RasterCommandBuffer cmd, PassData passData, RTHandle source) + private static void ExecutePass(RasterCommandBuffer cmd, PassData passData, RTHandle source, bool yflip) { var copyDepthMaterial = passData.copyDepthMaterial; var msaaSamples = passData.msaaSamples; @@ -223,9 +219,6 @@ private static void ExecutePass(RasterCommandBuffer cmd, PassData passData, RTHa cmd.SetKeyword(ShaderGlobalKeywords._OUTPUT_DEPTH, copyToDepth); - // We must perform a yflip if we're rendering into the backbuffer and we have a flipped source texture. - bool yflip = passData.isDstBackbuffer && passData.cameraData.IsHandleYFlipped(source); - Vector2 viewportScale = source.useScaling ? new Vector2(source.rtHandleProperties.rtHandleScale.x, source.rtHandleProperties.rtHandleScale.y) : Vector2.one; Vector4 scaleBias = yflip ? new Vector4(viewportScale.x, -viewportScale.y, 0, viewportScale.y) : new Vector4(viewportScale.x, viewportScale.y, 0, 0); @@ -350,6 +343,7 @@ public void Render(RenderGraph renderGraph, TextureHandle destination, TextureHa } passData.source = source; + passData.destination = destination; builder.UseTexture(source, AccessFlags.Read); if (bindAsCameraDepth && destination.IsValid()) @@ -359,7 +353,8 @@ public void Render(RenderGraph renderGraph, TextureHandle destination, TextureHa builder.SetRenderFunc((PassData data, RasterGraphContext context) => { - ExecutePass(context.cmd, data, data.source); + bool yflip = context.GetTextureUVOrigin(in data.source) != context.GetTextureUVOrigin(in data.destination); + ExecutePass(context.cmd, data, data.source, yflip); }); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs index d2f247f3af4..82a60e881a6 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthNormalOnlyPass.cs @@ -17,6 +17,8 @@ public partial class DepthNormalOnlyPass : ScriptableRenderPass // Statics private static readonly List k_DepthNormals = new List { new ShaderTagId("DepthNormals"), new ShaderTagId("DepthNormalsOnly") }; + private static readonly List k_DepthNormalsOnly = new List { new ShaderTagId("DepthNormalsOnly") }; + internal static readonly string k_CameraNormalsTextureName = "_CameraNormalsTexture"; private static readonly int s_CameraDepthTextureID = Shader.PropertyToID("_CameraDepthTexture"); private static readonly int s_CameraNormalsTextureID = Shader.PropertyToID(k_CameraNormalsTextureName); @@ -202,8 +204,17 @@ private RendererListParams InitRendererListParams(UniversalRenderingData renderi return new RendererListParams(renderingData.cullResults, drawSettings, m_FilteringSettings); } - internal void Render(RenderGraph renderGraph, ContextContainer frameData, TextureHandle cameraNormalsTexture, TextureHandle cameraDepthTexture, TextureHandle renderingLayersTexture, uint batchLayerMask, bool setGlobalDepth, bool setGlobalTextures) + internal void Render(RenderGraph renderGraph, ContextContainer frameData, in TextureHandle cameraNormalsTexture, in TextureHandle depthTexture, in TextureHandle renderingLayersTexture, uint batchLayerMask, bool setGlobalDepth, bool setGlobalNormalAndRenderingLayers, bool allowPartialPass) { + if (allowPartialPass) + { + this.shaderTagIds = k_DepthNormalsOnly; + } + else + { + this.shaderTagIds = k_DepthNormals; + } + UniversalRenderingData renderingData = frameData.Get(); UniversalCameraData cameraData = frameData.Get(); UniversalLightData lightData = frameData.Get(); @@ -211,7 +222,7 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Textur using (var builder = renderGraph.AddRasterRenderPass(passName, out var passData, profilingSampler)) { builder.SetRenderAttachment(cameraNormalsTexture, 0, AccessFlags.Write); - builder.SetRenderAttachmentDepth(cameraDepthTexture, AccessFlags.Write); + builder.SetRenderAttachmentDepth(depthTexture, AccessFlags.ReadWrite); passData.enableRenderingLayers = enableRenderingLayers; @@ -231,7 +242,7 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Textur builder.SetExtendedFeatureFlags(ExtendedFeatureFlags.MultiviewRenderRegionsCompatible); } - if (setGlobalTextures) + if (setGlobalNormalAndRenderingLayers) { builder.SetGlobalTextureAfterPass(cameraNormalsTexture, s_CameraNormalsTextureID); @@ -240,7 +251,7 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Textur } if (setGlobalDepth) - builder.SetGlobalTextureAfterPass(cameraDepthTexture, s_CameraDepthTextureID); + builder.SetGlobalTextureAfterPass(depthTexture, s_CameraDepthTextureID); // Required here because of RenderingLayerUtils.SetupProperties builder.AllowGlobalStateModification(true); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthOnlyPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthOnlyPass.cs index 83b7fe14507..86308568e87 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthOnlyPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DepthOnlyPass.cs @@ -134,7 +134,7 @@ private RendererListParams InitRendererListParams(UniversalRenderingData renderi return new RendererListParams(renderingData.cullResults, drawSettings, m_FilteringSettings); } - internal void Render(RenderGraph renderGraph, ContextContainer frameData, ref TextureHandle cameraDepthTexture, uint batchLayerMask, bool setGlobalDepth) + internal void Render(RenderGraph renderGraph, ContextContainer frameData, in TextureHandle depthTexture, uint batchLayerMask, bool setGlobalDepth) { UniversalRenderingData renderingData = frameData.Get(); UniversalCameraData cameraData = frameData.Get(); @@ -147,10 +147,10 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, ref Te passData.rendererList = renderGraph.CreateRendererList(param); builder.UseRendererList(passData.rendererList); - builder.SetRenderAttachmentDepth(cameraDepthTexture, AccessFlags.Write); + builder.SetRenderAttachmentDepth(depthTexture, AccessFlags.ReadWrite); if (setGlobalDepth) - builder.SetGlobalTextureAfterPass(cameraDepthTexture, s_CameraDepthTextureID); + builder.SetGlobalTextureAfterPass(depthTexture, s_CameraDepthTextureID); builder.AllowGlobalStateModification(true); if (cameraData.xr.enabled) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs index 81eb76d7071..a58e5d4e2b5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using UnityEngine.Experimental.Rendering; using UnityEngine.Rendering.RenderGraphModule; -using UnityEngine.Profiling; namespace UnityEngine.Rendering.Universal.Internal { @@ -125,8 +123,10 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData UniversalCameraData cameraData = frameData.Get(); UniversalLightData lightData = frameData.Get(); + bool disableZWrite = CanDisableZWrite(cameraData, m_IsOpaque); + InitPassData(cameraData, ref m_PassData, uint.MaxValue, m_IsActiveTargetBackBuffer); - InitRendererLists(universalRenderingData, cameraData, lightData, ref m_PassData, context, default(RenderGraph), false); + InitRendererLists(universalRenderingData, cameraData, lightData, ref m_PassData, context, default(RenderGraph), false, disableZWrite); using (new ProfilingScope(renderingData.commandBuffer, profilingSampler)) { @@ -219,7 +219,7 @@ internal void InitPassData(UniversalCameraData cameraData, ref PassData passData passData.isActiveTargetBackBuffer = isActiveTargetBackBuffer; } - internal void InitRendererLists(UniversalRenderingData renderingData, UniversalCameraData cameraData, UniversalLightData lightData, ref PassData passData, ScriptableRenderContext context, RenderGraph renderGraph, bool useRenderGraph) + internal void InitRendererLists(UniversalRenderingData renderingData, UniversalCameraData cameraData, UniversalLightData lightData, ref PassData passData, ScriptableRenderContext context, RenderGraph renderGraph, bool useRenderGraph, bool zWriteOff) { ref Camera camera = ref cameraData.camera; var sortFlags = (m_IsOpaque) ? cameraData.defaultOpaqueSortFlags : SortingCriteria.CommonTransparent; @@ -236,15 +236,16 @@ internal void InitRendererLists(UniversalRenderingData renderingData, UniversalC } #endif DrawingSettings drawSettings = RenderingUtils.CreateDrawingSettings(m_ShaderTagIdList, renderingData, cameraData, lightData, sortFlags); - if (cameraData.renderer.useDepthPriming && m_IsOpaque && (cameraData.renderType == CameraRenderType.Base || cameraData.clearDepth)) + + if (zWriteOff) { m_RenderStateBlock.depthState = new DepthState(false, CompareFunction.Equal); m_RenderStateBlock.mask |= RenderStateMask.Depth; } - else if (m_RenderStateBlock.depthState.compareFunction == CompareFunction.Equal) + else { - m_RenderStateBlock.depthState = new DepthState(true, CompareFunction.LessEqual); - m_RenderStateBlock.mask |= RenderStateMask.Depth; + m_RenderStateBlock.depthState = DepthState.defaultValue; + m_RenderStateBlock.mask &= ~RenderStateMask.Depth; } var activeDebugHandler = GetActiveDebugHandler(cameraData); @@ -274,6 +275,11 @@ internal void InitRendererLists(UniversalRenderingData renderingData, UniversalC } } + internal static bool CanDisableZWrite(UniversalCameraData cameraData, bool isOpaque) + { + return cameraData.renderer.useDepthPriming && isOpaque && (cameraData.renderType == CameraRenderType.Base || cameraData.clearDepth); + } + internal void Render(RenderGraph renderGraph, ContextContainer frameData, TextureHandle colorTarget, TextureHandle depthTarget, TextureHandle mainShadowsTexture, TextureHandle additionalShadowsTexture, uint batchLayerMask = uint.MaxValue, bool isMainOpaquePass = false) { UniversalResourceData resourceData = frameData.Get(); @@ -281,6 +287,8 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Textur UniversalCameraData cameraData = frameData.Get(); UniversalLightData lightData = frameData.Get(); + bool disableZWrite = CanDisableZWrite(cameraData, m_IsOpaque); + using (var builder = renderGraph.AddRasterRenderPass(passName, out var passData, profilingSampler)) { builder.UseAllGlobalTextures(true); @@ -295,8 +303,9 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Textur if (depthTarget.IsValid()) { + var depthAccessFlags = (disableZWrite) ? AccessFlags.Read : AccessFlags.ReadWrite; passData.depthHdl = depthTarget; - builder.SetRenderAttachmentDepth(depthTarget, AccessFlags.Write); + builder.SetRenderAttachmentDepth(depthTarget, depthAccessFlags); } if (mainShadowsTexture.IsValid()) @@ -317,7 +326,8 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Textur RenderGraphUtils.UseDBufferIfValid(builder, resourceData); - InitRendererLists(renderingData, cameraData, lightData, ref passData, default(ScriptableRenderContext), renderGraph, true); + InitRendererLists(renderingData, cameraData, lightData, ref passData, default(ScriptableRenderContext), renderGraph, true, disableZWrite); + var activeDebugHandler = GetActiveDebugHandler(cameraData); if (activeDebugHandler != null) { @@ -456,21 +466,25 @@ public RenderingLayersPassData() internal void Render(RenderGraph renderGraph, ContextContainer frameData, TextureHandle colorTarget, TextureHandle renderingLayersTexture, TextureHandle depthTarget, TextureHandle mainShadowsTexture, TextureHandle additionalShadowsTexture, RenderingLayerUtils.MaskSize maskSize, uint batchLayerMask = uint.MaxValue) { using (var builder = renderGraph.AddRasterRenderPass(passName, out var passData, profilingSampler)) - { UniversalResourceData resourceData = frameData.Get(); UniversalRenderingData renderingData = frameData.Get(); UniversalCameraData cameraData = frameData.Get(); - UniversalLightData lightData = frameData.Get(); + UniversalLightData lightData = frameData.Get(); InitPassData(cameraData, ref passData.basePassData, batchLayerMask); + passData.maskSize = maskSize; passData.basePassData.albedoHdl = colorTarget; builder.SetRenderAttachment(colorTarget, 0, AccessFlags.Write); builder.SetRenderAttachment(renderingLayersTexture, 1, AccessFlags.Write); + + bool disableZWrite = CanDisableZWrite(cameraData, passData.basePassData.isOpaque); + var depthAccessFlags = (disableZWrite) ? AccessFlags.Read : AccessFlags.ReadWrite; passData.basePassData.depthHdl = depthTarget; - builder.SetRenderAttachmentDepth(depthTarget, AccessFlags.Write); + builder.SetRenderAttachmentDepth(depthTarget, depthAccessFlags); + if (mainShadowsTexture.IsValid()) builder.UseTexture(mainShadowsTexture, AccessFlags.Read); if (additionalShadowsTexture.IsValid()) @@ -486,7 +500,8 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Textur RenderGraphUtils.UseDBufferIfValid(builder, resourceData); } - InitRendererLists(renderingData, cameraData, lightData, ref passData.basePassData, default(ScriptableRenderContext), renderGraph, true); + InitRendererLists(renderingData, cameraData, lightData, ref passData.basePassData, default(ScriptableRenderContext), renderGraph, true, disableZWrite); + var activeDebugHandler = GetActiveDebugHandler(cameraData); if (activeDebugHandler != null) { diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/FinalBlitPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/FinalBlitPass.cs index 3f4debe42e5..1d22a4f9fbd 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/FinalBlitPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/FinalBlitPass.cs @@ -219,21 +219,21 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData #endif CoreUtils.SetRenderTarget(renderingData.commandBuffer, cameraTargetHandle.nameID, loadAction, RenderBufferStoreAction.Store, ClearFlag.None, Color.clear); - ExecutePass(CommandBufferHelpers.GetRasterCommandBuffer(renderingData.commandBuffer), m_PassData, m_Source, cameraTargetHandle, cameraData); + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(m_Source, cameraTargetHandle, cameraData); + ExecutePass(CommandBufferHelpers.GetRasterCommandBuffer(renderingData.commandBuffer), m_PassData, m_Source, cameraTargetHandle, cameraData, scaleBias); cameraData.renderer.ConfigureCameraTarget(cameraTargetHandle, cameraTargetHandle); - } + } } } #endif - private static void ExecutePass(RasterCommandBuffer cmd, PassData data, RTHandle source, RTHandle destination, UniversalCameraData cameraData) + private static void ExecutePass(RasterCommandBuffer cmd, PassData data, RTHandle source, RTHandle destination, UniversalCameraData cameraData, Vector4 scaleBias) { bool isRenderToBackBufferTarget = !cameraData.isSceneViewCamera; #if ENABLE_VR && ENABLE_XR_MODULE if (cameraData.xr.enabled) isRenderToBackBufferTarget = new RenderTargetIdentifier(destination.nameID, 0, CubemapFace.Unknown, -1) == new RenderTargetIdentifier(cameraData.xr.renderTarget, 0, CubemapFace.Unknown, -1); -#endif - Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(source, destination, cameraData); +#endif if (isRenderToBackBufferTarget) cmd.SetViewport(cameraData.pixelRect); @@ -358,7 +358,11 @@ internal void Render(RenderGraph renderGraph, ContextContainer frameData, Univer Blitter.BlitTexture(context.cmd, sourceTex, viewportScale, data.blitMaterialData.material, shaderPassIndex); } else - ExecutePass(context.cmd, data, data.source, data.destination, data.cameraData); + { + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(context, in data.source, in data.destination); + ExecutePass(context.cmd, data, data.source, data.destination, data.cameraData, scaleBias); + } + }); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/HDRDebugViewPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/HDRDebugViewPass.cs index 7a3783341f0..b549df4c456 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/HDRDebugViewPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/HDRDebugViewPass.cs @@ -109,7 +109,7 @@ private static void ExecuteCIExyPrepass(CommandBuffer cmd, PassDataCIExy data, R cmd.ClearRandomWriteTargets(); } - private static void ExecuteHDRDebugViewFinalPass(RasterCommandBuffer cmd, PassDataDebugView data, RTHandle sourceTexture, RTHandle destination, RTHandle xyTarget) + private static void ExecuteHDRDebugViewFinalPass(RasterCommandBuffer cmd, in PassDataDebugView data, RTHandle source, Vector4 scaleBias, RTHandle destination, RTHandle xyTarget) { if (data.cameraData.isHDROutputActive) { @@ -122,9 +122,7 @@ private static void ExecuteHDRDebugViewFinalPass(RasterCommandBuffer cmd, PassDa Vector4 debugParameters = new Vector4(ShaderConstants._SizeOfHDRXYMapping, ShaderConstants._SizeOfHDRXYMapping, 0, 0); data.material.SetVector(ShaderConstants._HDRDebugParamsId, debugParameters); data.material.SetVector(ShaderPropertyId.hdrOutputLuminanceParams, data.luminanceParameters); - data.material.SetInteger(ShaderConstants._DebugHDRModeId, (int)data.hdrDebugMode); - - Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(sourceTexture, destination, data.cameraData); + data.material.SetInteger(ShaderConstants._DebugHDRModeId, (int)data.hdrDebugMode); RenderTargetIdentifier cameraTarget = BuiltinRenderTextureType.CameraTarget; #if ENABLE_VR && ENABLE_XR_MODULE @@ -135,7 +133,7 @@ private static void ExecuteHDRDebugViewFinalPass(RasterCommandBuffer cmd, PassDa if (destination.nameID == cameraTarget || data.cameraData.targetTexture != null) cmd.SetViewport(data.cameraData.pixelRect); - Blitter.BlitTexture(cmd, sourceTexture, scaleBias, data.material, 1); + Blitter.BlitTexture(cmd, source, scaleBias, data.material, 1); } // Non-RenderGraph path @@ -213,7 +211,8 @@ private void ExecutePass(CommandBuffer cmd, PassDataCIExy dataCIExy, PassDataDeb using (new ProfilingScope(cmd, profilingSampler)) { - ExecuteHDRDebugViewFinalPass(rasterCmd, dataDebugView, sourceTexture, destTexture, xyTarget); + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(sourceTexture, destTexture, dataDebugView.cameraData); + ExecuteHDRDebugViewFinalPass(rasterCmd, dataDebugView, sourceTexture, scaleBias, destTexture, xyTarget); } // Disable obsolete warning for internal usage @@ -287,7 +286,8 @@ internal void RenderHDRDebug(RenderGraph renderGraph, UniversalCameraData camera builder.SetRenderFunc((PassDataDebugView data, RasterGraphContext context) => { data.material.enabledKeywords = null; - ExecuteHDRDebugViewFinalPass(context.cmd, data, data.srcColor, data.dstColor, data.xyBuffer); + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(in context, in data.srcColor, in data.dstColor); + ExecuteHDRDebugViewFinalPass(context.cmd, in data, data.srcColor, scaleBias, data.dstColor, data.xyBuffer); }); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/InvokeOnRenderObjectCallbackPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/InvokeOnRenderObjectCallbackPass.cs index c2647206564..50571da13f4 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/InvokeOnRenderObjectCallbackPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/InvokeOnRenderObjectCallbackPass.cs @@ -41,7 +41,9 @@ internal void Render(RenderGraph renderGraph, TextureHandle colorTarget, Texture { using (var builder = renderGraph.AddUnsafePass(passName, out var passData, profilingSampler)) { + passData.colorTarget = colorTarget; builder.UseTexture(colorTarget, AccessFlags.Write); + passData.depthTarget = depthTarget; builder.UseTexture(depthTarget, AccessFlags.Write); builder.AllowPassCulling(false); builder.SetRenderFunc((PassData data, UnsafeGraphContext context) => diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs index 0f3291b5f45..09d02be2129 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs @@ -120,7 +120,7 @@ internal class PostProcessPass : ScriptableRenderPass Material m_BlitMaterial; - + internal bool useLensFlare => !LensFlareCommonSRP.Instance.IsEmpty() && m_SupportDataDrivenLensFlare; /// /// Creates a new PostProcessPass instance. @@ -416,7 +416,6 @@ void Render(CommandBuffer cmd, ref RenderingData renderingData) bool useSubPixeMorpAA = cameraData.antialiasing == AntialiasingMode.SubpixelMorphologicalAntiAliasing; var dofMaterial = m_DepthOfField.mode.value == DepthOfFieldMode.Gaussian ? m_Materials.gaussianDepthOfField : m_Materials.bokehDepthOfField; bool useDepthOfField = m_DepthOfField.IsActive() && !isSceneViewCamera && dofMaterial != null; - bool useLensFlare = !LensFlareCommonSRP.Instance.IsEmpty() && m_SupportDataDrivenLensFlare; bool useLensFlareScreenSpace = m_LensFlareScreenSpace.IsActive() && m_SupportScreenSpaceLensFlare; bool useMotionBlur = m_MotionBlur.IsActive() && !isSceneViewCamera; bool usePaniniProjection = m_PaniniProjection.IsActive() && !isSceneViewCamera; @@ -1980,4 +1979,4 @@ static class ShaderConstants #endregion } } -#endif \ No newline at end of file +#endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs index 4fafe8cc6fa..d4cdac8a5b3 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs @@ -2027,25 +2027,25 @@ static private void ScaleViewport(RasterCommandBuffer cmd, RTHandle sourceTextur } } - static private void ScaleViewportAndBlit(RasterCommandBuffer cmd, RTHandle sourceTextureHdl, RTHandle dest, UniversalCameraData cameraData, Material material, bool hasFinalPass) + static private void ScaleViewportAndBlit(in RasterGraphContext context, in TextureHandle source, in TextureHandle destination, UniversalCameraData cameraData, Material material, bool hasFinalPass) { - Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(sourceTextureHdl, dest, cameraData); - ScaleViewport(cmd, sourceTextureHdl, dest, cameraData, hasFinalPass); + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(in context, in source, in destination); + ScaleViewport(context.cmd, source, destination, cameraData, hasFinalPass); - Blitter.BlitTexture(cmd, sourceTextureHdl, scaleBias, material, 0); + Blitter.BlitTexture(context.cmd, source, scaleBias, material, 0); } - static private void ScaleViewportAndDrawVisibilityMesh(RasterCommandBuffer cmd, RTHandle sourceTextureHdl, RTHandle dest, UniversalCameraData cameraData, Material material, bool hasFinalPass) + static private void ScaleViewportAndDrawVisibilityMesh(in RasterGraphContext context, in TextureHandle source, in TextureHandle destination, UniversalCameraData cameraData, Material material, bool hasFinalPass) { #if ENABLE_VR && ENABLE_XR_MODULE - Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(sourceTextureHdl, dest, cameraData); - ScaleViewport(cmd, sourceTextureHdl, dest, cameraData, hasFinalPass); + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(in context, in source, in destination); + ScaleViewport(context.cmd, source, destination, cameraData, hasFinalPass); // Set property block for blit shader MaterialPropertyBlock xrPropertyBlock = XRSystemUniversal.GetMaterialPropertyBlock(); xrPropertyBlock.SetVector(Shader.PropertyToID("_BlitScaleBias"), scaleBias); - xrPropertyBlock.SetTexture(Shader.PropertyToID("_BlitTexture"), sourceTextureHdl); - cameraData.xr.RenderVisibleMeshCustomMaterial(cmd, cameraData.xr.occlusionMeshScale, material, xrPropertyBlock, 1, cameraData.IsRenderTargetProjectionMatrixFlipped(dest)); + xrPropertyBlock.SetTexture(Shader.PropertyToID("_BlitTexture"), source); + cameraData.xr.RenderVisibleMeshCustomMaterial(context.cmd, cameraData.xr.occlusionMeshScale, material, xrPropertyBlock, 1, context.GetTextureUVOrigin(destination) == TextureUVOrigin.BottomLeft); #endif } @@ -2093,13 +2093,12 @@ public void RenderFinalSetup(RenderGraph renderGraph, UniversalCameraData camera builder.SetRenderFunc(static (PostProcessingFinalSetupPassData data, RasterGraphContext context) => { - var cmd = context.cmd; RTHandle sourceTextureHdl = data.sourceTexture; - PostProcessUtils.SetSourceSize(cmd, sourceTextureHdl); + PostProcessUtils.SetSourceSize(context.cmd, sourceTextureHdl); bool hasFinalPass = true; // This is a pass just before final pass. Viewport must match intermediate target. - ScaleViewportAndBlit(context.cmd, sourceTextureHdl, data.destinationTexture, data.cameraData, data.material, hasFinalPass); + ScaleViewportAndBlit(in context, in data.sourceTexture, in data.destinationTexture, data.cameraData, data.material, hasFinalPass); }); return; } @@ -2172,8 +2171,6 @@ public struct FinalBlitSettings /// True if final blit requires HDR output. public bool requireHDROutput; /// True if final blit needs to resolve to debug screen. - public bool resolveToDebugScreen; - /// True if final blit needs to output alpha channel. public bool isAlphaOutputEnabled; /// HDR Operations @@ -2190,7 +2187,6 @@ public static FinalBlitSettings Create() s.isFsrEnabled = false; s.isTaaSharpeningEnabled = false; s.requireHDROutput = false; - s.resolveToDebugScreen = false; s.isAlphaOutputEnabled = false; s.hdrOperations = HDROutputUtils.Operation.None; @@ -2234,7 +2230,6 @@ public void RenderFinalBlit(RenderGraph renderGraph, UniversalCameraData cameraD var isFsrEnabled = data.settings.isFsrEnabled; var isRcasEnabled = data.settings.isTaaSharpeningEnabled; var requireHDROutput = data.settings.requireHDROutput; - var resolveToDebugScreen = data.settings.resolveToDebugScreen; var isAlphaOutputEnabled = data.settings.isAlphaOutputEnabled; RTHandle sourceTextureHdl = data.sourceTexture; RTHandle destinationTextureHdl = data.destinationTexture; @@ -2268,21 +2263,7 @@ public void RenderFinalBlit(RenderGraph renderGraph, UniversalCameraData cameraD if (isAlphaOutputEnabled) CoreUtils.SetKeyword(material, ShaderKeywordStrings._ENABLE_ALPHA_OUTPUT, isAlphaOutputEnabled); - bool isRenderToBackBufferTarget = !data.cameraData.isSceneViewCamera; -#if ENABLE_VR && ENABLE_XR_MODULE - if (data.cameraData.xr.enabled) - isRenderToBackBufferTarget = destinationTextureHdl == data.cameraData.xr.renderTarget; -#endif - // HDR debug views force-renders to DebugScreenTexture. - isRenderToBackBufferTarget &= !resolveToDebugScreen; - - Vector2 viewportScale = sourceTextureHdl.useScaling ? new Vector2(sourceTextureHdl.rtHandleProperties.rtHandleScale.x, sourceTextureHdl.rtHandleProperties.rtHandleScale.y) : Vector2.one; - - // We y-flip if - // 1) we are blitting from render texture to back buffer(UV starts at bottom) and - // 2) renderTexture starts UV at top - bool yflip = isRenderToBackBufferTarget && data.cameraData.targetTexture == null && SystemInfo.graphicsUVStartsAtTop; - Vector4 scaleBias = yflip ? new Vector4(viewportScale.x, -viewportScale.y, 0, viewportScale.y) : new Vector4(viewportScale.x, viewportScale.y, 0, 0); + Vector4 scaleBias = RenderingUtils.GetFinalBlitScaleBias(context, data.sourceTexture, data.destinationTexture); cmd.SetViewport(data.cameraData.pixelRect); #if ENABLE_VR && ENABLE_XR_MODULE @@ -2292,7 +2273,7 @@ public void RenderFinalBlit(RenderGraph renderGraph, UniversalCameraData cameraD xrPropertyBlock.SetVector(Shader.PropertyToID("_BlitScaleBias"), scaleBias); xrPropertyBlock.SetTexture(Shader.PropertyToID("_BlitTexture"), sourceTextureHdl); - data.cameraData.xr.RenderVisibleMeshCustomMaterial(cmd, data.cameraData.xr.occlusionMeshScale, material, xrPropertyBlock, 1, !yflip); + data.cameraData.xr.RenderVisibleMeshCustomMaterial(cmd, data.cameraData.xr.occlusionMeshScale, material, xrPropertyBlock, 1, context.GetTextureUVOrigin(in data.sourceTexture) == context.GetTextureUVOrigin(in data.destinationTexture)); } else #endif @@ -2370,7 +2351,6 @@ public void RenderFinalPassRenderGraph(RenderGraph renderGraph, ContextContainer bool resolveToDebugScreen = debugHandler != null && debugHandler.WriteToDebugScreenTexture(cameraData.resolveFinalTarget); debugHandler?.UpdateShaderGlobalPropertiesForFinalValidationPass(renderGraph, cameraData, !m_HasFinalPass && !resolveToDebugScreen); - settings.resolveToDebugScreen = resolveToDebugScreen; settings.isAlphaOutputEnabled = cameraData.isAlphaOutputEnabled; settings.isFxaaEnabled = (cameraData.antialiasing == AntialiasingMode.FastApproximateAntialiasing); settings.isFsrEnabled = ((cameraData.imageScalingMode == ImageScalingMode.Upscaling) && (cameraData.upscalingFilter == ImageUpscalingFilter.FSR)); @@ -2379,7 +2359,7 @@ public void RenderFinalPassRenderGraph(RenderGraph renderGraph, ContextContainer // This avoids the cost of EASU and is available for other upscaling options. // If FSR is enabled then FSR settings override the TAA settings and we perform RCAS only once. // If STP is enabled, then TAA sharpening has already been performed inside STP. - settings.isTaaSharpeningEnabled = (cameraData.IsTemporalAAEnabled() && cameraData.taaSettings.contrastAdaptiveSharpening > 0.0f) && !settings.isFsrEnabled && !cameraData.IsSTPEnabled() && + settings.isTaaSharpeningEnabled = (cameraData.IsTemporalAAEnabled() && cameraData.taaSettings.contrastAdaptiveSharpening > 0.0f) && !settings.isFsrEnabled && !cameraData.IsSTPEnabled() && #if ENABLE_UPSCALER_FRAMEWORK cameraData.upscalingFilter != ImageUpscalingFilter.IUpscaler #else @@ -2509,7 +2489,7 @@ TextureHandle TryGetCachedUserLutTextureHandle(RenderGraph renderGraph) public void RenderUberPost(RenderGraph renderGraph, ContextContainer frameData, UniversalCameraData cameraData, UniversalPostProcessingData postProcessingData, in TextureHandle sourceTexture, in TextureHandle destTexture, in TextureHandle lutTexture, in TextureHandle bloomTexture, in TextureHandle overlayUITexture, - bool requireHDROutput, bool enableAlphaOutput, bool resolveToDebugScreen, bool hasFinalPass) + bool requireHDROutput, bool enableAlphaOutput, bool hasFinalPass) { var material = m_Materials.uber; bool hdrGrading = postProcessingData.gradingMode == ColorGradingMode.HighDynamicRange; @@ -2577,7 +2557,6 @@ public void RenderUberPost(RenderGraph renderGraph, ContextContainer frameData, var cmd = context.cmd; var camera = data.cameraData.camera; var material = data.material; - RTHandle sourceTextureHdl = data.sourceTexture; material.SetTexture(ShaderConstants._InternalLut, data.lutTexture); material.SetVector(ShaderConstants._Lut_Params, data.lutParams); @@ -2608,10 +2587,10 @@ public void RenderUberPost(RenderGraph renderGraph, ContextContainer frameData, // Done with Uber, blit it #if ENABLE_VR && ENABLE_XR_MODULE if (data.cameraData.xr.enabled && data.cameraData.xr.hasValidVisibleMesh) - ScaleViewportAndDrawVisibilityMesh(cmd, sourceTextureHdl, data.destinationTexture, data.cameraData, material, data.hasFinalPass); + ScaleViewportAndDrawVisibilityMesh(in context, in data.sourceTexture, in data.destinationTexture, data.cameraData, material, data.hasFinalPass); else #endif - ScaleViewportAndBlit(cmd, sourceTextureHdl, data.destinationTexture, data.cameraData, material, data.hasFinalPass); + ScaleViewportAndBlit(in context, in data.sourceTexture, in data.destinationTexture, data.cameraData, material, data.hasFinalPass); }); @@ -2870,7 +2849,7 @@ public void RenderPostProcessingRenderGraph(RenderGraph renderGraph, ContextCont bloomMipFlareSource = _BloomMipDown[0]; // Flare source and Flare target is the same texture. BloomMip[0] - sameBloomInputOutputTex = true; + sameBloomInputOutputTex = true; } // Kawase blur does not use the mip pyramid. @@ -2924,7 +2903,7 @@ public void RenderPostProcessingRenderGraph(RenderGraph renderGraph, ContextCont DebugHandler debugHandler = ScriptableRenderPass.GetActiveDebugHandler(cameraData); debugHandler?.UpdateShaderGlobalPropertiesForFinalValidationPass(renderGraph, cameraData, !m_HasFinalPass && !resolveToDebugScreen); - RenderUberPost(renderGraph, frameData, cameraData, postProcessingData, in currentSource, in postProcessingTarget, in lutTexture, in bloomTexture, in overlayUITexture, requireHDROutput, enableAlphaOutput, resolveToDebugScreen, hasFinalPass); + RenderUberPost(renderGraph, frameData, cameraData, postProcessingData, in currentSource, in postProcessingTarget, in lutTexture, in bloomTexture, in overlayUITexture, requireHDROutput, enableAlphaOutput, hasFinalPass); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs index 882e481ebef..2ff2b52f667 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/ScreenSpaceAmbientOcclusionPass.cs @@ -324,20 +324,21 @@ private void InitSSAOPassData(ref SSAOPassData data) data.directLightingStrength = m_CurrentSettings.DirectLightingStrength; } - private static Vector4 ComputeScaleBias(UniversalCameraData cameraData, RTHandle source, RTHandle destination) + private static Vector4 ComputeScaleBias(in UnsafeGraphContext context, in TextureHandle source, in TextureHandle destination) { + RTHandle srcRTHandle = source; Vector2 viewportScale; - if (source.useScaling) + if (srcRTHandle is { useScaling: true }) { - viewportScale.x = source.rtHandleProperties.rtHandleScale.x; - viewportScale.y = source.rtHandleProperties.rtHandleScale.y; + viewportScale.x = srcRTHandle.rtHandleProperties.rtHandleScale.x; + viewportScale.y = srcRTHandle.rtHandleProperties.rtHandleScale.y; } else { viewportScale = Vector2.one; } - bool yFlip = cameraData.IsHandleYFlipped(source) != cameraData.IsHandleYFlipped(destination); + bool yFlip = context.GetTextureUVOrigin(in source) != context.GetTextureUVOrigin(in destination); if (yFlip) return new Vector4(viewportScale.x, -viewportScale.y, 0, viewportScale.y); else @@ -429,20 +430,20 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer case ScreenSpaceAmbientOcclusionSettings.BlurQualityOptions.High: Blitter.BlitCameraTexture(cmd, data.AOTexture, data.blurTexture, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store, data.material, (int) ShaderPasses.BilateralBlurHorizontal); Blitter.BlitCameraTexture(cmd, data.blurTexture, data.AOTexture, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store, data.material, (int) ShaderPasses.BilateralBlurVertical); - viewScaleBias = ComputeScaleBias(data.cameraData, data.AOTexture, data.finalTexture); + viewScaleBias = ComputeScaleBias(in rgContext, in data.AOTexture, in data.finalTexture); Blitter.BlitCameraTexture(cmd, data.AOTexture, data.finalTexture, viewScaleBias, finalLoadAction, RenderBufferStoreAction.Store, data.material, (int) (data.afterOpaque ? ShaderPasses.BilateralAfterOpaque : ShaderPasses.BilateralBlurFinal)); break; // Gaussian case ScreenSpaceAmbientOcclusionSettings.BlurQualityOptions.Medium: Blitter.BlitCameraTexture(cmd, data.AOTexture, data.blurTexture, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, data.material, (int) ShaderPasses.GaussianBlurHorizontal); - viewScaleBias = ComputeScaleBias(data.cameraData, data.blurTexture, data.finalTexture); + viewScaleBias = ComputeScaleBias(in rgContext, in data.blurTexture, in data.finalTexture); Blitter.BlitCameraTexture(cmd, data.blurTexture, data.finalTexture, viewScaleBias, finalLoadAction, RenderBufferStoreAction.Store, data.material, (int) (data.afterOpaque ? ShaderPasses.GaussianAfterOpaque : ShaderPasses.GaussianBlurVertical)); break; // Kawase case ScreenSpaceAmbientOcclusionSettings.BlurQualityOptions.Low: - viewScaleBias = ComputeScaleBias(data.cameraData, data.AOTexture, data.finalTexture); + viewScaleBias = ComputeScaleBias(in rgContext, in data.AOTexture, in data.finalTexture); Blitter.BlitCameraTexture(cmd, data.AOTexture, data.finalTexture, viewScaleBias, finalLoadAction, RenderBufferStoreAction.Store, data.material, (int) (data.afterOpaque ? ShaderPasses.KawaseAfterOpaque : ShaderPasses.KawaseBlur)); break; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs index 68f722153db..97530afeb82 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs @@ -1118,6 +1118,7 @@ internal static bool IsHandleYFlipped(in RasterGraphContext renderGraphContext, return renderGraphContext.GetTextureUVOrigin(textureHandle) == TextureUVOrigin.BottomLeft; } +#if URP_COMPATIBILITY_MODE /// /// Returns the scale bias vector to use for final blits to the backbuffer, based on scaling mode and y-flip platform requirements. /// @@ -1127,9 +1128,19 @@ internal static bool IsHandleYFlipped(in RasterGraphContext renderGraphContext, /// internal static Vector4 GetFinalBlitScaleBias(RTHandle source, RTHandle destination, UniversalCameraData cameraData) { - Vector2 viewportScale = source.useScaling ? new Vector2(source.rtHandleProperties.rtHandleScale.x, source.rtHandleProperties.rtHandleScale.y) : Vector2.one; + Vector2 scale = source.useScaling ? new Vector2(source.rtHandleProperties.rtHandleScale.x, source.rtHandleProperties.rtHandleScale.y) : Vector2.one; var yflip = cameraData.IsRenderTargetProjectionMatrixFlipped(destination); - Vector4 scaleBias = !yflip ? new Vector4(viewportScale.x, -viewportScale.y, 0, viewportScale.y) : new Vector4(viewportScale.x, viewportScale.y, 0, 0); + Vector4 scaleBias = !yflip ? new Vector4(scale.x, -scale.y, 0, scale.y) : new Vector4(scale.x, scale.y, 0, 0); + + return scaleBias; + } +#endif + internal static Vector4 GetFinalBlitScaleBias(in RasterGraphContext renderGraphContext, in TextureHandle source, in TextureHandle destination) + { + RTHandle srcRTHandle = source; + Vector2 scale = srcRTHandle is {useScaling: true} ? new Vector2(srcRTHandle.rtHandleProperties.rtHandleScale.x, srcRTHandle.rtHandleProperties.rtHandleScale.y) : Vector2.one; + var yflip = renderGraphContext.GetTextureUVOrigin(in source) != renderGraphContext.GetTextureUVOrigin(in destination); + Vector4 scaleBias = yflip ? new Vector4(scale.x, -scale.y, 0, scale.y) : new Vector4(scale.x, scale.y, 0, 0); return scaleBias; } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs index 08f85d7bd20..2620ecccb6a 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs @@ -987,7 +987,7 @@ internal void ProcessVFXCameraCommand(RenderGraph renderGraph) } } - internal void SetupRenderGraphCameraProperties(RenderGraph renderGraph, bool isTargetBackbuffer, TextureHandle target) + internal void SetupRenderGraphCameraProperties(RenderGraph renderGraph, TextureHandle target) { using (var builder = renderGraph.AddRasterRenderPass(Profiling.setupCamera.name, out var passData, Profiling.setupCamera)) @@ -995,7 +995,6 @@ internal void SetupRenderGraphCameraProperties(RenderGraph renderGraph, bool isT passData.renderer = this; passData.cameraData = frameData.Get(); passData.cameraTargetSizeCopy = new Vector2Int(passData.cameraData.cameraTargetDescriptor.width, passData.cameraData.cameraTargetDescriptor.height); - passData.isTargetBackbuffer = isTargetBackbuffer; passData.target = target; builder.AllowGlobalStateModification(true); @@ -1229,7 +1228,6 @@ private class PassData { internal ScriptableRenderer renderer; internal UniversalCameraData cameraData; - internal bool isTargetBackbuffer; internal TextureHandle target; // The size of the camera target changes during the frame so we must make a copy of it here to preserve its record-time value. diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs index d0e619a6b34..200f497d242 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs @@ -114,7 +114,7 @@ public static float minRenderScale /// public static float maxRenderScale { - get => 2.0f; + get => 3.0f; } /// @@ -2347,7 +2347,11 @@ internal static bool HDROutputForAnyDisplayIsActive() // We only want to enable HDR Output for the game view once // since the game itself might want to control this - internal bool enableHDROnce = true; + internal bool enableHDROutputOnce = true; + + // We only want to warn once when the render pipeline asset HDR rendering support changes + // and HDR output is active, which is incompatible at the render pipeline asset level. + internal bool warnedRuntimeSwitchHDROutputToSDROutput = false; /// /// Configures the render pipeline to render to HDR output or disables HDR output. @@ -2359,20 +2363,34 @@ void SetHDRState(Camera[] cameras) #endif { bool hdrOutputActive = HDROutputSettings.main.available && HDROutputSettings.main.active; + bool hdrOutputIncompatibleWithSDRRendering = hdrOutputActive && HDROutputSettings.main.displayColorGamut != ColorGamut.Rec709; // If the pipeline doesn't support HDR rendering, output to SDR. - bool supportsSwitchingHDR = SystemInfo.hdrDisplaySupportFlags.HasFlag(HDRDisplaySupportFlags.RuntimeSwitchable); - bool switchHDRToSDR = supportsSwitchingHDR && !asset.supportsHDR && hdrOutputActive; - if (switchHDRToSDR) + bool supportsSwitchingHDROutput = SystemInfo.hdrDisplaySupportFlags.HasFlag(HDRDisplaySupportFlags.RuntimeSwitchable); + bool switchHDROutputToSDROutput = !asset.supportsHDR && hdrOutputActive && hdrOutputIncompatibleWithSDRRendering; + if (switchHDROutputToSDROutput && !warnedRuntimeSwitchHDROutputToSDROutput) { - HDROutputSettings.main.RequestHDRModeChange(false); + if (supportsSwitchingHDROutput) + { + Debug.Log("HDR output is being disabled because the current Render Pipeline Asset does not support HDR rendering."); + HDROutputSettings.main.RequestHDRModeChange(false); + } + else + { + Debug.LogWarning("HDR output is active and cannot be switched off at runtime, but the current Render Pipeline Asset does not support HDR rendering. Image may appear underexposed or oversaturated."); + } + warnedRuntimeSwitchHDROutputToSDROutput = true; } + // Reset the warning flag as soon as the RP asset supports HDR rendering + if (warnedRuntimeSwitchHDROutputToSDROutput && asset.supportsHDR) + warnedRuntimeSwitchHDROutputToSDROutput = false; + #if UNITY_EDITOR bool requestedHDRModeChange = false; // Automatically switch to HDR in the editor if it's available - if (supportsSwitchingHDR && asset.supportsHDR && PlayerSettings.useHDRDisplay && HDROutputSettings.main.available) + if (supportsSwitchingHDROutput && asset.supportsHDR && PlayerSettings.useHDRDisplay && HDROutputSettings.main.available) { #if UNITY_2021_1_OR_NEWER int cameraCount = cameras.Count; @@ -2384,15 +2402,15 @@ void SetHDRState(Camera[] cameras) requestedHDRModeChange = hdrOutputActive; HDROutputSettings.main.RequestHDRModeChange(false); } - else if (enableHDROnce) + else if (enableHDROutputOnce) { requestedHDRModeChange = !hdrOutputActive; HDROutputSettings.main.RequestHDRModeChange(true); - enableHDROnce = false; + enableHDROutputOnce = false; } } - if (requestedHDRModeChange || switchHDRToSDR) + if (requestedHDRModeChange || switchHDROutputToSDROutput) { // Repaint scene views and game views so the HDR mode request is applied UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs index 1be61e12e3e..32480573a10 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs @@ -2084,11 +2084,5 @@ internal static ShEvalMode ShAutoDetect(ShEvalMode mode) } internal static bool isRunningOnPowerVRGPU = SystemInfo.graphicsDeviceName.Contains("PowerVR"); - - // Mali Valhall architecture GPUs (G76, G77, G78, etc.) have issues with separate depth textures when SSAO is enabled - // This affects depth texture sampling patterns in SSAO passes - internal static bool isRunningOnMaliValhallGPU = SystemInfo.graphicsDeviceName.StartsWith("Mali-G5") || - SystemInfo.graphicsDeviceName.StartsWith("Mali-G6") || - SystemInfo.graphicsDeviceName.StartsWith("Mali-G7"); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 1083541af39..8fa5309792d 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -59,9 +59,9 @@ public sealed partial class UniversalRenderer : ScriptableRenderer const int k_FinalBlitPassQueueOffset = 1; const int k_AfterFinalBlitPassQueueOffset = k_FinalBlitPassQueueOffset + 1; - static readonly List k_DepthNormalsOnly = new List { new ShaderTagId("DepthNormalsOnly") }; - #if URP_COMPATIBILITY_MODE + static readonly List k_DepthNormalsOnly = new List { new ShaderTagId("DepthNormalsOnly") }; + static class ProfilingCompatibilityMode { private const string k_Name = nameof(UniversalRenderer); @@ -940,6 +940,7 @@ public override void Setup(ScriptableRenderContext context, ref RenderingData re requiresDepthPrepass |= isPreviewCamera; requiresDepthPrepass |= renderPassInputs.requiresDepthPrepass; requiresDepthPrepass |= renderPassInputs.requiresNormalsTexture; + requiresDepthPrepass |= IsGLESDevice() && postProcessPass?.useLensFlare == true; // Current aim of depth prepass is to generate a copy of depth buffer, it is NOT to prime depth buffer and reduce overdraw on non-mobile platforms. // When deferred renderer is enabled, depth buffer is already accessible so depth prepass is not needed. @@ -1416,11 +1417,6 @@ public override void Setup(ScriptableRenderContext context, ref RenderingData re EnqueuePass(m_DrawSkyboxPass); } - // Mali Valhall + SSAO compatibility: Force depth copy when needed -#if UNITY_ANDROID - requiresDepthCopyPass |= PlatformAutoDetect.isRunningOnMaliValhallGPU && renderingData.cameraData.postProcessEnabled; -#endif - // If a depth texture was created we necessarily need to copy it, otherwise we could have render it to a renderbuffer. // Also skip if Deferred+RenderPass as CameraDepthTexture is used and filled by the GBufferPass // however we might need the depth texture with Forward-only pass rendered to it, so enable the copy depth in that case diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs index 611e01c251a..2d209a3620c 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs @@ -227,7 +227,8 @@ private void CleanupRenderGraphResources() } /// - /// Utility method to convert RenderTextureDescriptor to TextureHandle and create a RenderGraph texture + /// Utility method to convert RenderTextureDescriptor to TextureHandle and create a RenderGraph texture. + /// The use of RenderTextureDescriptor is obsolete with RenderGraph, use TextureDesc instead. /// /// /// @@ -239,48 +240,62 @@ private void CleanupRenderGraphResources() public static TextureHandle CreateRenderGraphTexture(RenderGraph renderGraph, RenderTextureDescriptor desc, string name, bool clear, FilterMode filterMode = FilterMode.Point, TextureWrapMode wrapMode = TextureWrapMode.Clamp) { - TextureDesc rgDesc = new TextureDesc(desc.width, desc.height); - rgDesc.dimension = desc.dimension; + TextureDesc rgDesc; + GetTextureDesc(in desc, out rgDesc); + rgDesc.clearBuffer = clear; - rgDesc.bindTextureMS = desc.bindMS; - rgDesc.format = (desc.depthStencilFormat != GraphicsFormat.None) ? desc.depthStencilFormat : desc.graphicsFormat; - rgDesc.slices = desc.volumeDepth; - rgDesc.msaaSamples = (MSAASamples)desc.msaaSamples; rgDesc.name = name; - rgDesc.enableRandomWrite = desc.enableRandomWrite; rgDesc.filterMode = filterMode; rgDesc.wrapMode = wrapMode; - rgDesc.isShadowMap = desc.shadowSamplingMode != ShadowSamplingMode.None && desc.depthStencilFormat != GraphicsFormat.None; - rgDesc.vrUsage = desc.vrUsage; - rgDesc.enableShadingRate = desc.enableShadingRate; - rgDesc.useDynamicScale = desc.useDynamicScale; - rgDesc.useDynamicScaleExplicit = desc.useDynamicScaleExplicit; return renderGraph.CreateTexture(rgDesc); } - internal static TextureHandle CreateRenderGraphTexture(RenderGraph renderGraph, RenderTextureDescriptor desc, string name, bool clear, Color color, + internal static TextureHandle CreateRenderGraphTexture(RenderGraph renderGraph, in RenderTextureDescriptor desc, string name, bool clear, Color color, FilterMode filterMode = FilterMode.Point, TextureWrapMode wrapMode = TextureWrapMode.Clamp, bool discardOnLastUse = false) { - TextureDesc rgDesc = new TextureDesc(desc.width, desc.height); - rgDesc.dimension = desc.dimension; + TextureDesc rgDesc; + GetTextureDesc(in desc, out rgDesc); + rgDesc.clearBuffer = clear; rgDesc.clearColor = color; + rgDesc.msaaSamples = (MSAASamples)desc.msaaSamples; + rgDesc.name = name; + rgDesc.filterMode = filterMode; + rgDesc.wrapMode = wrapMode; + rgDesc.discardBuffer = discardOnLastUse; + + return renderGraph.CreateTexture(rgDesc); + } + + internal static void GetTextureDesc(in RenderTextureDescriptor desc, out TextureDesc rgDesc) + { + rgDesc = new TextureDesc(desc.width, desc.height); + rgDesc.dimension = desc.dimension; rgDesc.bindTextureMS = desc.bindMS; rgDesc.format = (desc.depthStencilFormat != GraphicsFormat.None) ? desc.depthStencilFormat : desc.graphicsFormat; + rgDesc.isShadowMap = desc.shadowSamplingMode != ShadowSamplingMode.None && desc.depthStencilFormat != GraphicsFormat.None; rgDesc.slices = desc.volumeDepth; rgDesc.msaaSamples = (MSAASamples)desc.msaaSamples; - rgDesc.name = name; rgDesc.enableRandomWrite = desc.enableRandomWrite; - rgDesc.filterMode = filterMode; - rgDesc.wrapMode = wrapMode; rgDesc.enableShadingRate = desc.enableShadingRate; rgDesc.useDynamicScale = desc.useDynamicScale; rgDesc.useDynamicScaleExplicit = desc.useDynamicScaleExplicit; - rgDesc.discardBuffer = discardOnLastUse; rgDesc.vrUsage = desc.vrUsage; + } - return renderGraph.CreateTexture(rgDesc); + internal static TextureHandle CreateRenderGraphTexture(RenderGraph renderGraph, in TextureDesc desc, string name, bool clear, Color clearColor, + FilterMode filterMode = FilterMode.Point, TextureWrapMode wrapMode = TextureWrapMode.Clamp, bool discardOnLastUse = false) + { + TextureDesc outDesc = desc; + outDesc.name = name; + outDesc.clearBuffer = clear; + outDesc.clearColor = clearColor; + outDesc.filterMode = filterMode; + outDesc.wrapMode = wrapMode; + outDesc.discardBuffer = discardOnLastUse; + + return renderGraph.CreateTexture(outDesc); } bool RequiresIntermediateAttachments(UniversalCameraData cameraData, in RenderPassInputSummary renderPassInputs, bool requireCopyFromDepth, bool applyPostProcessing) @@ -352,36 +367,36 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera // Import backbuffers to Render Graph ImportBackBuffers(renderGraph, cameraData, clearCameraParams.clearValue, isCameraTargetOffscreenDepth); - // If required, create intermediate color attachment where URP will render before final blit - if (requireIntermediateAttachments && !isCameraTargetOffscreenDepth) - { - CreateIntermediateCameraColorAttachment(renderGraph, cameraData, clearCameraParams.mustClearColor, clearCameraParams.clearValue); - } - else - { - resourceData.activeColorID = UniversalResourceData.ActiveID.BackBuffer; - } + TextureDesc cameraDescriptor; + GetTextureDesc(in cameraData.cameraTargetDescriptor, out cameraDescriptor); + cameraDescriptor.useMipMap = false; + cameraDescriptor.autoGenerateMips = false; + cameraDescriptor.mipMapBias = 0; + cameraDescriptor.anisoLevel = 1; - // If required, create intermediate depth attachment if (requireIntermediateAttachments) { - CreateIntermediateCameraDepthAttachment(renderGraph, cameraData, clearCameraParams.mustClearDepth, clearCameraParams.clearValue, depthTextureIsDepthFormat); + cameraDescriptor.format = cameraData.cameraTargetDescriptor.graphicsFormat; + + if (!isCameraTargetOffscreenDepth) + CreateIntermediateCameraColorAttachment(renderGraph, cameraData, in cameraDescriptor, clearCameraParams.mustClearColor, clearCameraParams.clearValue); + + cameraDescriptor.format = cameraData.cameraTargetDescriptor.depthStencilFormat; + + CreateIntermediateCameraDepthAttachment(renderGraph, cameraData, in cameraDescriptor, clearCameraParams.mustClearDepth, clearCameraParams.clearValue, depthTextureIsDepthFormat); } else { - resourceData.activeDepthID = UniversalResourceData.ActiveID.BackBuffer; + resourceData.SwitchActiveTexturesToBackbuffer(); } - CreateCameraDepthCopyTexture(renderGraph, cameraData.cameraTargetDescriptor, depthTextureIsDepthFormat); + CreateCameraDepthCopyTexture(renderGraph, cameraDescriptor, depthTextureIsDepthFormat, clearCameraParams.clearValue); - CreateCameraNormalsTexture(renderGraph, cameraData.cameraTargetDescriptor); + CreateCameraNormalsTexture(renderGraph, cameraDescriptor); - CreateMotionVectorTextures(renderGraph, cameraData.cameraTargetDescriptor); + CreateMotionVectorTextures(renderGraph, cameraDescriptor); - CreateRenderingLayersTexture(renderGraph, cameraData.cameraTargetDescriptor); - - if (!isCameraTargetOffscreenDepth) - CreateAfterPostProcessTexture(renderGraph, cameraData.cameraTargetDescriptor); + CreateRenderingLayersTexture(renderGraph, cameraDescriptor); } private readonly struct ClearCameraParams @@ -595,7 +610,7 @@ internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRe bool requirePrepass = requirePrepassForTextures || useDepthPriming; // Only use a depth format when we do a prepass directly the cameraDepthTexture. If we do depth priming (ie, prepass to the activeCameraDepth), we don't do a prepass to the texture. Instead, we do a copy from the primed attachment. - bool prepassToCameraDepthTexture = requirePrepass && !useDepthPriming; + bool prepassToCameraDepthTexture = requirePrepassForTextures && !usesDeferredLighting; bool depthTextureIsDepthFormat = prepassToCameraDepthTexture; bool requireCopyFromDepth = requireDepthTexture && !prepassToCameraDepthTexture; @@ -611,7 +626,7 @@ internal override void OnRecordRenderGraph(RenderGraph renderGraph, ScriptableRe RecordCustomRenderGraphPasses(renderGraph, RenderPassEvent.BeforeRendering); - SetupRenderGraphCameraProperties(renderGraph, resourceData.isActiveTargetBackBuffer, resourceData.activeColorTexture.IsValid() ? resourceData.activeColorTexture : resourceData.activeDepthTexture); + SetupRenderGraphCameraProperties(renderGraph, resourceData.activeColorTexture.IsValid() ? resourceData.activeColorTexture : resourceData.activeDepthTexture); #if VISUAL_EFFECT_GRAPH_0_0_1_OR_NEWER ProcessVFXCameraCommand(renderGraph); @@ -739,7 +754,7 @@ private void OnBeforeRendering(RenderGraph renderGraph) // The camera need to be setup again after the shadows since those passes override some settings // TODO RENDERGRAPH: move the setup code into the shadow passes if (renderShadows) - SetupRenderGraphCameraProperties(renderGraph, resourceData.isActiveTargetBackBuffer, resourceData.activeColorTexture.IsValid() ? resourceData.activeColorTexture : resourceData.activeDepthTexture); + SetupRenderGraphCameraProperties(renderGraph, resourceData.activeColorTexture.IsValid() ? resourceData.activeColorTexture : resourceData.activeDepthTexture); RecordCustomRenderGraphPasses(renderGraph, RenderPassEvent.AfterRenderingShadows); @@ -834,7 +849,7 @@ private void RecordCustomPassesWithDepthCopyAndMotion(RenderGraph renderGraph, U private static bool AllowPartialDepthNormalsPrepass(bool isDeferred, RenderPassEvent requiresDepthNormalEvent, bool useDepthPriming) { return isDeferred && ((RenderPassEvent.AfterRenderingGbuffer <= requiresDepthNormalEvent) && - (requiresDepthNormalEvent <= RenderPassEvent.BeforeRenderingOpaques)) && useDepthPriming; + (requiresDepthNormalEvent <= RenderPassEvent.BeforeRenderingOpaques)) && !useDepthPriming; } // Enumeration of possible positions within the frame where the depth copy can occur @@ -922,7 +937,7 @@ private struct TextureCopySchedules internal ColorCopySchedule color; } - private TextureCopySchedules CalculateTextureCopySchedules(UniversalCameraData cameraData, in RenderPassInputSummary renderPassInputs, bool requiresDepthPrepass, bool hasFullPrepass, bool requireDepthTexture) + private TextureCopySchedules CalculateTextureCopySchedules(UniversalCameraData cameraData, in RenderPassInputSummary renderPassInputs, bool isDeferred, bool requiresDepthPrepass, bool hasFullPrepass, bool requireDepthTexture) { // Assume the depth texture is unused and no copy is needed until we determine otherwise DepthCopySchedule depth = DepthCopySchedule.None; @@ -931,7 +946,7 @@ private TextureCopySchedules CalculateTextureCopySchedules(UniversalCameraData c if (requireDepthTexture) { //The prepass will render directly to the depthTexture when not using depth priming. Therefore we don't need a copy in that case. - bool depthTextureRequiresCopy = (!requiresDepthPrepass || useDepthPriming); + bool depthTextureRequiresCopy = isDeferred || (!requiresDepthPrepass || useDepthPriming); depth = depthTextureRequiresCopy ? CalculateDepthCopySchedule(renderPassInputs.requiresDepthTextureEarliestEvent, hasFullPrepass) : DepthCopySchedule.DuringPrepass; @@ -998,7 +1013,7 @@ private void OnMainRendering(RenderGraph renderGraph, ScriptableRenderContext co // - Have a depth normals prepass that does not allow the partial prepass optimization bool hasFullPrepass = isDepthOnlyPrepass || (isDepthNormalPrepass && !AllowPartialDepthNormalsPrepass(usesDeferredLighting, renderPassInputs.requiresDepthNormalAtEvent, useDepthPriming)); - TextureCopySchedules copySchedules = CalculateTextureCopySchedules(cameraData, renderPassInputs, requiresPrepass, hasFullPrepass, requireDepthTexture); + TextureCopySchedules copySchedules = CalculateTextureCopySchedules(cameraData, renderPassInputs, usesDeferredLighting, requiresPrepass, hasFullPrepass, requireDepthTexture); // Decide if & when to use GPU Occlusion Culling. // In deferred, do it during gbuffer laydown unless we are forced to do a *full* prepass by a render pass. @@ -1034,10 +1049,13 @@ private void OnMainRendering(RenderGraph renderGraph, ScriptableRenderContext co if (requiresPrepass) { - TextureHandle depthTarget = useDepthPriming ? resourceData.activeDepthTexture : resourceData.cameraDepthTexture; + // If we're in deferred mode, prepasses always render directly to the depth attachment rather than the camera depth texture. + // In non-deferred mode, we only render to the depth attachment directly when depth priming is enabled and we're starting with an empty depth buffer. + bool renderToAttachment = (usesDeferredLighting || useDepthPriming); + TextureHandle depthTarget = renderToAttachment ? resourceData.activeDepthTexture : resourceData.cameraDepthTexture; // Prepare stencil buffer for stencil-based cross-fade lod in depth normal prepass. Depth prepass doesn't use stencil test (same as shadow). - if (renderingData.stencilLodCrossFadeEnabled && isDepthNormalPrepass && !useDepthPriming) + if (renderingData.stencilLodCrossFadeEnabled && isDepthNormalPrepass && !renderToAttachment) m_StencilCrossFadeRenderPass.Render(renderGraph, context, resourceData.cameraDepthTexture); bool needsOccluderUpdate = occluderPass == OccluderPass.DepthPrepass; @@ -1060,7 +1078,7 @@ private void OnMainRendering(RenderGraph renderGraph, ScriptableRenderContext co // When we render to the depth attachment, a copy must happen later to populate the camera depth texture and the copy will handle setting globals. // If we're rendering to the camera depth texture, we can set the globals immediately. - bool setGlobalDepth = isLastPass && !useDepthPriming; + bool setGlobalDepth = isLastPass && !renderToAttachment; // There's no special copy logic for the camera normals texture, so we can set the global as long as we're not performing a partial prepass. // In the case of a partial prepass, the global will be set later by the gbuffer pass once it completes the data in the texture. @@ -1073,17 +1091,17 @@ private void OnMainRendering(RenderGraph renderGraph, ScriptableRenderContext co // Therefore we need to set the camera properties for the DepthNormal to be consistent with rendering to an intermediate render target. if (resourceData.isActiveTargetBackBuffer) { - SetupRenderGraphCameraProperties(renderGraph, false, depthTarget); + SetupRenderGraphCameraProperties(renderGraph, depthTarget); } - DepthNormalPrepassRender(renderGraph, renderPassInputs, depthTarget, batchLayerMask, setGlobalDepth, setGlobalTextures); + DepthNormalPrepassRender(renderGraph, renderPassInputs, depthTarget, batchLayerMask, setGlobalDepth, setGlobalTextures, !hasFullPrepass); // Restore camera properties for the rest of the render graph execution. if (resourceData.isActiveTargetBackBuffer) { - SetupRenderGraphCameraProperties(renderGraph, true, resourceData.activeColorTexture.IsValid() ? resourceData.activeColorTexture : resourceData.activeDepthTexture); + SetupRenderGraphCameraProperties(renderGraph, resourceData.activeColorTexture.IsValid() ? resourceData.activeColorTexture : resourceData.activeDepthTexture); } } else - m_DepthPrepass.Render(renderGraph, frameData, ref depthTarget, batchLayerMask, setGlobalDepth); + m_DepthPrepass.Render(renderGraph, frameData, in depthTarget, batchLayerMask, setGlobalDepth); if (needsOccluderUpdate) { @@ -1253,10 +1271,11 @@ private void OnMainRendering(RenderGraph renderGraph, ScriptableRenderContext co if (copySchedules.color == ColorCopySchedule.AfterSkybox) { - TextureHandle activeColor = resourceData.activeColorTexture; + TextureHandle cameraColor = resourceData.cameraColor; + Debug.Assert(cameraColor.IsValid()); Downsampling downsamplingMethod = UniversalRenderPipeline.asset.opaqueDownsampling; TextureHandle cameraOpaqueTexture; - m_CopyColorPass.Render(renderGraph, frameData, out cameraOpaqueTexture, in activeColor, downsamplingMethod); + m_CopyColorPass.Render(renderGraph, frameData, out cameraOpaqueTexture, in cameraColor, downsamplingMethod); resourceData.cameraOpaqueTexture = cameraOpaqueTexture; } @@ -1588,11 +1607,11 @@ static bool RequireDepthTexture(UniversalCameraData cameraData, in RenderPassInp } /// - /// When true the pipeline needs to add a prepass that renders depth to the currentCameraDepth. + /// When true the pipeline needs to add a full prepass that renders depth to the currentCameraDepth. /// Depth priming is an optimization (on certain devices/platforms). Features that want to leverage this as an optimization /// need to check UniversalRender.useDepthPriming (which equal to the result of this function) /// to ensure that the pipeline will actually do depth priming. - /// When this is true then we are sure that after RenderPassEvent.AfterRenderingPrePasses the currentCameraDepth has been primed. + /// When this is true then we are sure that after RenderPassEvent.AfterRenderingPrePasses the currentCameraDepth has been primed with the full depth. /// static bool IsDepthPrimingEnabledRenderGraph(UniversalCameraData cameraData, in RenderPassInputSummary renderPassInputs, DepthPrimingMode depthPrimingMode, bool requireDepthTexture, bool requirePrepassForTextures, bool usesDeferredLighting) { @@ -1632,19 +1651,6 @@ static bool IsDepthPrimingEnabledRenderGraph(UniversalCameraData cameraData, in bool depthPrimingRequested = (depthPrimingRecommended && depthPrimingMode == DepthPrimingMode.Auto) || depthPrimingMode == DepthPrimingMode.Forced; bool isNotMSAA = cameraData.cameraTargetDescriptor.msaaSamples == 1; - { - //TODO this need to be further investigated. This moved here from the MainRendering to consolidate all the depth priming logic in one place. The PR that landed this aimed to refactor without unnecessarily changing behavior. - //The prepass and gbuffer logic should have an alternative path that can handle depth priming off. This way, we can respect the user setting Never and Forced. - //Priming is bad for performance when using deferred so we don't allow it. However, when a prepass for textures is required, the gbuffer pass currently - //relies on the prepass writing the same (activeCameraDepth) depth resource. - bool needsPrimingForDeferredWithPartialPrepass = usesDeferredLighting - && ((RenderPassEvent.AfterRenderingGbuffer <= renderPassInputs.requiresDepthNormalAtEvent) && - (renderPassInputs.requiresDepthNormalAtEvent <= RenderPassEvent.BeforeRenderingOpaques)) - && requirePrepassForTextures; - if (needsPrimingForDeferredWithPartialPrepass && isNotMSAA) - return true; - } - bool isFirstCameraToWriteDepth = cameraData.renderType == CameraRenderType.Base || cameraData.clearDepth; // Depth is not rendered in a depth-only camera setup with depth priming (UUM-38158) bool isNotOffscreenDepthTexture = !IsOffscreenDepthTexture(cameraData); @@ -1796,28 +1802,29 @@ void ImportBackBuffers(RenderGraph renderGraph, UniversalCameraData cameraData, resourceData.backBufferDepth = renderGraph.ImportTexture(m_TargetDepthHandle, importInfoDepth, importBackbufferDepthParams); } - void CreateIntermediateCameraColorAttachment(RenderGraph renderGraph, UniversalCameraData cameraData, bool clearColor, Color clearBackgroundColor) + void CreateIntermediateCameraColorAttachment(RenderGraph renderGraph, UniversalCameraData cameraData, in TextureDesc cameraDescriptor, bool clearColor, Color clearBackgroundColor) { var resourceData = frameData.Get(); - var cameraTargetDescriptor = cameraData.cameraTargetDescriptor; - cameraTargetDescriptor.useMipMap = false; - cameraTargetDescriptor.autoGenerateMips = false; - cameraTargetDescriptor.depthStencilFormat = GraphicsFormat.None; + var desc = cameraDescriptor; + desc.useMipMap = false; + desc.autoGenerateMips = false; + desc.filterMode = FilterMode.Bilinear; + desc.wrapMode = TextureWrapMode.Clamp; // When there's a single camera setup, there's no need to do the double buffer technique with attachment A/B, in order to save memory allocation // and simplify the workflow by using a RenderGraph texture directly. var isSingleCamera = cameraData.resolveFinalTarget && cameraData.renderType == CameraRenderType.Base; if (isSingleCamera) { - resourceData.cameraColor = CreateRenderGraphTexture(renderGraph, cameraTargetDescriptor, _SingleCameraTargetAttachmentName, clearColor, clearBackgroundColor, FilterMode.Bilinear, discardOnLastUse: cameraData.resolveFinalTarget); + resourceData.cameraColor = CreateRenderGraphTexture(renderGraph, in desc, _SingleCameraTargetAttachmentName, clearColor, clearBackgroundColor, desc.filterMode, discardOnLastUse: cameraData.resolveFinalTarget); m_CurrentColorHandle = -1; } else { - RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraColorHandles[0], cameraTargetDescriptor, FilterMode.Bilinear, TextureWrapMode.Clamp, name: _CameraTargetAttachmentAName); - RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraColorHandles[1], cameraTargetDescriptor, FilterMode.Bilinear, TextureWrapMode.Clamp, name: _CameraTargetAttachmentBName); + RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraColorHandles[0], desc, _CameraTargetAttachmentAName); + RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraColorHandles[1], desc, _CameraTargetAttachmentBName); // Make sure that the base camera always starts rendering to the ColorAttachmentA for deterministic frame results. // Not doing so makes the targets look different every frame, causing the frame debugger to flash, and making debugging harder. @@ -1836,65 +1843,62 @@ void CreateIntermediateCameraColorAttachment(RenderGraph renderGraph, UniversalC resourceData.activeColorID = UniversalResourceData.ActiveID.Camera; } - void CreateIntermediateCameraDepthAttachment(RenderGraph renderGraph, UniversalCameraData cameraData, bool clearDepth, Color clearBackgroundDepth, bool depthTextureIsDepthFormat) + void CreateIntermediateCameraDepthAttachment(RenderGraph renderGraph, UniversalCameraData cameraData, in TextureDesc cameraDescriptor, bool clearDepth, Color clearBackgroundDepth, bool depthTextureIsDepthFormat) { var resourceData = frameData.Get(); - var depthDescriptor = cameraData.cameraTargetDescriptor; - depthDescriptor.useMipMap = false; - depthDescriptor.autoGenerateMips = false; + var desc = cameraDescriptor; + desc.useMipMap = false; + desc.autoGenerateMips = false; - bool hasMSAA = depthDescriptor.msaaSamples > 1; + bool hasMSAA = desc.msaaSamples != MSAASamples.None; bool resolveDepth = RenderingUtils.MultisampleDepthResolveSupported() && renderGraph.nativeRenderPassesEnabled; // If we aren't using hardware depth resolves and we have MSAA, we need to resolve depth manually by binding as an MSAA texture. - depthDescriptor.bindMS = !resolveDepth && hasMSAA; + desc.bindTextureMS = !resolveDepth && hasMSAA; // binding MS surfaces is not supported by the GLES backend, and it won't be fixed after investigating // the high performance impact of potential fixes, which would make it more expensive than depth prepass (fogbugz 1339401 for more info) if (IsGLESDevice()) - depthDescriptor.bindMS = false; + desc.bindTextureMS = false; - depthDescriptor.graphicsFormat = GraphicsFormat.None; - depthDescriptor.depthStencilFormat = cameraDepthAttachmentFormat; + desc.format = cameraDepthAttachmentFormat; + desc.filterMode = FilterMode.Point; + desc.wrapMode = TextureWrapMode.Clamp; + + bool discardOnLastUse = cameraData.resolveFinalTarget; // Last camera in stack +#if UNITY_EDITOR + // scene filtering will reuse "camera" depth from the normal pass for the "filter highlight" effect + if (cameraData.isSceneViewCamera && CoreUtils.IsSceneFilteringEnabled()) + discardOnLastUse = false; +#endif // When there's a single camera setup, we can simplify the workflow by using a RenderGraph texture directly. // In the multi camera setup case, we still have to use import mechanism because each camera records its own graph; they share the imported intermediate depth texture. var isSingleCamera = cameraData.resolveFinalTarget && cameraData.renderType == CameraRenderType.Base; if (isSingleCamera) { - bool discardOnLastUse = cameraData.resolveFinalTarget; // Last camera in stack -#if UNITY_EDITOR - // scene filtering will reuse "camera" depth from the normal pass for the "filter highlight" effect - if (cameraData.isSceneViewCamera && CoreUtils.IsSceneFilteringEnabled()) - discardOnLastUse = false; -#endif - resourceData.cameraDepth = CreateRenderGraphTexture(renderGraph, depthDescriptor, _CameraDepthAttachmentName, clearDepth, clearBackgroundDepth, FilterMode.Point, TextureWrapMode.Clamp, discardOnLastUse: discardOnLastUse); + resourceData.cameraDepth = CreateRenderGraphTexture(renderGraph, desc, _CameraDepthAttachmentName, clearDepth, clearBackgroundDepth, desc.filterMode, desc.wrapMode, discardOnLastUse: discardOnLastUse); } else { - RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraDepthHandle, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: _CameraDepthAttachmentName); + RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraDepthHandle, desc, _CameraDepthAttachmentName); ImportResourceParams importDepthParams = new ImportResourceParams(); importDepthParams.clearOnFirstUse = clearDepth; importDepthParams.clearColor = clearBackgroundDepth; - importDepthParams.discardOnLastUse = cameraData.resolveFinalTarget; // Last camera in stack + importDepthParams.discardOnLastUse = discardOnLastUse; -#if UNITY_EDITOR - // scene filtering will reuse "camera" depth from the normal pass for the "filter highlight" effect - if (cameraData.isSceneViewCamera && CoreUtils.IsSceneFilteringEnabled()) - importDepthParams.discardOnLastUse = false; -#endif resourceData.cameraDepth = renderGraph.ImportTexture(m_RenderGraphCameraDepthHandle, importDepthParams); } resourceData.activeDepthID = UniversalResourceData.ActiveID.Camera; // Configure the copy depth pass based on the allocated depth texture - m_CopyDepthPass.MsaaSamples = depthDescriptor.msaaSamples; + m_CopyDepthPass.MsaaSamples = (int) desc.msaaSamples; m_CopyDepthPass.CopyToDepth = depthTextureIsDepthFormat; - var copyResolvedDepth = !depthDescriptor.bindMS; + var copyResolvedDepth = !desc.bindTextureMS; m_CopyDepthPass.m_CopyResolvedDepth = copyResolvedDepth; #if ENABLE_VR && ENABLE_XR_MODULE @@ -1902,62 +1906,58 @@ void CreateIntermediateCameraDepthAttachment(RenderGraph renderGraph, UniversalC #endif } - void CreateCameraDepthCopyTexture(RenderGraph renderGraph, RenderTextureDescriptor descriptor, bool isDepthTexture) + void CreateCameraDepthCopyTexture(RenderGraph renderGraph, TextureDesc descriptor, bool isDepthTexture, Color clearColor) { UniversalResourceData resourceData = frameData.Get(); var depthDescriptor = descriptor; - depthDescriptor.msaaSamples = 1;// Depth-Only pass don't use MSAA + depthDescriptor.msaaSamples = MSAASamples.None;// Depth-Only pass don't use MSAA + if (isDepthTexture) { - depthDescriptor.graphicsFormat = GraphicsFormat.None; - depthDescriptor.depthStencilFormat = cameraDepthTextureFormat; + depthDescriptor.format = cameraDepthTextureFormat; + depthDescriptor.clearBuffer = true; //will be rendered to } else { - depthDescriptor.graphicsFormat = GraphicsFormat.R32_SFloat; - depthDescriptor.depthStencilFormat = GraphicsFormat.None; + depthDescriptor.format = GraphicsFormat.R32_SFloat; + depthDescriptor.clearBuffer = false; //will be copied to } - resourceData.cameraDepthTexture = CreateRenderGraphTexture(renderGraph, depthDescriptor, "_CameraDepthTexture", true); + resourceData.cameraDepthTexture = CreateRenderGraphTexture(renderGraph, depthDescriptor, "_CameraDepthTexture", depthDescriptor.clearBuffer, clearColor); } - void CreateMotionVectorTextures(RenderGraph renderGraph, RenderTextureDescriptor descriptor) + void CreateMotionVectorTextures(RenderGraph renderGraph, TextureDesc descriptor) { UniversalResourceData resourceData = frameData.Get(); - var colorDesc = descriptor; - colorDesc.msaaSamples = 1; // Disable MSAA, consider a pixel resolve for half left velocity and half right velocity --> no velocity, which is untrue. - colorDesc.graphicsFormat = MotionVectorRenderPass.k_TargetFormat; - colorDesc.depthStencilFormat = GraphicsFormat.None; - resourceData.motionVectorColor = CreateRenderGraphTexture(renderGraph, colorDesc, MotionVectorRenderPass.k_MotionVectorTextureName, true); + descriptor.msaaSamples = MSAASamples.None; // Disable MSAA, consider a pixel resolve for half left velocity and half right velocity --> no velocity, which is untrue. - var depthDescriptor = descriptor; - depthDescriptor.msaaSamples = 1; - depthDescriptor.graphicsFormat = GraphicsFormat.None; - depthDescriptor.depthStencilFormat = cameraDepthAttachmentFormat; - resourceData.motionVectorDepth = CreateRenderGraphTexture(renderGraph, depthDescriptor, MotionVectorRenderPass.k_MotionVectorDepthTextureName, true); + descriptor.format = MotionVectorRenderPass.k_TargetFormat; + + resourceData.motionVectorColor = CreateRenderGraphTexture(renderGraph, descriptor, MotionVectorRenderPass.k_MotionVectorTextureName, true, Color.black); + + descriptor.format = cameraDepthAttachmentFormat; + resourceData.motionVectorDepth = CreateRenderGraphTexture(renderGraph, descriptor, MotionVectorRenderPass.k_MotionVectorDepthTextureName, true, Color.black); } - void CreateCameraNormalsTexture(RenderGraph renderGraph, RenderTextureDescriptor descriptor) + void CreateCameraNormalsTexture(RenderGraph renderGraph, TextureDesc descriptor) { UniversalResourceData resourceData = frameData.Get(); - var normalDescriptor = descriptor; - normalDescriptor.depthStencilFormat = GraphicsFormat.None; - normalDescriptor.msaaSamples = 1; // Never use MSAA for the normal texture! + descriptor.msaaSamples = MSAASamples.None; // Never use MSAA for the normal texture! // Find compatible render-target format for storing normals. // Shader code outputs normals in signed format to be compatible with deferred gbuffer layout. // Deferred gbuffer format is signed so that normals can be blended for terrain geometry. var normalsName = !usesDeferredLighting ? DepthNormalOnlyPass.k_CameraNormalsTextureName : DeferredLights.k_GBufferNames[m_DeferredLights.GBufferNormalSmoothnessIndex]; - normalDescriptor.graphicsFormat = !usesDeferredLighting ? + descriptor.format = !usesDeferredLighting ? DepthNormalOnlyPass.GetGraphicsFormat() : m_DeferredLights.GetGBufferFormat(m_DeferredLights.GBufferNormalSmoothnessIndex); - resourceData.cameraNormalsTexture = CreateRenderGraphTexture(renderGraph, normalDescriptor, normalsName, true); + resourceData.cameraNormalsTexture = CreateRenderGraphTexture(renderGraph, descriptor, normalsName, true, Color.black); } - void CreateRenderingLayersTexture(RenderGraph renderGraph, RenderTextureDescriptor descriptor) + void CreateRenderingLayersTexture(RenderGraph renderGraph, TextureDesc descriptor) { if (m_RequiresRenderingLayer) { @@ -1969,20 +1969,18 @@ void CreateRenderingLayersTexture(RenderGraph renderGraph, RenderTextureDescript if (usesDeferredLighting && m_DeferredLights.UseRenderingLayers) m_RenderingLayersTextureName = DeferredLights.k_GBufferNames[m_DeferredLights.GBufferRenderingLayers]; - RenderTextureDescriptor renderingLayersDescriptor = descriptor; - renderingLayersDescriptor.depthStencilFormat = GraphicsFormat.None; if (!m_RenderingLayerProvidesRenderObjectPass) - renderingLayersDescriptor.msaaSamples = 1;// Depth-Only pass don't use MSAA + descriptor.msaaSamples = MSAASamples.None;// Depth-Only pass don't use MSAA // Find compatible render-target format for storing normals. // Shader code outputs normals in signed format to be compatible with deferred gbuffer layout. // Deferred gbuffer format is signed so that normals can be blended for terrain geometry. if (usesDeferredLighting && m_RequiresRenderingLayer) - renderingLayersDescriptor.graphicsFormat = m_DeferredLights.GetGBufferFormat(m_DeferredLights.GBufferRenderingLayers); // the one used by the gbuffer. + descriptor.format = m_DeferredLights.GetGBufferFormat(m_DeferredLights.GBufferRenderingLayers); // the one used by the gbuffer. else - renderingLayersDescriptor.graphicsFormat = RenderingLayerUtils.GetFormat(m_RenderingLayersMaskSize); + descriptor.format = RenderingLayerUtils.GetFormat(m_RenderingLayersMaskSize); - resourceData.renderingLayersTexture = CreateRenderGraphTexture(renderGraph, renderingLayersDescriptor, m_RenderingLayersTextureName, true); + resourceData.renderingLayersTexture = CreateRenderGraphTexture(renderGraph, descriptor, m_RenderingLayersTextureName, true, descriptor.clearColor); } } @@ -1994,7 +1992,7 @@ void CreateAfterPostProcessTexture(RenderGraph renderGraph, RenderTextureDescrip resourceData.afterPostProcessColor = CreateRenderGraphTexture(renderGraph, desc, "_AfterPostProcessTexture", true); } - void DepthNormalPrepassRender(RenderGraph renderGraph, RenderPassInputSummary renderPassInputs, TextureHandle depthTarget, uint batchLayerMask, bool setGlobalDepth, bool setGlobalTextures) + void DepthNormalPrepassRender(RenderGraph renderGraph, RenderPassInputSummary renderPassInputs, in TextureHandle depthTarget, uint batchLayerMask, bool setGlobalDepth, bool setGlobalTextures, bool partialPass) { UniversalResourceData resourceData = frameData.Get(); @@ -2008,20 +2006,7 @@ void DepthNormalPrepassRender(RenderGraph renderGraph, RenderPassInputSummary re m_DepthNormalPrepass.enableRenderingLayers = false; } - if (usesDeferredLighting) - { - // Only render forward-only geometry, as standard geometry will be rendered as normal into the gbuffer. - if (AllowPartialDepthNormalsPrepass(usesDeferredLighting, renderPassInputs.requiresDepthNormalAtEvent, useDepthPriming)) - m_DepthNormalPrepass.shaderTagIds = k_DepthNormalsOnly; - - // TODO RENDERGRAPH: commented this out since would be equivalent to the current behaviour? Double check - //if (!m_RenderingLayerProvidesByDepthNormalPass) - // renderingLayersTexture = resourceData.gbuffer[m_DeferredLights.GBufferRenderingLayers]; // GBUffer texture here - } - - TextureHandle normalsTexture = resourceData.cameraNormalsTexture; - TextureHandle renderingLayersTexture = resourceData.renderingLayersTexture; - m_DepthNormalPrepass.Render(renderGraph, frameData, normalsTexture, depthTarget, renderingLayersTexture, batchLayerMask, setGlobalDepth, setGlobalTextures); + m_DepthNormalPrepass.Render(renderGraph, frameData, resourceData.cameraNormalsTexture, in depthTarget, resourceData.renderingLayersTexture, batchLayerMask, setGlobalDepth, setGlobalTextures, partialPass); if (m_RequiresRenderingLayer) SetRenderingLayersGlobalTextures(renderGraph); diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/CameraStacking/MixedFOV/MixedFOV.unity b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/CameraStacking/MixedFOV/MixedFOV.unity index 15f0a2c0b82..e403a02cb7f 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/CameraStacking/MixedFOV/MixedFOV.unity +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/CameraStacking/MixedFOV/MixedFOV.unity @@ -207,6 +207,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &15946185 MeshFilter: @@ -319,6 +320,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &67584135 MeshFilter: @@ -447,6 +449,7 @@ Canvas: m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_VertexColorAlwaysGammaSpace: 1 + m_UseReflectionProbes: 0 m_AdditionalShaderChannelsFlag: 1 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 @@ -561,6 +564,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &156759407 MeshFilter: @@ -700,6 +704,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &164721799 MeshFilter: @@ -831,6 +836,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &194942086 MeshFilter: @@ -928,6 +934,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &385566022 MeshFilter: @@ -987,6 +994,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 131481531} m_Modifications: + - target: {fileID: 1028709304226404832, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 6308746673132675046, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_Name value: CheckAssignedRenderPipelineAsset @@ -1147,7 +1158,7 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 705507993} m_Enabled: 1 - serializedVersion: 12 + serializedVersion: 13 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 1 @@ -1199,7 +1210,7 @@ Light: m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 m_ForceVisible: 0 - m_ShadowRadius: 0 + m_ShapeRadius: 0 m_ShadowAngle: 0 m_LightUnit: 1 m_LuxAtDistance: 1 @@ -1336,6 +1347,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &742501542 MeshFilter: @@ -1475,6 +1487,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &922637797 MeshFilter: @@ -1526,6 +1539,159 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 16 m_CollisionDetection: 0 +--- !u!1 &935640735 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + m_PrefabInstance: {fileID: 8282558930070009747} + m_PrefabAsset: {fileID: 0} +--- !u!114 &935640739 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 935640735} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b63a52c6229a7d48944998a4fcad092, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::NewFirstPersonControler + moveSpeed: 5 + gravity: -9.81 + lookSensitivity: 1 + baseCamera: {fileID: 8282558930070009751} +--- !u!114 &935640740 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 935640735} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.PlayerInput + m_Actions: {fileID: -944628639613478452, guid: f426eb113dac7124d897c338662b4024, type: 3} + m_NotificationBehavior: 0 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 11500000, guid: 1b63a52c6229a7d48944998a4fcad092, type: 3} + m_TargetAssemblyTypeName: UnityEditor.MonoScript, UnityEditor.CoreModule + m_MethodName: set_name + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Onlook + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 11500000, guid: 1b63a52c6229a7d48944998a4fcad092, type: 3} + m_TargetAssemblyTypeName: UnityEditor.MonoScript, UnityEditor.CoreModule + m_MethodName: set_name + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: OnMove + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 11500000, guid: 1b63a52c6229a7d48944998a4fcad092, type: 3} + m_TargetAssemblyTypeName: UnityEditor.MonoScript, UnityEditor.CoreModule + m_MethodName: set_name + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: OnFire + m_BoolArgument: 0 + m_CallState: 2 + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_ControlsChangedEvent: + m_PersistentCalls: + m_Calls: [] + m_ActionEvents: + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 68156268-5c1f-4acc-955e-d121992f8ad5 + m_ActionName: 'Player/Move[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow,/46D-C2AB/stick]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: e2f24dfb-116f-4941-8f88-cf0a20903c6a + m_ActionName: 'Player/Look[/Mouse/delta,/Touchscreen/delta,/Pen/delta]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 75aea007-8293-456a-9d47-5442fc0f5e68 + m_ActionName: 'Player/Fire[/Mouse/leftButton,/Touchscreen/primaryTouch/tap,/46D-C2AB/trigger]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 11b2185d-2fb4-4c89-aafd-748da443e2dc + m_ActionName: 'UI/Navigate[/46D-C2AB/stick/up,/46D-C2AB/stick/down,/46D-C2AB/stick/left,/46D-C2AB/stick/right,/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: d587f992-6a9d-4333-a252-7293b674fd36 + m_ActionName: 'UI/Submit[/Keyboard/enter]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 86ee9931-c691-4e12-a075-6a5bc7be2520 + m_ActionName: 'UI/Cancel[/Keyboard/escape]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: e49d4a8d-a0ca-4893-bc77-263954f4eb13 + m_ActionName: 'UI/Point[/Mouse/position,/Pen/position,/Touchscreen/touch0/position,/Touchscreen/touch1/position,/Touchscreen/touch2/position,/Touchscreen/touch3/position,/Touchscreen/touch4/position,/Touchscreen/touch5/position,/Touchscreen/touch6/position,/Touchscreen/touch7/position,/Touchscreen/touch8/position,/Touchscreen/touch9/position]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 05a94944-eece-456c-a514-3c74d0b37a64 + m_ActionName: 'UI/Click[/Mouse/leftButton,/Pen/tip,/Touchscreen/touch0/press,/Touchscreen/touch1/press,/Touchscreen/touch2/press,/Touchscreen/touch3/press,/Touchscreen/touch4/press,/Touchscreen/touch5/press,/Touchscreen/touch6/press,/Touchscreen/touch7/press,/Touchscreen/touch8/press,/Touchscreen/touch9/press]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 8334b98a-d9f5-4295-8292-7d83bbc450ea + m_ActionName: 'UI/ScrollWheel[/Mouse/scroll]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 0862ed31-cb59-4cb8-b655-58f1fcc629e2 + m_ActionName: 'UI/MiddleClick[/Mouse/middleButton]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 6f006a1f-a75d-47a8-a238-82d8b73cb7bc + m_ActionName: 'UI/RightClick[/Mouse/rightButton]' + - m_PersistentCalls: + m_Calls: [] + m_ActionId: 09be00e8-57eb-45df-a37e-77e4e01d7239 + m_ActionName: UI/TrackedDevicePosition + - m_PersistentCalls: + m_Calls: [] + m_ActionId: ac15ba30-53c8-49bc-a859-98024bf21458 + m_ActionName: UI/TrackedDeviceOrientation + m_NeverAutoSwitchControlSchemes: 0 + m_DefaultControlScheme: + m_DefaultActionMap: Player + m_SplitScreenIndex: -1 + m_Camera: {fileID: 8282558930070009751} +--- !u!114 &935640743 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 935640735} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e2ca254cf5a4eb443bba3eb4c9b3035b, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::CameraManagement + baseCamera: {fileID: 8282558930070009751} + overlayCamera: {fileID: 1434764562} --- !u!1 &1062089488 GameObject: m_ObjectHideFlags: 0 @@ -1614,6 +1780,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1062089491 MeshFilter: @@ -1745,6 +1912,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1188625086 MeshFilter: @@ -1842,6 +2010,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1402436728 MeshFilter: @@ -2148,6 +2317,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1490055368 MeshFilter: @@ -2157,85 +2327,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1490055364} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1574701474 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1574701477} - - component: {fileID: 1574701476} - - component: {fileID: 1574701478} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1574701476 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1574701474} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 10 ---- !u!4 &1574701477 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1574701474} - serializedVersion: 2 - 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_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1574701478 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1574701474} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} - m_Name: - m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.UI.InputSystemUIInputModule - m_SendPointerHoverToParent: 1 - m_MoveRepeatDelay: 0.5 - m_MoveRepeatRate: 0.1 - m_XRTrackingOrigin: {fileID: 0} - m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} - m_DeselectOnBackgroundClick: 1 - m_PointerBehavior: 0 - m_CursorLockBehavior: 0 - m_ScrollDeltaPerTick: 6 --- !u!1 &1592661739 GameObject: m_ObjectHideFlags: 0 @@ -2324,6 +2415,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1592661742 MeshFilter: @@ -2436,6 +2528,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1667562488 MeshFilter: @@ -2575,6 +2668,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1675440457 MeshFilter: @@ -2704,6 +2798,11 @@ PrefabInstance: value: This sample shows how Camera Stacking can be used in an FPS game to prevent the gun from clipping into walls. This setup also makes it possible to have different Field of Views for the "Level" camera and the "Gun" camera. + Use the fire button to switch between cameras. + objectReference: {fileID: 0} + - target: {fileID: 8490861713229784074, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} + propertyPath: m_SizeDelta.y + value: 75 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -2803,6 +2902,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1823617475 MeshFilter: @@ -2915,6 +3015,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1856286181 MeshFilter: @@ -3046,6 +3147,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1857608333 MeshFilter: @@ -3081,7 +3183,7 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1862309426} m_Enabled: 1 - serializedVersion: 12 + serializedVersion: 13 m_Type: 1 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 0.5 @@ -3133,7 +3235,7 @@ Light: m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 m_ForceVisible: 0 - m_ShadowRadius: 0 + m_ShapeRadius: 0 m_ShadowAngle: 0 m_LightUnit: 1 m_LuxAtDistance: 1 @@ -3270,6 +3372,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1913427153 MeshFilter: @@ -3382,6 +3485,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &2042961014 MeshFilter: @@ -3601,7 +3705,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_Name - value: Cameras + value: Player objectReference: {fileID: 0} - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_RootOrder @@ -3667,6 +3771,10 @@ PrefabInstance: propertyPath: m_Name value: Level Camera objectReference: {fileID: 0} + - target: {fileID: 8509898242313118626, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8509898242313118626, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_MoveWithMouse value: 1 @@ -3676,24 +3784,39 @@ PrefabInstance: value: 100 objectReference: {fileID: 0} m_RemovedComponents: + - {fileID: 0} - {fileID: 8900132868616544278, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + - {fileID: 8509898242313118626, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: - targetCorrespondingSourceObject: {fileID: 3363522893988168260, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} insertIndex: -1 addedObject: {fileID: 1434764559} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + insertIndex: -1 + addedObject: {fileID: 935640739} + - targetCorrespondingSourceObject: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + insertIndex: -1 + addedObject: {fileID: 935640740} + - targetCorrespondingSourceObject: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + insertIndex: -1 + addedObject: {fileID: 935640743} m_SourcePrefab: {fileID: 100100000, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} --- !u!4 &8282558930070009748 stripped Transform: m_CorrespondingSourceObject: {fileID: 3363522893988168260, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} m_PrefabInstance: {fileID: 8282558930070009747} m_PrefabAsset: {fileID: 0} +--- !u!20 &8282558930070009751 stripped +Camera: + m_CorrespondingSourceObject: {fileID: 1104701761066559480, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + m_PrefabInstance: {fileID: 8282558930070009747} + m_PrefabAsset: {fileID: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 131481531} - - {fileID: 1574701477} - {fileID: 567206876} - {fileID: 8282558930070009747} diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Lit.unity b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Lit.unity index 26c68993549..9847801549a 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Lit.unity +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Lit.unity @@ -38,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 1090784526} - m_IndirectSpecularColor: {r: 0.18098786, g: 0.22654998, b: 0.3072675, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 12 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -93,10 +93,8 @@ LightmapSettings: m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 112000000, guid: 7632e9382edaf42eea71fffda301b7e4, - type: 2} - m_LightingSettings: {fileID: 4890085278179872738, guid: cce5fc22d530544e9baddea9febf9776, - type: 2} + m_LightingDataAsset: {fileID: 112000000, guid: 7632e9382edaf42eea71fffda301b7e4, type: 2} + m_LightingSettings: {fileID: 4890085278179872738, guid: cce5fc22d530544e9baddea9febf9776, type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -129,164 +127,131 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 363678494143714049, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 363678494143714049, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 2325730147888387742, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 2325730147888387742, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapText objectReference: {fileID: 0} - - target: {fileID: 2984202550618798972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 2984202550618798972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba4db6da9324f499ab79a4b3c8e476d1, type: 2} - - target: {fileID: 3158804035374670811, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3158804035374670811, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedSphere objectReference: {fileID: 0} - - target: {fileID: 3519193640892908046, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3519193640892908046, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 673fd4308d68a4e6eb452d59b21ff3d4, type: 2} - - target: {fileID: 3632988833837816489, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3632988833837816489, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapSphere objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Text value: 'Normal Map With Height Map' objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_RootOrder value: 8 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.x value: 12.6 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: HeightMap objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863345698722662, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345698722662, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 673fd4308d68a4e6eb452d59b21ff3d4, type: 2} - - target: {fileID: 4515863345698722664, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345698722664, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedQuad objectReference: {fileID: 0} - - target: {fileID: 4515863345714478689, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345714478689, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba4db6da9324f499ab79a4b3c8e476d1, type: 2} - - target: {fileID: 4515863345714478691, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345714478691, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapQuad objectReference: {fileID: 0} - - target: {fileID: 5084966873698575717, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 5084966873698575717, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 6328839550329180593, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6328839550329180593, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedText objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Text value: 'Normal Map No Height Map' objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} @@ -303,359 +268,283 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 175851581590636847, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 175851581590636847, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 81a7b3fb99e984cb0a7a85e94d32a98e, type: 2} - - target: {fileID: 363678494143714049, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 363678494143714049, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 703742556405561692, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 703742556405561692, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 703742556405561692, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 703742556405561692, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Text value: Metallic Map objectReference: {fileID: 0} - - target: {fileID: 703742556405561692, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 703742556405561692, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 707564616722749779, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 707564616722749779, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalRotation.w value: -0.37843886 objectReference: {fileID: 0} - - target: {fileID: 707564616722749779, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 707564616722749779, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalRotation.y value: 0.92562634 objectReference: {fileID: 0} - - target: {fileID: 707564616722749779, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 707564616722749779, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 224.474 objectReference: {fileID: 0} - - target: {fileID: 792100534224308606, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 792100534224308606, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: c2809691a61fc4a43b6483eee535d786, type: 2} - - target: {fileID: 1579627784970439916, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 1579627784970439916, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: MetallicText objectReference: {fileID: 0} - - target: {fileID: 1700924697434049057, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 1700924697434049057, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: c2809691a61fc4a43b6483eee535d786, type: 2} - - target: {fileID: 1856864314734137278, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 1856864314734137278, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: EmisisonSphere objectReference: {fileID: 0} - - target: {fileID: 2325730147888387742, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 2325730147888387742, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: NormalText objectReference: {fileID: 0} - - target: {fileID: 2384831340507027100, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 2384831340507027100, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 2516708741707952774, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 2516708741707952774, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 3e2d3ad60e29e404da68fa903eaff772, type: 2} - - target: {fileID: 2984202550618798972, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 2984202550618798972, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 3e1368ee81423418da8a693099ce68c0, type: 2} - - target: {fileID: 3158804035374670811, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3158804035374670811, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: HeightSphere objectReference: {fileID: 0} - - target: {fileID: 3432419910411265175, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3432419910411265175, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 3519193640892908046, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3519193640892908046, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: db2f9e1b0d51c4244972d007409c5d1a, type: 2} - - target: {fileID: 3632988833837816489, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3632988833837816489, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: NormalSphere objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3639366238018879424, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 3639366238018879424, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 3639366238018879424, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Text value: Height Map objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3639366238018879424, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 3690115919084241155, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3690115919084241155, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: EmissionText objectReference: {fileID: 0} - - target: {fileID: 3903542586167764489, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 3903542586167764489, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 4466141343835727266, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4466141343835727266, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: OcclusionText objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_RootOrder value: 11 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalPosition.x value: 26.3 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757494, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757497, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: Texture Maps objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863344285757497, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863345698722662, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863345698722662, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: db2f9e1b0d51c4244972d007409c5d1a, type: 2} - - target: {fileID: 4515863345698722664, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863345698722664, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: HeightQuad objectReference: {fileID: 0} - - target: {fileID: 4515863345714478689, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863345714478689, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 3e1368ee81423418da8a693099ce68c0, type: 2} - - target: {fileID: 4515863345714478691, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4515863345714478691, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: NormalQuad objectReference: {fileID: 0} - - target: {fileID: 4519952585507003653, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4519952585507003653, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: BaseQuad objectReference: {fileID: 0} - - target: {fileID: 4868844637098708737, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 4868844637098708737, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: OcclusionSphere objectReference: {fileID: 0} - - target: {fileID: 5084966873698575717, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 5084966873698575717, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 5838474508579879326, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 5838474508579879326, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 81a7b3fb99e984cb0a7a85e94d32a98e, type: 2} - - target: {fileID: 5982961926340784712, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 5982961926340784712, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: EmisisonQuad objectReference: {fileID: 0} - - target: {fileID: 6328839550329180593, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 6328839550329180593, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: HeightText objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 6329929520080556972, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 6329929520080556972, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 6329929520080556972, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Text value: Normal Map objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 6329929520080556972, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 6381987796755295956, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 6381987796755295956, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 71d0ae4a494e24fc8842080c57cdeee7, type: 2} - - target: {fileID: 7176882605897474993, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7176882605897474993, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 7422092480594011468, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7422092480594011468, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: OcclusionQuad objectReference: {fileID: 0} - - target: {fileID: 7444712557463921412, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7444712557463921412, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: BaseText objectReference: {fileID: 0} - - target: {fileID: 7499780522273572509, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7499780522273572509, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 7499780522273572509, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 7499780522273572509, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Text value: Base Map objectReference: {fileID: 0} - - target: {fileID: 7499780522273572509, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7499780522273572509, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 7594455542058088936, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7594455542058088936, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: MetallicQuad objectReference: {fileID: 0} - - target: {fileID: 7992821393818068015, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7992821393818068015, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 7992821393818068015, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 7992821393818068015, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Text value: Emission Map objectReference: {fileID: 0} - - target: {fileID: 7992821393818068015, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 7992821393818068015, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 8078821430268539671, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 8078821430268539671, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: MetallicSphere objectReference: {fileID: 0} - - target: {fileID: 8220988234712831962, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 8220988234712831962, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 3e2d3ad60e29e404da68fa903eaff772, type: 2} - - target: {fileID: 8492668814307491323, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 8492668814307491323, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Name value: BaseSphere objectReference: {fileID: 0} - - target: {fileID: 9066520212796099257, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 9066520212796099257, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 71d0ae4a494e24fc8842080c57cdeee7, type: 2} - - target: {fileID: 9205124857158510153, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 9205124857158510153, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 9205124857158510153, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 9205124857158510153, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_Text value: Occlusion Map objectReference: {fileID: 0} - - target: {fileID: 9205124857158510153, guid: a62ae87b83afd45458e3e92c3f072830, - type: 3} + - target: {fileID: 9205124857158510153, guid: a62ae87b83afd45458e3e92c3f072830, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} @@ -672,164 +561,131 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 363678494143714049, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 363678494143714049, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 2325730147888387742, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 2325730147888387742, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapText objectReference: {fileID: 0} - - target: {fileID: 2984202550618798972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 2984202550618798972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 92b3aa099ecb9483381c91aba9894aad, type: 2} - - target: {fileID: 3158804035374670811, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3158804035374670811, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedSphere objectReference: {fileID: 0} - - target: {fileID: 3519193640892908046, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3519193640892908046, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba4db6da9324f499ab79a4b3c8e476d1, type: 2} - - target: {fileID: 3632988833837816489, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3632988833837816489, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapSphere objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Text value: 'With Normal Map' objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_RootOrder value: 7 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.x value: 9.4 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.x value: -0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.y value: -0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.z value: -0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NormalMap objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863345698722662, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345698722662, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba4db6da9324f499ab79a4b3c8e476d1, type: 2} - - target: {fileID: 4515863345698722664, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345698722664, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedQuad objectReference: {fileID: 0} - - target: {fileID: 4515863345714478689, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345714478689, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 92b3aa099ecb9483381c91aba9894aad, type: 2} - - target: {fileID: 4515863345714478691, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345714478691, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapQuad objectReference: {fileID: 0} - - target: {fileID: 5084966873698575717, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 5084966873698575717, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 6328839550329180593, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6328839550329180593, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedText objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Text value: 'Without Normal Map' objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} @@ -838,6 +694,57 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b350d0ee6adff493c954545853ab9922, type: 3} +--- !u!1 &671775837 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + m_PrefabInstance: {fileID: 1925206219} + m_PrefabAsset: {fileID: 0} +--- !u!114 &671775840 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671775837} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b63a52c6229a7d48944998a4fcad092, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::FirstPersonController + moveSpeed: 5 + gravity: -9.81 + lookSensitivity: 0.5 + baseCamera: {fileID: 1703775717} +--- !u!114 &671775841 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671775837} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.PlayerInput + m_Actions: {fileID: -944628639613478452, guid: f426eb113dac7124d897c338662b4024, type: 3} + m_NotificationBehavior: 0 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: [] + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_ControlsChangedEvent: + m_PersistentCalls: + m_Calls: [] + m_ActionEvents: [] + m_NeverAutoSwitchControlSchemes: 0 + m_DefaultControlScheme: + m_DefaultActionMap: + m_SplitScreenIndex: -1 + m_Camera: {fileID: 1703775717} --- !u!1001 &734120777 PrefabInstance: m_ObjectHideFlags: 0 @@ -846,198 +753,157 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 605078736972206957, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 605078736972206957, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 965276579647584521, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 965276579647584521, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: MappedSphere objectReference: {fileID: 0} - - target: {fileID: 1613878145432836316, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1613878145432836316, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba07f5ddfe8f94c61ac3c22a32d15fc4, type: 2} - - target: {fileID: 1810530080357623737, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1810530080357623737, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: BlueEmissionText objectReference: {fileID: 0} - - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Text value: No Emission objectReference: {fileID: 0} - - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_CharacterSize value: 0.04 objectReference: {fileID: 0} - - target: {fileID: 3023133885351793476, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3023133885351793476, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: MappedQuad objectReference: {fileID: 0} - - target: {fileID: 3273462983484937657, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3273462983484937657, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Text value: Emission Map objectReference: {fileID: 0} - - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_CharacterSize value: 0.04 objectReference: {fileID: 0} - - target: {fileID: 3685639466378869937, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3685639466378869937, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba07f5ddfe8f94c61ac3c22a32d15fc4, type: 2} - - target: {fileID: 5474351984923567369, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 5474351984923567369, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 7287552079565133267, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 7287552079565133267, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: BlueEmissionSphere objectReference: {fileID: 0} - - target: {fileID: 7976546426794385558, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 7976546426794385558, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: NoEmissionText objectReference: {fileID: 0} - - target: {fileID: 8097283291250739307, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283291250739307, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: NoEmissionQuad objectReference: {fileID: 0} - - target: {fileID: 8097283291266426208, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283291266426208, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: BlueEmissionQuad objectReference: {fileID: 0} - - target: {fileID: 8097283291266426222, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283291266426222, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 0c32055e4135a484b913cc24d7fd1be5, type: 2} - - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: Emission objectReference: {fileID: 0} - - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_RootOrder value: 10 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalPosition.x value: 19.6 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8290614998434304938, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8290614998434304938, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: MappedText objectReference: {fileID: 0} - - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Text value: 'Bright blue Emission' objectReference: {fileID: 0} - - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_CharacterSize value: 0.04 objectReference: {fileID: 0} - - target: {fileID: 8979682401931062433, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8979682401931062433, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: NoEmissionSphere objectReference: {fileID: 0} - - target: {fileID: 9088944033397224454, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 9088944033397224454, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 0c32055e4135a484b913cc24d7fd1be5, type: 2} @@ -1057,6 +923,11 @@ GameObject: - component: {fileID: 902575298} - component: {fileID: 902575297} - component: {fileID: 902575296} + - component: {fileID: 902575299} + - component: {fileID: 902575303} + - component: {fileID: 902575302} + - component: {fileID: 902575301} + - component: {fileID: 902575300} m_Layer: 0 m_Name: Floor m_TagString: Untagged @@ -1083,6 +954,9 @@ MeshRenderer: m_RayTraceProcedural: 0 m_RayTracingAccelStructBuildFlagsOverride: 0 m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1104,9 +978,11 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &902575297 MeshFilter: @@ -1131,6 +1007,112 @@ Transform: m_Children: [] m_Father: {fileID: 909040152} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &902575299 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 902575294} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &902575300 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 902575294} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.015852813, y: 0.09999999, z: 0.62597126} + m_Center: {x: -0.38, y: 0.049999993, z: -0.00012832641} +--- !u!65 &902575301 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 902575294} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.015852813, y: 0.09999999, z: 0.62597126} + m_Center: {x: 0.99026203, y: 0.049999993, z: -0.00012832641} +--- !u!65 &902575302 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 902575294} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1.3748568, y: 0.09999999, z: 0.01} + m_Center: {x: 0.3107637, y: 0.049999993, z: -0.31} +--- !u!65 &902575303 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 902575294} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1.3748568, y: 0.09999999, z: 0.01} + m_Center: {x: 0.3107637, y: 0.049999993, z: 0.31} --- !u!1 &909040151 GameObject: m_ObjectHideFlags: 0 @@ -1193,14 +1175,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1090784525} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 1 m_Color: {r: 1, g: 0.9909949, b: 0.9669811, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 2 m_Resolution: -1 @@ -1244,8 +1226,12 @@ Light: m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 + m_ForceVisible: 0 + m_ShapeRadius: 0 m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 --- !u!4 &1090784527 Transform: m_ObjectHideFlags: 0 @@ -1273,17 +1259,23 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} m_Name: m_EditorClassIdentifier: - m_Version: 3 m_UsePipelineSettings: 1 m_AdditionalLightsShadowResolutionTier: 2 - m_LightLayerMask: 1 - m_RenderingLayers: 1 m_CustomShadowLayers: 0 - m_ShadowLayerMask: 1 - m_ShadowRenderingLayers: 1 m_LightCookieSize: {x: 1, y: 1} m_LightCookieOffset: {x: 0, y: 0} m_SoftShadowQuality: 1 + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 --- !u!1 &1157374852 GameObject: m_ObjectHideFlags: 0 @@ -1341,164 +1333,131 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 363678494143714049, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 363678494143714049, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 2325730147888387742, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 2325730147888387742, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapText objectReference: {fileID: 0} - - target: {fileID: 2984202550618798972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 2984202550618798972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba4db6da9324f499ab79a4b3c8e476d1, type: 2} - - target: {fileID: 3158804035374670811, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3158804035374670811, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedSphere objectReference: {fileID: 0} - - target: {fileID: 3519193640892908046, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3519193640892908046, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 615945db2db8246c39b806c45ece2fa7, type: 2} - - target: {fileID: 3632988833837816489, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3632988833837816489, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapSphere objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Text value: 'Normap Map With Occlusion Map' objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 3639366238018879424, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_CharacterSize value: 0.025 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_RootOrder value: 9 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.x value: 15.8 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757494, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: Occlusion objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863344285757497, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863345698722662, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345698722662, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 615945db2db8246c39b806c45ece2fa7, type: 2} - - target: {fileID: 4515863345698722664, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345698722664, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedQuad objectReference: {fileID: 0} - - target: {fileID: 4515863345714478689, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345714478689, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ba4db6da9324f499ab79a4b3c8e476d1, type: 2} - - target: {fileID: 4515863345714478691, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 4515863345714478691, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: NoMapQuad objectReference: {fileID: 0} - - target: {fileID: 5084966873698575717, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 5084966873698575717, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 6328839550329180593, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6328839550329180593, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Name value: MappedText objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_Text value: 'Normal Map No Occlusion Map' objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, - type: 3} + - target: {fileID: 6329929520080556972, guid: b350d0ee6adff493c954545853ab9922, type: 3} propertyPath: m_CharacterSize value: 0.025 objectReference: {fileID: 0} @@ -1548,14 +1507,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1647640623} m_Enabled: 1 - serializedVersion: 11 + serializedVersion: 13 m_Type: 1 m_Color: {r: 1, g: 0.944407, b: 0.8443396, a: 1} m_Intensity: 0.2 m_Range: 10 m_SpotAngle: 30 m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 2 m_Resolution: -1 @@ -1599,8 +1558,12 @@ Light: m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 + m_ForceVisible: 0 + m_ShapeRadius: 0 m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 --- !u!114 &1647640626 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1613,85 +1576,28 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} m_Name: m_EditorClassIdentifier: - m_Version: 3 m_UsePipelineSettings: 1 m_AdditionalLightsShadowResolutionTier: 2 - m_LightLayerMask: 1 - m_RenderingLayers: 1 m_CustomShadowLayers: 0 - m_ShadowLayerMask: 1 - m_ShadowRenderingLayers: 1 m_LightCookieSize: {x: 1, y: 1} m_LightCookieOffset: {x: 0, y: 0} m_SoftShadowQuality: 1 ---- !u!1 &1720569094 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1720569097} - - component: {fileID: 1720569096} - - component: {fileID: 1720569095} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1720569095 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720569094} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_SendPointerHoverToParent: 1 - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &1720569096 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720569094} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 10 ---- !u!4 &1720569097 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 +--- !u!20 &1703775717 stripped +Camera: + m_CorrespondingSourceObject: {fileID: 1104701761066559480, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + m_PrefabInstance: {fileID: 1925206219} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1720569094} - serializedVersion: 2 - 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_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1925206219 PrefabInstance: m_ObjectHideFlags: 0 @@ -1700,93 +1606,75 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 1104701761066559480, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 1104701761066559480, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_ClearFlags value: 1 objectReference: {fileID: 0} - - target: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_Name value: FirstPersonPlayer objectReference: {fileID: 0} - - target: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalPosition.x value: -2.5 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalPosition.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalPosition.z value: -3 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalRotation.w value: 0.9273146 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalRotation.y value: 0.3742829 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 43.96 objectReference: {fileID: 0} - - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 4212382672143566193, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6350239021526260069, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 6350239021526260069, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_Antialiasing value: 2 objectReference: {fileID: 0} - - target: {fileID: 6350239021526260069, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 6350239021526260069, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_RendererIndex value: 0 objectReference: {fileID: 0} - - target: {fileID: 6350239021526260069, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 6350239021526260069, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_RenderPostProcessing value: 1 objectReference: {fileID: 0} - - target: {fileID: 8509898242313118626, guid: 8089b5fe6d8304423814ff197221f77d, - type: 3} + - target: {fileID: 8509898242313118626, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} propertyPath: m_MovementSpeed value: 4 objectReference: {fileID: 0} @@ -1794,7 +1682,13 @@ PrefabInstance: - {fileID: 8900132868616544278, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + insertIndex: -1 + addedObject: {fileID: 671775841} + - targetCorrespondingSourceObject: {fileID: 2148271877166492642, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} + insertIndex: -1 + addedObject: {fileID: 671775840} m_SourcePrefab: {fileID: 100100000, guid: 8089b5fe6d8304423814ff197221f77d, type: 3} --- !u!1001 &1932534512 PrefabInstance: @@ -1804,108 +1698,87 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 222607664510397816} m_Modifications: - - target: {fileID: 6308746673132675046, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6308746673132675046, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_Name value: CheckAssignedRenderPipelineAsset objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_Pivot.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_AnchorMax.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_AnchorMax.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_AnchorMin.x value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_AnchorMin.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_SizeDelta.x value: 100 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_SizeDelta.y value: 100 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + - target: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} @@ -1916,8 +1789,7 @@ PrefabInstance: m_SourcePrefab: {fileID: 100100000, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} --- !u!224 &1932534513 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, - type: 3} + m_CorrespondingSourceObject: {fileID: 6858826011774340517, guid: 49a291c27c0b243438a861a905fcc73e, type: 3} m_PrefabInstance: {fileID: 1932534512} m_PrefabAsset: {fileID: 0} --- !u!1001 &1951643861 @@ -1928,266 +1800,211 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 175851581590636847, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 175851581590636847, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 7e1dd3465110745d9820dc9c8a97152e, type: 2} - - target: {fileID: 363678494143714049, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 363678494143714049, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 2325730147888387742, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 2325730147888387742, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: MetallicText objectReference: {fileID: 0} - - target: {fileID: 2384831340507027100, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 2384831340507027100, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 2984202550618798972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 2984202550618798972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 3e58fe99dbdc941fbb127782a5413890, type: 2} - - target: {fileID: 3158804035374670811, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 3158804035374670811, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: SmoothSphere objectReference: {fileID: 0} - - target: {fileID: 3158804035374670811, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 3158804035374670811, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_StaticEditorFlags value: 64 objectReference: {fileID: 0} - - target: {fileID: 3519193640892908046, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 3519193640892908046, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: cd8dde816b1e341aa9dd9afca2da9937, type: 2} - - target: {fileID: 3632988833837816489, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 3632988833837816489, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: MetallicSphere objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 3639366238018879424, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 3639366238018879424, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 3639366238018879424, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Text value: 'Smoothness One' objectReference: {fileID: 0} - - target: {fileID: 3639366238018879424, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 3639366238018879424, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 4466141343835727266, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4466141343835727266, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: MappedText objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_RootOrder value: 6 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalPosition.x value: 5 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757494, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757497, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: Metallic/Smoothness objectReference: {fileID: 0} - - target: {fileID: 4515863344285757497, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863344285757497, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 4515863345698722662, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863345698722662, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: cd8dde816b1e341aa9dd9afca2da9937, type: 2} - - target: {fileID: 4515863345698722664, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863345698722664, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: SmoothQuad objectReference: {fileID: 0} - - target: {fileID: 4515863345714478689, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863345714478689, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 3e58fe99dbdc941fbb127782a5413890, type: 2} - - target: {fileID: 4515863345714478691, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4515863345714478691, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: MetallicQuad objectReference: {fileID: 0} - - target: {fileID: 4519952585507003653, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4519952585507003653, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: ZeroQuad objectReference: {fileID: 0} - - target: {fileID: 4868844637098708737, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 4868844637098708737, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: MappedSphere objectReference: {fileID: 0} - - target: {fileID: 5084966873698575717, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 5084966873698575717, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 5838474508579879326, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 5838474508579879326, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 7e1dd3465110745d9820dc9c8a97152e, type: 2} - - target: {fileID: 6328839550329180593, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 6328839550329180593, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: SmoothText objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 6329929520080556972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 6329929520080556972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 6329929520080556972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Text value: "Metallic \nOne" objectReference: {fileID: 0} - - target: {fileID: 6329929520080556972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 6329929520080556972, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 6381987796755295956, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 6381987796755295956, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: bfe840013b1e840cdbc00d83632179e8, type: 2} - - target: {fileID: 7176882605897474993, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 7176882605897474993, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 7422092480594011468, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 7422092480594011468, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: MappedQuad objectReference: {fileID: 0} - - target: {fileID: 7444712557463921412, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 7444712557463921412, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: ZeroText objectReference: {fileID: 0} - - target: {fileID: 7499780522273572509, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 7499780522273572509, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 7499780522273572509, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 7499780522273572509, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Text value: 'Metallic/Smoothness Zero' objectReference: {fileID: 0} - - target: {fileID: 7499780522273572509, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 7499780522273572509, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} - - target: {fileID: 8492668814307491323, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 8492668814307491323, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Name value: ZeroSphere objectReference: {fileID: 0} - - target: {fileID: 8492668814307491323, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 8492668814307491323, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_StaticEditorFlags value: 64 objectReference: {fileID: 0} - - target: {fileID: 9066520212796099257, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 9066520212796099257, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: bfe840013b1e840cdbc00d83632179e8, type: 2} - - target: {fileID: 9205124857158510153, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 9205124857158510153, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 9205124857158510153, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 9205124857158510153, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_Text value: Metallic Map objectReference: {fileID: 0} - - target: {fileID: 9205124857158510153, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, - type: 3} + - target: {fileID: 9205124857158510153, guid: f6c633bbe2d20466fb1f016e0dd1f6cd, type: 3} propertyPath: m_CharacterSize value: 0.03 objectReference: {fileID: 0} @@ -2269,123 +2086,99 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 222607664510397816} m_Modifications: - - target: {fileID: 155458132493177538, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 155458132493177538, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_Name value: MainPanel objectReference: {fileID: 0} - - target: {fileID: 1638750836712682043, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 1638750836712682043, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_Text value: Lit Shader objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_Pivot.x value: 1 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_Pivot.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_RootOrder value: 2 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_AnchorMax.x value: 1 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_AnchorMax.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_AnchorMin.x value: 1 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_SizeDelta.x value: 400 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_SizeDelta.y value: 250 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_AnchoredPosition.y value: -250 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4039968741557396746, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + - target: {fileID: 4039968741557396746, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} propertyPath: m_Text value: This sample shows how different properties of the Lit shader affect the surface. Use the materials and textures as guidelines on how to set up @@ -2398,8 +2191,7 @@ PrefabInstance: m_SourcePrefab: {fileID: 100100000, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} --- !u!224 &2050154443 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, - type: 3} + m_CorrespondingSourceObject: {fileID: 2877385409968955045, guid: d5fa55a16b49d4da3a93a4958cdc3180, type: 3} m_PrefabInstance: {fileID: 2050154442} m_PrefabAsset: {fileID: 0} --- !u!1 &221137969116224548 @@ -2450,200 +2242,159 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 605078736972206957, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 605078736972206957, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 965276579647584521, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 965276579647584521, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: MappedSphere objectReference: {fileID: 0} - - target: {fileID: 1613878145432836316, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1613878145432836316, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 81a7b3fb99e984cb0a7a85e94d32a98e, type: 2} - - target: {fileID: 1810530080357623737, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1810530080357623737, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: RedText objectReference: {fileID: 0} - - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Text value: 'White base color' objectReference: {fileID: 0} - - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 1814010385164494244, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_CharacterSize value: 0.04 objectReference: {fileID: 0} - - target: {fileID: 3023133885351793476, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3023133885351793476, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: MappedQuad objectReference: {fileID: 0} - - target: {fileID: 3273462983484937657, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3273462983484937657, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Text value: Base Map objectReference: {fileID: 0} - - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3552189744290811969, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_CharacterSize value: 0.04 objectReference: {fileID: 0} - - target: {fileID: 3685639466378869937, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 3685639466378869937, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 81a7b3fb99e984cb0a7a85e94d32a98e, type: 2} - - target: {fileID: 5474351984923567369, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 5474351984923567369, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 6a16993b78f2b4f85b82be4c42e0ebc4, type: 2} - - target: {fileID: 7287552079565133267, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 7287552079565133267, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: RedSphere objectReference: {fileID: 0} - - target: {fileID: 7976546426794385558, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 7976546426794385558, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: WhiteText objectReference: {fileID: 0} - - target: {fileID: 8097283291250739307, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283291250739307, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: WhiteQuad objectReference: {fileID: 0} - - target: {fileID: 8097283291266426208, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283291266426208, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: RedQuad objectReference: {fileID: 0} - - target: {fileID: 8097283291266426222, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283291266426222, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ab1e501408f784696a373918622592b2, type: 2} - - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: BaseMap objectReference: {fileID: 0} - - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703921, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_RootOrder value: 5 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8097283293074703934, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8290614998434304938, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8290614998434304938, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: MappedText objectReference: {fileID: 0} - - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Font value: - objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, - type: 3} - - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + objectReference: {fileID: 12800000, guid: 41c277dc43e1949a49ddfa34597b8af2, type: 3} + - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Text value: 'Red base color' objectReference: {fileID: 0} - - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8968186135458761160, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_CharacterSize value: 0.04 objectReference: {fileID: 0} - - target: {fileID: 8979682401931062433, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 8979682401931062433, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: m_Name value: WhiteSphere objectReference: {fileID: 0} - - target: {fileID: 9088944033397224454, guid: 7689a0ffc4ed74a58b7298d31e1d3283, - type: 3} + - target: {fileID: 9088944033397224454, guid: 7689a0ffc4ed74a58b7298d31e1d3283, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: ab1e501408f784696a373918622592b2, type: 2} @@ -2670,6 +2421,7 @@ Canvas: m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_VertexColorAlwaysGammaSpace: 0 + m_UseReflectionProbes: 0 m_AdditionalShaderChannelsFlag: 0 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 @@ -2720,7 +2472,6 @@ SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 1925206219} - - {fileID: 1720569097} - {fileID: 222607664510397816} - {fileID: 909040152} - {fileID: 586851967382586498} diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseMap.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseMap.mat index 05b35390d53..6f7e86d465f 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseMap.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseMap.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -132,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseRed.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseRed.mat index 22a9ac64882..4c2ec0c7d75 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseRed.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseRed.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -132,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseWhite.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseWhite.mat index e6ee0a19d70..896b3ee61e1 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseWhite.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BaseWhite.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -132,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BlueEmission.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BlueEmission.mat index eebd8fea56a..393857a936a 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BlueEmission.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/BlueEmission.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -97,6 +97,7 @@ Material: m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AddPrecomputedVelocity: 0 - _AlphaClip: 0 - _AlphaToMask: 0 - _Blend: 0 @@ -126,6 +127,7 @@ Material: - _SrcBlendAlpha: 1 - _Surface: 0 - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 1} @@ -133,3 +135,4 @@ Material: - _EmissionColor: {r: 0.5019608, g: 5.082353, b: 8, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionMap.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionMap.mat index de1ea8227c2..5de28b474f7 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionMap.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionMap.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -97,6 +97,7 @@ Material: m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AddPrecomputedVelocity: 0 - _AlphaClip: 0 - _AlphaToMask: 0 - _Blend: 0 @@ -126,6 +127,7 @@ Material: - _SrcBlendAlpha: 1 - _Surface: 0 - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 1} @@ -133,3 +135,4 @@ Material: - _EmissionColor: {r: 10.680627, g: 10.680627, b: 10.680627, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionOn.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionOn.mat index f2fd1f21fda..5baca4d41df 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionOn.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/EmissionOn.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -101,6 +101,7 @@ Material: m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AddPrecomputedVelocity: 0 - _AlphaClip: 0 - _AlphaToMask: 0 - _Blend: 0 @@ -130,6 +131,7 @@ Material: - _SrcBlendAlpha: 1 - _Surface: 0 - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 1} @@ -137,3 +139,4 @@ Material: - _EmissionColor: {r: 8, g: 8, b: 8, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/HeightMapOn.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/HeightMapOn.mat index 29bcf3d6718..d02ecddd4e0 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/HeightMapOn.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/HeightMapOn.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -135,3 +135,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicMap.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicMap.mat index 64d15e2fc8e..4c3fc80b932 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicMap.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicMap.mat @@ -120,6 +120,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &2189989134249906478 MonoBehaviour: m_ObjectHideFlags: 11 @@ -132,4 +133,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOn.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOn.mat index bb058291eec..97c4ece3ec2 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOn.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOn.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -133,3 +133,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOne.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOne.mat index a6bc7db07e1..067838b0f60 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOne.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicOne.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -132,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicSmoothnessZero.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicSmoothnessZero.mat index 5db2b77d455..c65aca1315c 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicSmoothnessZero.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/MetallicSmoothnessZero.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -132,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/NormalMapOn.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/NormalMapOn.mat index e27aa973af5..d55db2c08cb 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/NormalMapOn.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/NormalMapOn.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -134,3 +134,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/OcclusionOn.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/OcclusionOn.mat index 4a552d1062c..58f5bff09dc 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/OcclusionOn.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/OcclusionOn.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -136,3 +136,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/SmoothnessOne.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/SmoothnessOne.mat index ee9baa1dd87..eacb16fe918 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/SmoothnessOne.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/SmoothnessOne.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -132,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithHeightMap.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithHeightMap.mat index 77cf031b6d0..f9c59af6f33 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithHeightMap.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithHeightMap.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -134,3 +134,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithNormalMap.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithNormalMap.mat index ac5198add79..39875b5243d 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithNormalMap.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithNormalMap.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -133,3 +133,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithOcclusion.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithOcclusion.mat index 80d46f90d94..c768e08a1ef 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithOcclusion.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithOcclusion.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -134,3 +134,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithoutNormalMap.mat b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithoutNormalMap.mat index 590daf28432..d82ab85d3f8 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithoutNormalMap.mat +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/Shaders/Lit/Materials/WithoutNormalMap.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 9 + version: 10 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -132,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/PlayerControls.inputactions b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/PlayerControls.inputactions new file mode 100644 index 00000000000..ce0b23b0dcb --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/PlayerControls.inputactions @@ -0,0 +1,839 @@ +{ + "version": 1, + "name": "PlayerControls", + "maps": [ + { + "name": "Player", + "id": "2cf6ceb3-86d0-4b8b-9eff-79d527e59fb0", + "actions": [ + { + "name": "Move", + "type": "Value", + "id": "68156268-5c1f-4acc-955e-d121992f8ad5", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Look", + "type": "Value", + "id": "e2f24dfb-116f-4941-8f88-cf0a20903c6a", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Fire", + "type": "Button", + "id": "75aea007-8293-456a-9d47-5442fc0f5e68", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "", + "id": "978bfe49-cc26-4a3d-ab7b-7d7a29327403", + "path": "/leftStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "WASD", + "id": "00ca640b-d935-4593-8157-c05846ea39b3", + "path": "Dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "e2062cb9-1b15-46a2-838c-2f8d72a0bdd9", + "path": "/w", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "8180e8bd-4097-4f4e-ab88-4523101a6ce9", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "320bffee-a40b-4347-ac70-c210eb8bc73a", + "path": "/s", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "1c5327b5-f71c-4f60-99c7-4e737386f1d1", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "d2581a9b-1d11-4566-b27d-b92aff5fabbc", + "path": "/a", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "2e46982e-44cc-431b-9f0b-c11910bf467a", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcfe95b8-67b9-4526-84b5-5d0bc98d6400", + "path": "/d", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "77bff152-3580-4b21-b6de-dcd0c7e41164", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "1635d3fe-58b6-4ba9-a4e2-f4b964f6b5c8", + "path": "/{Primary2DAxis}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3ea4d645-4504-4529-b061-ab81934c3752", + "path": "/stick", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c1f7a91b-d0fd-4a62-997e-7fb9b69bf235", + "path": "/rightStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8c8e490b-c610-4785-884f-f04217b23ca4", + "path": "/delta", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse;Touch", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3e5f5442-8668-4b27-a940-df99bad7e831", + "path": "/{Hatswitch}", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "143bb1cd-cc10-4eca-a2f0-a3664166fe91", + "path": "/rightTrigger", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Fire", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "05f6913d-c316-48b2-a6bb-e225f14c7960", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Fire", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "886e731e-7071-4ae4-95c0-e61739dad6fd", + "path": "/primaryTouch/tap", + "interactions": "", + "processors": "", + "groups": ";Touch", + "action": "Fire", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ee3d0cd2-254e-47a7-a8cb-bc94d9658c54", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Fire", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8255d333-5683-4943-a58a-ccb207ff1dce", + "path": "/{PrimaryAction}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Fire", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "UI", + "id": "53dbdbef-4101-4aa8-b9ee-fffbbf22db70", + "actions": [ + { + "name": "Navigate", + "type": "PassThrough", + "id": "11b2185d-2fb4-4c89-aafd-748da443e2dc", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Submit", + "type": "Button", + "id": "d587f992-6a9d-4333-a252-7293b674fd36", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Cancel", + "type": "Button", + "id": "86ee9931-c691-4e12-a075-6a5bc7be2520", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Point", + "type": "PassThrough", + "id": "e49d4a8d-a0ca-4893-bc77-263954f4eb13", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Click", + "type": "PassThrough", + "id": "05a94944-eece-456c-a514-3c74d0b37a64", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "ScrollWheel", + "type": "PassThrough", + "id": "8334b98a-d9f5-4295-8292-7d83bbc450ea", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "MiddleClick", + "type": "PassThrough", + "id": "0862ed31-cb59-4cb8-b655-58f1fcc629e2", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "RightClick", + "type": "PassThrough", + "id": "6f006a1f-a75d-47a8-a238-82d8b73cb7bc", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDevicePosition", + "type": "PassThrough", + "id": "09be00e8-57eb-45df-a37e-77e4e01d7239", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDeviceOrientation", + "type": "PassThrough", + "id": "ac15ba30-53c8-49bc-a859-98024bf21458", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "Gamepad", + "id": "809f371f-c5e2-4e7a-83a1-d867598f40dd", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "14a5d6e8-4aaf-4119-a9ef-34b8c2c548bf", + "path": "/leftStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "9144cbe6-05e1-4687-a6d7-24f99d23dd81", + "path": "/rightStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2db08d65-c5fb-421b-983f-c71163608d67", + "path": "/leftStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "58748904-2ea9-4a80-8579-b500e6a76df8", + "path": "/rightStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "8ba04515-75aa-45de-966d-393d9bbd1c14", + "path": "/leftStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "712e721c-bdfb-4b23-a86c-a0d9fcfea921", + "path": "/rightStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcd248ae-a788-4676-a12e-f4d81205600b", + "path": "/leftStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "1f04d9bc-c50b-41a1-bfcc-afb75475ec20", + "path": "/rightStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "fb8277d4-c5cd-4663-9dc7-ee3f0b506d90", + "path": "/dpad", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Joystick", + "id": "e25d9774-381c-4a61-b47c-7b6b299ad9f9", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "3db53b26-6601-41be-9887-63ac74e79d19", + "path": "/stick/up", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "0cb3e13e-3d90-4178-8ae6-d9c5501d653f", + "path": "/stick/down", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "0392d399-f6dd-4c82-8062-c1e9c0d34835", + "path": "/stick/left", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "942a66d9-d42f-43d6-8d70-ecb4ba5363bc", + "path": "/stick/right", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "Keyboard", + "id": "ff527021-f211-4c02-933e-5976594c46ed", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "563fbfdd-0f09-408d-aa75-8642c4f08ef0", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "eb480147-c587-4a33-85ed-eb0ab9942c43", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2bf42165-60bc-42ca-8072-8c13ab40239b", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "85d264ad-e0a0-4565-b7ff-1a37edde51ac", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "74214943-c580-44e4-98eb-ad7eebe17902", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "cea9b045-a000-445b-95b8-0c171af70a3b", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "8607c725-d935-4808-84b1-8354e29bab63", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "4cda81dc-9edd-4e03-9d7c-a71a14345d0b", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "9e92bb26-7e3b-4ec4-b06b-3c8f8e498ddc", + "path": "*/{Submit}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Submit", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "82627dcc-3b13-4ba9-841d-e4b746d6553e", + "path": "*/{Cancel}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Cancel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c52c8e0b-8179-41d3-b8a1-d149033bbe86", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e1394cbc-336e-44ce-9ea8-6007ed6193f7", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "5693e57a-238a-46ed-b5ae-e64e6e574302", + "path": "/touch*/position", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4faf7dc9-b979-4210-aa8c-e808e1ef89f5", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8d66d5ba-88d7-48e6-b1cd-198bbfef7ace", + "path": "/tip", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "47c2a644-3ebc-4dae-a106-589b7ca75b59", + "path": "/touch*/press", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "bb9e6b34-44bf-4381-ac63-5aa15d19f677", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "38c99815-14ea-4617-8627-164d27641299", + "path": "/scroll", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "ScrollWheel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "24066f69-da47-44f3-a07e-0015fb02eb2e", + "path": "/middleButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "MiddleClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4c191405-5738-4d4b-a523-c6a301dbf754", + "path": "/rightButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "RightClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77", + "path": "/devicePosition", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDevicePosition", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "23e01e3a-f935-4948-8d8b-9bcac77714fb", + "path": "/deviceRotation", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDeviceOrientation", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [ + { + "name": "Keyboard&Mouse", + "bindingGroup": "Keyboard&Mouse", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + }, + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Gamepad", + "bindingGroup": "Gamepad", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Touch", + "bindingGroup": "Touch", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Joystick", + "bindingGroup": "Joystick", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "XR", + "bindingGroup": "XR", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + } + ] +} \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/PlayerControls.inputactions.meta b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/PlayerControls.inputactions.meta new file mode 100644 index 00000000000..fd5f5da027f --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/PlayerControls.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: f426eb113dac7124d897c338662b4024 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 0 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Prefabs/FirstPersonPlayer.prefab b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Prefabs/FirstPersonPlayer.prefab index 7410520bcd9..21aa96c56ec 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Prefabs/FirstPersonPlayer.prefab +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Prefabs/FirstPersonPlayer.prefab @@ -11,6 +11,7 @@ GameObject: - component: {fileID: 4212382672143566193} - component: {fileID: 4891938747972648122} - component: {fileID: 8509898242313118626} + - component: {fileID: 8535537789861062929} m_Layer: 0 m_Name: FirstPersonPlayer m_TagString: Untagged @@ -25,6 +26,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2148271877166492642} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0.812, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -32,7 +34,6 @@ Transform: m_Children: - {fileID: 3363522893988168260} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!143 &4891938747972648122 CharacterController: @@ -42,9 +43,16 @@ CharacterController: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2148271877166492642} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ProvidesContacts: 0 m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_Height: 1.5 m_Radius: 0.4 m_SlopeLimit: 45 @@ -61,15 +69,43 @@ MonoBehaviour: m_GameObject: {fileID: 2148271877166492642} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 94f9f55b5897449c29f5189f47cad4bc, type: 3} + m_Script: {fileID: 11500000, guid: 1b63a52c6229a7d48944998a4fcad092, type: 3} m_Name: m_EditorClassIdentifier: - m_MouseSensitivity: 100 - m_ButtonSensitivity: 100 - m_MovementSpeed: 3 - m_PlayerCamera: {fileID: 3363522893988168260} - m_MoveWithMouse: 1 - m_ButtonMovementFlags: 0 + moveSpeed: 5 + gravity: -9.81 + lookSensitivity: 0.5 + baseCamera: {fileID: 1104701761066559480} +--- !u!114 &8535537789861062929 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2148271877166492642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.PlayerInput + m_Actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} + m_NotificationBehavior: 0 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: [] + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_ControlsChangedEvent: + m_PersistentCalls: + m_Calls: [] + m_ActionEvents: [] + m_NeverAutoSwitchControlSchemes: 0 + m_DefaultControlScheme: + m_DefaultActionMap: + m_SplitScreenIndex: -1 + m_Camera: {fileID: 1104701761066559480} --- !u!1 &8157311212398424292 GameObject: m_ObjectHideFlags: 0 @@ -82,7 +118,6 @@ GameObject: - component: {fileID: 1104701761066559480} - component: {fileID: 5828494068272712963} - component: {fileID: 6350239021526260069} - - component: {fileID: 8900132868616544278} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -97,13 +132,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8157311212398424292} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0.6, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4212382672143566193} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!20 &1104701761066559480 Camera: @@ -119,9 +154,17 @@ Camera: m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -186,19 +229,17 @@ MonoBehaviour: m_Dithering: 0 m_ClearDepth: 1 m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} m_RequiresDepthTexture: 0 m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 m_Version: 2 ---- !u!114 &8900132868616544278 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8157311212398424292} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 21aa50131bc134f04a14efdbeb7686be, type: 3} - m_Name: - m_EditorClassIdentifier: - m_PipelineAsset: {fileID: 11400000, guid: 9b9c0b62deeea4218843a7ad59325649, type: 2} diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/CameraManagement.cs b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/CameraManagement.cs new file mode 100644 index 00000000000..8a978bac483 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/CameraManagement.cs @@ -0,0 +1,87 @@ +using UnityEngine; +using UnityEngine.InputSystem; +using UnityEngine.Rendering.Universal; + +[RequireComponent(typeof(PlayerInput))] +public class CameraManagement : MonoBehaviour +{ + + [Header("Cameras")] + public Camera baseCamera; + public Camera overlayCamera; + + private PlayerInput playerInput; + private InputAction fireAction; + + private float baseFOV; + private float overlayFOV; + private bool isOverlayActive = false; + + private void Awake() + { + playerInput = GetComponent(); + + // Check if the cameras are corectly assigned + if (baseCamera == null || overlayCamera == null) + { + Debug.LogError("BaseCamera and OverlayCamera have to be assigned in the PlayerInput!"); + enabled = false; + return; + } + + // Get FOV + baseFOV = baseCamera.fieldOfView; + overlayFOV = overlayCamera.fieldOfView; + + // Prepare URP stack + var baseData = baseCamera.GetUniversalAdditionalCameraData(); + var overlayData = overlayCamera.GetUniversalAdditionalCameraData(); + overlayData.renderType = CameraRenderType.Overlay; + + if (!baseData.cameraStack.Contains(overlayCamera)) + baseData.cameraStack.Add(overlayCamera); + + // Overlay off at start + overlayCamera.gameObject.SetActive(false); + } + + private void OnEnable() + { + fireAction = playerInput.actions["Fire"]; + fireAction.performed += OnFirePerformed; + fireAction.canceled += OnFireCanceled; + } + + private void OnDisable() + { + if (fireAction != null) + { + fireAction.performed -= OnFirePerformed; + fireAction.canceled -= OnFireCanceled; + } + } + + private void OnFirePerformed(InputAction.CallbackContext ctx) + { + isOverlayActive = true; + overlayCamera.gameObject.SetActive(true); + baseCamera.fieldOfView = overlayFOV; + } + + private void OnFireCanceled(InputAction.CallbackContext ctx) + { + isOverlayActive = false; + overlayCamera.gameObject.SetActive(false); + baseCamera.fieldOfView = baseFOV; + } + + private void LateUpdate() + { + // Synchronise base and overlay camera rotation to avoid a jerky effect + if (isOverlayActive && overlayCamera != null && baseCamera != null) + { + overlayCamera.transform.rotation = baseCamera.transform.rotation; + } + } +} + diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/CameraManagement.cs.meta b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/CameraManagement.cs.meta new file mode 100644 index 00000000000..d1f069ceab1 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/CameraManagement.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e2ca254cf5a4eb443bba3eb4c9b3035b \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs index 6bcc30a6e56..9c5923eb9e0 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs @@ -1,84 +1,96 @@ using UnityEngine; -using Cursor = UnityEngine.Cursor; +using UnityEngine.InputSystem; [RequireComponent(typeof(CharacterController))] +[RequireComponent(typeof(PlayerInput))] public class FirstPersonController : MonoBehaviour { - [SerializeField] - private float m_MouseSensitivity = 100f; - [SerializeField] - private float m_MovementSpeed = 5f; - [SerializeField] - private Transform m_PlayerCamera = null; - [SerializeField] - private bool m_MoveWithMouse = true; - - private CharacterController m_CharacterController; - private float m_XRotation = 0f; - [SerializeField] - private byte m_ButtonMovementFlags; - - void Start() - { -#if ENABLE_INPUT_SYSTEM - Debug.Log("The FirstPersonController uses the legacy input system. Please set it in Project Settings"); - m_MoveWithMouse = false; -#endif - if (m_MoveWithMouse) - { - Cursor.lockState = CursorLockMode.Locked; - } - m_CharacterController = GetComponent(); - } + [Header("Movement Settings")] + public float moveSpeed = 5f; + public float gravity = -9.81f; - void Update() - { - Look(); - Move(); - } + [Header("Look Settings")] + public float lookSensitivity = 0.5f; - private void Look() - { - Vector2 lookInput = GetLookInput(); + [Header("Camera Reference")] + public Camera baseCamera; + + private CharacterController controller; + private PlayerInput playerInput; + private InputAction moveAction; + private InputAction lookAction; + + private Vector2 moveInput; + private Vector2 lookInput; + private float verticalVelocity; + private float cameraPitch; - m_XRotation -= lookInput.y; - m_XRotation = Mathf.Clamp(m_XRotation, -90f, 90f); + private void Awake() + { + controller = GetComponent(); + playerInput = GetComponent(); - m_PlayerCamera.localRotation = Quaternion.Euler(m_XRotation, 0, 0); - transform.Rotate(Vector3.up * lookInput.x, Space.World); + // Hide cursor + Cursor.lockState = CursorLockMode.Locked; + Cursor.visible = false; } - private void Move() + private void OnEnable() { - Vector3 movementInput = GetMovementInput(); + var actions = playerInput.actions; - Vector3 move = transform.right * movementInput.x + transform.forward * movementInput.z; + moveAction = actions["Move"]; + lookAction = actions["Look"]; + + moveAction.performed += ctx => moveInput = ctx.ReadValue(); + moveAction.canceled += ctx => moveInput = Vector2.zero; - m_CharacterController.Move(move * m_MovementSpeed * Time.deltaTime); + lookAction.performed += ctx => lookInput = ctx.ReadValue(); + lookAction.canceled += ctx => lookInput = Vector2.zero; + + actions.Enable(); } - private Vector2 GetLookInput() + private void OnDisable() { - float mouseX = 0; - float mouseY = 0; - if (m_MoveWithMouse) + if (moveAction != null) + { + moveAction.performed -= ctx => moveInput = ctx.ReadValue(); + moveAction.canceled -= ctx => moveInput = Vector2.zero; + } + if (lookAction != null) { - mouseX = Input.GetAxis("Mouse X") * m_MouseSensitivity * Time.deltaTime; - mouseY = Input.GetAxis("Mouse Y") * m_MouseSensitivity * Time.deltaTime; + lookAction.performed -= ctx => lookInput = ctx.ReadValue(); + lookAction.canceled -= ctx => lookInput = Vector2.zero; } - return new Vector2(mouseX, mouseY); } - private Vector3 GetMovementInput() + private void Update() { - float x = 0; - float z = 0; - if (m_MoveWithMouse) - { - x = Input.GetAxis("Horizontal"); - z = Input.GetAxis("Vertical"); - } + HandleMovement(); + HandleLook(); + } + + private void HandleMovement() + { + Vector3 move = transform.right * moveInput.x + transform.forward * moveInput.y; + + if (controller.isGrounded && verticalVelocity < 0) + verticalVelocity = -2f; + + verticalVelocity += gravity * Time.deltaTime; + move.y = verticalVelocity; + + controller.Move(move * moveSpeed * Time.deltaTime); + } + + private void HandleLook() + { + transform.Rotate(Vector3.up * lookInput.x * lookSensitivity); + + cameraPitch -= lookInput.y * lookSensitivity; + cameraPitch = Mathf.Clamp(cameraPitch, -80f, 80f); - return new Vector3(x, 0, z); + baseCamera.transform.localEulerAngles = Vector3.right * cameraPitch; } -} +} \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs.meta b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs.meta index 05b26da7810..9dc6e420166 100644 --- a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs.meta +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/FirstPersonController.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: 94f9f55b5897449c29f5189f47cad4bc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: 1b63a52c6229a7d48944998a4fcad092 \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/SampleAssembly.asmdef b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/SampleAssembly.asmdef new file mode 100644 index 00000000000..8cb1bf88891 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/SampleAssembly.asmdef @@ -0,0 +1,21 @@ +{ + "name": "SampleAssembly", + "rootNamespace": "", + "references": [ + "Unity.InputSystem", + "Unity.RenderPipelines.Core.Runtime", + "Unity.RenderPipelines.Universal.Editor", + "Unity.RenderPipelines.Universal.Runtime" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "ENABLE_INPUT_SYSTEM" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/SampleAssembly.asmdef.meta b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/SampleAssembly.asmdef.meta new file mode 100644 index 00000000000..083d6f1e079 --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Samples~/URPPackageSamples/SharedAssets/Scripts/SampleAssembly.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d770956cfc6450d45bf1908075cac342 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl index 56438e7ba05..ff2beaf897f 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl @@ -31,12 +31,12 @@ half3 SampleScreenSpaceGI(float2 pos) #define _MIXED_LIGHTING_SUBTRACTIVE #endif -#if !defined(_REFLECTION_PROBE_BLENDING_KEYWORD_DECLARED) -#define _REFLECTION_PROBE_BLENDING 0 +#if !defined(_REFLECTION_PROBE_BLENDING_KEYWORD_DECLARED) && !defined(_REFLECTION_PROBE_BLENDING) + #define _REFLECTION_PROBE_BLENDING 0 #endif -#if !defined(_REFLECTION_PROBE_BOX_PROJECTION_KEYWORD_DECLARED) -#define _REFLECTION_PROBE_BOX_PROJECTION 0 +#if !defined(_REFLECTION_PROBE_BOX_PROJECTION_KEYWORD_DECLARED) && !defined(_REFLECTION_PROBE_BOX_PROJECTION) + #define _REFLECTION_PROBE_BOX_PROJECTION 0 #endif // SH Vertex Evaluation. Depending on target SH sampling might be diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl index 65f6c17365e..4c17acbe804 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl @@ -38,7 +38,7 @@ // ---------------------------------------------------------------------------- -// Time (t = time since current level load) values from Unity +// Time values from Unity float4 _Time; // (t/20, t, t*2, t*3) float4 _SinTime; // sin(t/8), sin(t/4), sin(t/2), sin(t) float4 _CosTime; // cos(t/8), cos(t/4), cos(t/2), cos(t) diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Sprite-Lit-Default.shader b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Sprite-Lit-Default.shader index 0e5ce5d0fbe..26449110ef0 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Sprite-Lit-Default.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Sprite-Lit-Default.shader @@ -36,7 +36,8 @@ Shader "Universal Render Pipeline/2D/Sprite-Lit-Default" // GPU Instancing #pragma multi_compile_instancing - #pragma multi_compile _ DEBUG_DISPLAY SKINNED_SPRITE + #pragma multi_compile _ DEBUG_DISPLAY + #pragma multi_compile _ SKINNED_SPRITE struct Attributes { diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Editor/NoLeaksOnEnterLeavePlaymode.cs b/Packages/com.unity.render-pipelines.universal/Tests/Editor/NoLeaksOnEnterLeavePlaymode.cs index e70e76510d5..ff2a3f1a983 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Editor/NoLeaksOnEnterLeavePlaymode.cs +++ b/Packages/com.unity.render-pipelines.universal/Tests/Editor/NoLeaksOnEnterLeavePlaymode.cs @@ -114,6 +114,7 @@ public IEnumerator NoResourceLeaks() "Arial Unicode MS - Regular Material", "Helvetica Neue - Regular Material", "Inter - Regular Material", // UUM-28555 + "Inter - Regular Material + Inter - Semi Bold Atlas", // UUM-28555 "Malgun Gothic - Regular Material", "Microsoft Sans Serif - Regular Material", "Microsoft YaHei - Regular Material", @@ -143,6 +144,7 @@ public IEnumerator NoResourceLeaks() "Arial Unicode MS - Regular Atlas", "Helvetica Neue - Regular Atlas", "Inter - Regular Atlas", + "Inter - Regular Material + Inter - Semi Bold Atlas", "Malgun Gothic - Regular Atlas", "Microsoft Sans Serif - Regular Atlas", "Microsoft YaHei - Regular Atlas", diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/LightClusteringTests.cs b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/LightClusteringTests.cs index 2ebcf991d8f..793cadaf955 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/LightClusteringTests.cs +++ b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/LightClusteringTests.cs @@ -12,100 +12,6 @@ namespace UnityEngine.Rendering.Universal.Tests { class LightClusteringTests { - [Description("Test that an orthographic camera tilted down at a 45 degree angle clusters reflection probes properly. This test specifically focuses on making sure that the convex hull logic in the tiling jobs works as intended, because the reflection probe volume forms collinear points. This test was added due to UUM-58983.")] - [UnityPlatform(include = new RuntimePlatform[] { RuntimePlatform.WindowsEditor, RuntimePlatform.WindowsPlayer, RuntimePlatform.OSXEditor, RuntimePlatform.OSXPlayer })] - [Test] - public void LightClustering_WithOrthographicCameraAndCollinearConvexHull_ZBinsAndTileMasksAreCorrect() - { - NativeArray lights = new(0, Allocator.TempJob); - NativeArray probes = new(1, Allocator.TempJob); - probes[0] = new VisibleReflectionProbe() - { - bounds = new Bounds(Vector3.zero, new Vector3(5, 5, 5)), - localToWorldMatrix = Matrix4x4.identity, - center = Vector3.zero, - blendDistance = 0, - }; - NativeArray zBins = new(UniversalRenderPipeline.maxZBinWords, Allocator.TempJob); - NativeArray tileMasks = new (UniversalRenderPipeline.maxTileWords, Allocator.TempJob); - - float4x4 worldToView = new float4x4( - new float4(1, 0, 0, 0), - new float4(0, 0.707106709f, 0.707106829f, 0), - new float4(0, 0.707106829f, -0.707106709f, 0), - new float4(0, 0, -10, 1) - ); - var worldToViews = new Fixed2(worldToView, worldToView); - float4x4 viewToClip = new float4x4( - new float4(0.0985474288f, 0, 0, 0), - new float4(0, 0.200000003f, 0, 0), - new float4(0, 0, -0.0200601816f, 0), - new float4(0, 0, -1.00601816f, 1) - ); - var viewToClips = new Fixed2(viewToClip, viewToClip); - int2 screenResolution = new(128, 128); - float nearPlane = 0.3f; - float farPlane = 100f; - - JobHandle handle = ForwardLights.ScheduleClusteringJobs( - lights, - probes, - zBins, - tileMasks, - worldToViews, - viewToClips, - 1, - screenResolution, - nearPlane, - farPlane, - true, - out int localLightCount, - out int directionalLightCount, - out int binCount, - out float zBinScale, - out float zBinOffset, - out int2 tileResolution, - out int actualTileWidth, - out int wordsPerTile - ); - JobHandle.ScheduleBatchedJobs(); - handle.Complete(); - - // Uncomment temporarily if the reference arrays need to be updated. - // Debug.Log(string.Join(",", zBins)); - // Debug.Log(string.Join(",", tileMasks)); - - // If the following assertions fail, there isn't currently good - // tooling to visualize the difference. A 3D texture slice viewer - // can be built that would fix this issue. But the cost-benefit is - // not worth it at the moment, since the diff of a PR that fails - // this test can be enough to go on. - // - // Also, these assertions can fail if a change is made includes more - // false positives, i.e. lights contributing to _more_ clusters than - // expected due to increased conservatism, or lights contributing to - // _less_ clusters due increased accuracy. In either of these cases, - // it is up to the author of these code changes to update the - // expected values. - CollectionAssert.AreEqual(expectedZBins0, zBins); - CollectionAssert.AreEqual(expectedTileMasks0, tileMasks); - - lights.Dispose(); - probes.Dispose(); - zBins.Dispose(); - tileMasks.Dispose(); - } - - static readonly uint[] expectedZBins0 = - { - 65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,0,1,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,65535,65535,0,0 - }; - - static readonly uint[] expectedTileMasks0 = - { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - }; - [Description("The tiling job calculates an intersection between an XZ plane and the light volume to determine the range of tiles that the light affects. In the cases where this range falls completely outside of the screen, this test ensures that the ranges are clamped correctly to screen boundaries. If not tested, this bug affects the cone section of spot lights, the cap section of spot lights, and also point lights. This test was added due to UUM-84591.")] [UnityPlatform(include = new RuntimePlatform[] { RuntimePlatform.WindowsEditor, RuntimePlatform.WindowsPlayer, RuntimePlatform.OSXEditor, RuntimePlatform.OSXPlayer })] [Test] diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/ShadowCaster2DTests.cs b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/ShadowCaster2DTests.cs new file mode 100644 index 00000000000..da84421001e --- /dev/null +++ b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/ShadowCaster2DTests.cs @@ -0,0 +1,56 @@ +#if U2D_ANIMATION_INSTALLED +using NUnit.Framework; +using UnityEngine.U2D.Animation; + +namespace UnityEngine.Rendering.Universal.Tests +{ + class ShadowCaster2DTests + { + GameObject m_Obj; + + [SetUp] + public void Setup() + { + m_Obj = new GameObject(); + m_Obj.AddComponent(); + } + + [TearDown] + public void Cleanup() + { + Object.DestroyImmediate(m_Obj); + } + + [Test] + public void AddShadowCaster2DWithSpriteSkin() + { + m_Obj.AddComponent(); + ShadowCaster2D shadowCaster2D = m_Obj.AddComponent(); + +// ShadowCaster2D.shadowShape2DProvider is always null on Standalone. +#if UNITY_EDITOR + Assert.That(shadowCaster2D.shadowShape2DProvider, Is.TypeOf(typeof(ShadowShape2DProvider_SpriteSkin))); +#else + Assert.That(shadowCaster2D.shadowShape2DProvider, Is.Null); +#endif + } + + [Test] + public void AddShadowCaster2DWithSpriteSkinWhenInactive() + { + m_Obj.AddComponent(); + m_Obj.SetActive(false); + ShadowCaster2D shadowCaster2D = m_Obj.AddComponent(); + Assert.That(shadowCaster2D.shadowShape2DProvider, Is.Null); + + m_Obj.SetActive(true); +// ShadowCaster2D.shadowShape2DProvider is always null on Standalone. +#if UNITY_EDITOR + Assert.That(shadowCaster2D.shadowShape2DProvider, Is.TypeOf(typeof(ShadowShape2DProvider_SpriteSkin))); +#else + Assert.That(shadowCaster2D.shadowShape2DProvider, Is.Null); +#endif + } + } +} +#endif diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Preview3D.cs.meta b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/ShadowCaster2DTests.cs.meta similarity index 71% rename from Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Preview3D.cs.meta rename to Packages/com.unity.render-pipelines.universal/Tests/Runtime/ShadowCaster2DTests.cs.meta index 5c9d82c3e5e..a7db3171516 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Preview3D.cs.meta +++ b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/ShadowCaster2DTests.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 00a8f7d2349fd5e4abc3d4abc125519b -timeCreated: 1503569120 -licenseType: Pro +guid: cf9e72a1bdd854b65a42b0d13738efcd MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/Unity.RenderPipelines.Universal.Runtime.Tests.asmdef b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/Unity.RenderPipelines.Universal.Runtime.Tests.asmdef index 13cdbdae9cf..502762ff501 100644 --- a/Packages/com.unity.render-pipelines.universal/Tests/Runtime/Unity.RenderPipelines.Universal.Runtime.Tests.asmdef +++ b/Packages/com.unity.render-pipelines.universal/Tests/Runtime/Unity.RenderPipelines.Universal.Runtime.Tests.asmdef @@ -7,7 +7,8 @@ "GUID:0acc523941302664db1f4e527237feb3", "GUID:516a5277b8c3b4f4c8cc86b77b1591ff", "GUID:d8b63aba1907145bea998dd612889d6b", - "GUID:df380645f10b7bc4b97d4f5eb6303d95" + "GUID:df380645f10b7bc4b97d4f5eb6303d95", + "GUID:41524c21c95e5fe4dbc5b48bd21995a4" ], "includePlatforms": [], "excludePlatforms": [], @@ -20,6 +21,12 @@ "defineConstraints": [ "UNITY_INCLUDE_TESTS" ], - "versionDefines": [], + "versionDefines": [ + { + "name": "com.unity.2d.animation", + "expression": "1.0.0", + "define": "U2D_ANIMATION_INSTALLED" + } + ], "noEngineReferences": false } \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Documentation~/Append-Node.md b/Packages/com.unity.shadergraph/Documentation~/Append-Node.md index 1550eddd367..54958b882e1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Append-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Append-Node.md @@ -19,7 +19,11 @@ Input **A** channels take priority over input **B** to combine up to a maximum o ## Example graph usage -In the following example, an **Append** node combines a **Vector 2** and a **Float**. The resulting output vector has 3 channels: the **X** and **Y** from the **Vector 2**, and the **X** from the **Float**. +In the following example, an **Append** node combines a **Vector 2** and a **Float**. The resulting output vector has the following 3 channels: + +- The first channel is the **X** from the **Vector 2**. +- The second channel is the **Y** from the **Vector 2**. +- The third channel is the **X** from the **Float**. Notice that with an Append node, you don't need to use a Split node to break up the Vector 2 into individual channels, then a Combine node to combine the 3 separate channels. diff --git a/Packages/com.unity.shadergraph/Documentation~/Built-In-Blocks.md b/Packages/com.unity.shadergraph/Documentation~/Built-In-Blocks.md index 202a46d2499..4768547dc5c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Built-In-Blocks.md +++ b/Packages/com.unity.shadergraph/Documentation~/Built-In-Blocks.md @@ -1,24 +1,37 @@ -# Built In Blocks +# Built-In Blocks + +Define standard inputs and outputs for the Master Stack. ## Vertex Blocks -| | Name | Type | Binding | Description | -|:-----------|:----------------|:---------|:----------------------|:------------| -| ![image](images/Blocks-Vertex-Position.png) | Position | Vector 3 | Object Space Position | Defines the absolute object space vertex position per vertex.| -| ![image](images/Blocks-Vertex-Normal.png) | Normal | Vector 3 | Object Space Normal | Defines the absolute object space vertex normal per vertex.| -| ![image](images/Blocks-Vertex-Tangent.png) | Tangent | Vector 3 | Object Space Tangent | Defines the absolute object space vertex tangent per vertex.| -| ![image](images/Blocks-Vertex-Color.png) | Color | Vector 4 | Vertex Color | Defines vertex color. Expected range 0 - 1. | + +Set per-vertex attributes and pass data to fragments. + +| Name | Type | Binding | Description | +|:--------------------|:---------|:----------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Position | Vector 3 | Object Space Position | Defines the absolute object space vertex position per vertex. | +| Normal | Vector 3 | Object Space Normal | Defines the absolute object space vertex normal per vertex. | +| Tangent | Vector 3 | Object Space Tangent | Defines the absolute object space vertex tangent per vertex. | +| Color | Vector 4 | Vertex Color | Defines vertex color. Expected range 0 - 1. | +| Custom Interpolator | Vector 4, vector 3, vector 2, or float | Custom Interpolator | Passes custom data from the vertex stage to the fragment stage. | ## Fragment Blocks -| | Name | Type | Binding | Description | -|:-----------|:---------|:---------|:---------------------|:------------| -| ![image](images/Blocks-Fragment-Base-Color.png) | Base Color | Vector 3 | None | Defines material's base color value. Expected range 0 - 1. | -| ![image](images/Blocks-Fragment-NormalTS.png) | Normal (Tangent Space) | Vector 3 | Tangent Space Normal | Defines material's normal value in tangent space. | -| ![image](images/Blocks-Fragment-NormalOS.png) | Normal (Object Space) | Vector 3| Object Space Normal | Defines material's normal value in object space. | -| ![image](images/Blocks-Fragment-NormalWS.png) | Normal (World Space) | Vector 3 | World Space Normal | Defines material's normal value in world space. | -| ![image](images/Blocks-Fragment-Emission.png) | Emission | Vector 3 | None | Defines material's emission color value. Expects positive values. | -| ![image](images/Blocks-Fragment-Metallic.png) | Metallic | Float | None | Defines material's metallic value, where 0 is non-metallic and 1 is metallic. | -| ![image](images/Blocks-Fragment-Specular.png) | Specular | Vector 3 | None | Defines material's specular color value. Expected range 0 - 1. | -| ![image](images/Blocks-Fragment-Smoothness.png) | Smoothness | Float | None | Defines material's smoothness value. Expected range 0 - 1. | -| ![image](images/Blocks-Fragment-Ambient-Occlusion.png) | Ambient Occlusion | Float | None | Defines material's ambient occlusion value. Expected range 0 - 1. | -| ![image](images/Blocks-Fragment-Alpha.png) | Alpha | Float | None | Defines material's alpha value. Used for transparency and/or alpha clip. Expected range 0 - 1. | -| ![image](images/Blocks-Fragment-Alpha-Clip-Threshold.png) | Alpha Clip Threshold | Float | None | Fragments with an alpha below this value are discarded. Expected range 0 - 1. | + +Specify per-pixel material properties used for shading. + +| Name | Type | Binding | Description | +|:-----------------------|:---------|:---------------------|:-----------------------------------------------------------------------------------------------| +| Base Color | Vector 3 | None | Defines material's base color value. Expected range 0 - 1. | +| Normal (Tangent Space) | Vector 3 | Tangent Space Normal | Defines material's normal value in tangent space. | +| Normal (Object Space) | Vector 3 | Object Space Normal | Defines material's normal value in object space. | +| Normal (World Space) | Vector 3 | World Space Normal | Defines material's normal value in world space. | +| Emission | Vector 3 | None | Defines material's emission color value. Expects positive values. | +| Metallic | Float | None | Defines material's metallic value, where 0 is non-metallic and 1 is metallic. | +| Specular | Vector 3 | None | Defines material's specular color value. Expected range 0 - 1. | +| Smoothness | Float | None | Defines material's smoothness value. Expected range 0 - 1. | +| Ambient Occlusion | Float | None | Defines material's ambient occlusion value. Expected range 0 - 1. | +| Alpha | Float | None | Defines material's alpha value. Used for transparency and/or alpha clip. Expected range 0 - 1. | +| Alpha Clip Threshold | Float | None | Fragments with an alpha below this value are discarded. Expected range 0 - 1. | + +## Additional resources + +[Add a custom interpolator](Custom-Interpolators.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md index 6bfd3c8ee58..60872a1cd29 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md @@ -8,7 +8,7 @@ Returns the cosine of the value of input **In**. | Name | Direction | Type | Description | |:------------ |:-------------|:-----|:---| -| In | Input | Dynamic Vector | Input value | +| In | Input | Dynamic Vector | Input value in radians | | Out | Output | Dynamic Vector | Output value | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md b/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md index 31b2d355a79..5cfbb956fbc 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md +++ b/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md @@ -1,22 +1,69 @@ -# Create Node Menu +# Add and connect nodes in a shader graph -## Description +You can add and connect nodes in a shader graph in different ways depending on your current task. -Use the **Create Node Menu** to create [nodes](Node.md) in Shader Graph. To open the **Create Node Menu**, either right-click on the workspace in the [Shader Graph Window](Shader-Graph-Window.md) and select **Create Node**, or press the spacebar. +> [!NOTE] +> To add and connect nodes in a shader graph, you need to [create a shader graph asset](create-shader-graph.md) first and open the asset in the [Shader Graph window](Shader-Graph-Window.md). -At the top of the **Create Node Menu** is a search bar. To search for a node, type any part of its name in the search field. The search box gives you autocomplete options, and you can press Tab to accept the predictive text. It highlights matching text in yellow. +## Add a node -The **Create Node Menu** lists all nodes that are available in Shader Graph, categorized by their function. User-created [Sub Graphs](Sub-graph.md) are also available in the **Create Node Menu** under **Sub Graph Assets**, or in a custom category that you define in the Sub Graph Asset. +To add a [node](Node.md) to your shader graph, follow these steps: -To add a node to the workspace, double-click it in the **Create Node Menu**. +1. Open the **Create Node** menu through either of the following: + + * Select the [Shader Graph window](Shader-Graph-Window.md)'s workspace and press the **Spacebar**. + * Right-click in the Shader Graph Window's workspace and select **Create Node**. -### Contextual Create Node Menu +1. In the **Create Node** menu, browse or search for the desired node. + + The **Create Node** menu lists all nodes that are available in Shader Graph, categorized by their function. User-created [sub graphs](Sub-graph.md) are also available in the **Create Node** menu under **Sub Graph Assets**, or in a custom category that you define in the Sub Graph Asset. -A contextual **Create Node Menu** filters the available nodes, and only shows those that use the [Data Type](Data-Types.md) of a selected edge. It lists every available [Port](Port.md) on nodes that match that Data Type. +1. Double-click on a node's name to add the corresponding node in the graph. -To open a contextual **Create Node Menu**, click and drag an [Edge](Edge.md) from a Port, and then release it in an empty area of the workspace. +> [!NOTE] +> Use the **Create Node** menu search box to filter the listed nodes by name parts and synonyms based on industry terms. It provides autocomplete options and highlights matching text in yellow. You can press **Tab** to accept the predictive text. -### Master Stack Create Node Menu -To add a new [Block Node]() to the [Master Stack](), either right click and select **Create Node** or press spacebar with the stack selected. +## Connect node ports -The **Create Node Menu** will display all available blocks for the master stack based on the render pipelines in your project. Any block can be added to the master stack via the **Create Node Menu**. If the block added is not compatible with the current Graph settings, the block will be disabled until the settings are configured to support it. +To connect [ports](Port.md) between two existing [nodes](Node.md) or with the [master stack](Master-Stack.md), select and drag the desired port to the target. + +The line resulting from that connection is called an [edge](Edge.md). + +You can only connect an output port to a input port, or vice-versa, and you can't connect two ports of the same node together. + +## Add and connect a node from an existing port + +To connect a [port](Port.md) to a [node](Node.md) that doesn't exist yet and create that targeted node in the process, follow these steps: + +1. Select and drag the desired port and release it in an empty area of the workspace. + +1. In the **Create Node** menu, browse or search for the node you need to connect to the port you dragged out. + + The **Create Node** menu displays every node port available according to the [data types](Data-Types.md) compatible with the port you dragged out. + +1. Double-click on a node port's name to add the corresponding node in the graph, with the two expected ports already connected­. + +## Add a block node in the Master Stack + +To add a new [block node](Block-Node.md) to the [master stack](Master-Stack.md), follow these steps: + +1. Open the **Create Node** menu for the Master Stack context through either of the following: + * Select the Master Stack's targeted context (**Vertex** or **Fragment**) and press the **Spacebar**. + * Right-click in the Master Stack's targeted context area and select **Create Node**. + +1. In the **Create Node** menu, browse or search for the desired block node. + + The **Create Node** menu displays all available blocks for the master stack based on the render pipelines in your project. + +1. Double-click on a block node's name to add the corresponding block node in the Master Stack. + +> [!NOTE] +> If the block that you add is not compatible with the current [graph settings](Graph-Settings-Tab.md), the block is deactivated until you configure the settings to support it. + +## Additional resources + +* [Nodes](Node.md) +* [Ports](Port.md) +* [Edges](Edge.md) +* [Master Stack](Master-Stack.md) +* [Block nodes](Block-Node.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Create-Shader-Graph.md b/Packages/com.unity.shadergraph/Documentation~/Create-Shader-Graph.md index 0db8b5eeecc..bf5b07eeb02 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Create-Shader-Graph.md +++ b/Packages/com.unity.shadergraph/Documentation~/Create-Shader-Graph.md @@ -1,51 +1,57 @@ -# Creating a new shader graph asset +# Create a shader graph asset -After you configure an SRP, you can create a new shader graph asset. +You can create a new shader graph asset in different ways according to your current workflow. -To create a new shader graph asset, follow these steps: -1. In the **Project** window, right-click and select **Create** > **Shader Graph** > **From Template...**. +## Create a shader graph from a template -1. In the context menu, select your desired type of Shader Graph. +To create a new shader graph asset from a prebuilt shader graph template, follow these steps: - The type of Shader Graph available is dependent on the render pipelines present in your project. +1. In the **Project** window, right-click and select **Create** > **Shader Graph** > **From Template**. - A submenu for each installed render pipeline may be present containing template stacks for standard shading models ( Lit, Unlit, etc ). + The [template browser](template-browser.md) lists all available templates according to your project's render pipeline. - For a full list of provided options, refer to the [Universal Render Pipeline](https://docs.unity3d.com/Manual/urp/urp-introduction.html) and [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest) documentation. +1. Select the desired template and click **Create**. - For this example, Universal is installed so a Universal Lit Shader Graph has been created. + Unity creates a new shader graph asset in your project. -1. Double-click your newly created shader graph asset to open it in the Shader Graph window. +1. Name the shader graph asset. -## Shader Graph window +You can now open the asset and edit the graph in the [Shader Graph window](Shader-Graph-Window.md). -The Shader Graph window consists of the Master Stack, the Preview Window, the Blackboard, and the Graph Inspector. -![](images/ShaderGraphWindow.png) +## Create a shader graph with a preset target -### Master Stack +To start from a default configuration with a preset master stack according to a specific render pipeline and material type, follow these steps: -The final connection that determines your shader output. Refer to [Master Stack](Master-Stack.md) for more information. +1. In the **Project** window, right-click and select **Create** > **Shader Graph**, and then the target render pipeline and the desired shader type. -![]() + The types of shader graphs available depend on the render pipelines present in your project (for example, **URP** > **Lit Shader Graph**). For a full list of provided options, refer to the [Universal Render Pipeline](https://docs.unity3d.com/Manual/urp/urp-introduction.html) and [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest) documentation. -### Preview window + Unity creates a new shader graph asset in your project. -An area to preview the current shader output. Here, you can rotate the object, and zoom in and out. You can also change the basic mesh on which the shader is previewed. Refer to [Main Preview](Main-Preview.md) for more information. +1. Name the shader graph asset. -![img](images/MainPreview.png) +You can now open the asset and edit the graph in the [Shader Graph window](Shader-Graph-Window.md). -### Blackboard -An area that contains all of the shader's properties in a single, collected view. Use the Blackboard to add, remove, rename, and reorder properties. Refer to [Blackboard](Blackboard.md) for more information. +## Create an empty shader graph -![](images/Blackboard.png) +To create an empty shader graph asset and build your shader graph from scratch in the Shader Graph window: -After you've set up a project, and become familiar with the Shader Graph window, refer to [My first Shader Graph](First-Shader-Graph.md) for more information on how to get started. +1. In the **Project** window, right-click and select **Create** > **Shader Graph** > **Blank Shader Graph**. -### Internal Inspector + Unity creates a new shader graph asset in your project. -An area that contains information contextual to whatever the user is currently clicking on. It's a window that automatically is hidden by default and only appears when something is selected that can be edited by the user. Use the Internal Inspector to display and modify properties, node options, and the graph settings. Refer to [Internal Inspector](Internal-Inspector.md) for more information. +1. Name the shader graph asset. -![](images/Inspector.png) +You can now open the asset and edit the graph in the [Shader Graph window](Shader-Graph-Window.md). + +> [!NOTE] +> To make such a blank shader graph functional, you have to define a [Target](Graph-Target.md) in the [Graph settings tab](Graph-Settings-Tab.md) of the Graph Inspector. + +## Additional resources + +* [Shader Graph template browser](template-browser.md) +* [Create a custom shader graph template](template-browser.md#create-a-custom-shader-graph-template) +* [Shader Graph window](Shader-Graph-Window.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators-landing.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators-landing.md new file mode 100644 index 00000000000..adada98c7c2 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators-landing.md @@ -0,0 +1,8 @@ +# Using Custom Interpolators + +Use custom interpolators to pass custom data from the vertex shader to the fragment shader. + +| **Page** | **Description** | +|--------------------------------------------------------------------|---------------------------------------------------------------------------------| +| [Custom Interpolators](Custom-Interpolators.md) | Learn how to use and manage custom interpolators according to your needs. | +| [Custom Interpolator reference](Custom-Interpolators-reference.md) | Explore the Custom Interpolator properties. | diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators-reference.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators-reference.md new file mode 100644 index 00000000000..e4668c1c0f2 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators-reference.md @@ -0,0 +1,20 @@ +# Custom Interpolator reference + +Transfer custom data from the vertex stage to the fragment stage. + +You first create a custom interpolator block node in the Vertex context. You can then add a custom interpolator node in the workspace and connect it to a block node in the Fragment context. + +The following descriptions and settings apply to both the Vertex block and the Fragment node. + +## Settings + +| Property | Description | +|:------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Name** | Sets the unique name of the custom interpolator to identify and reference it in the graph. | +| **Type** | Sets the number of channels the Custom Interpolator exposes. The default value is **Vector 4**, which exposes x, y, z, and w channels. | +| **Interpolation** | Selects how Unity interpolates the value from vertex to fragment across the surface. The following options are available:
  • Linear: Applies the default linear interpolation, which preserves correct rates of change in screen space.
  • No Perspective: Doesn't correct perspective, which can warp data, depending on the angle between the surface and the camera.
  • No Interpolation: Doesn't interpolate the data, which creates hard edges between triangles.
| + +## Additional resources + +* [Built-in blocks](Built-In-Blocks.md) +* [Add a custom interpolator](Custom-Interpolators.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md index eabcb1a1885..507a3921bfb 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Interpolators.md @@ -27,9 +27,10 @@ You can't limit the number of channels another user creates in a shader graph. H ## Add a custom interpolator block to the Master Stack 1. Right-click in the **Vertex** context to create a block node. -2. Select **Custom Interpolator**. -3. In the **Node Settings** tab of the **Graph Inspector** window, select a data type, for example **Vector 4**. -4. In the same tab, enter a name for the interpolator. +1. Select **Custom Interpolator**. +1. In the **Node Settings** tab of the **Graph Inspector** window, select a data type, for example **Vector 4**. +1. Select an [interpolation method](Custom-Interpolators-reference.md). +1. In the same tab, enter a name for the interpolator. ## Write data to the interpolator @@ -51,3 +52,8 @@ The graph now writes Vertex ID values into the custom interpolator. ## Delete a custom interpolator If you delete a custom interpolator that's associated with nodes that are still in your graph, Unity displays an alert. If you want to keep using these nodes, you can create a new custom interpolator and associate the nodes with it. This prevents the alert from appearing. + +## Additional resources + +* [Built In Blocks](Built-In-Blocks.md) +* [Custom Interpolator reference](Custom-Interpolators-reference.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Edge.md b/Packages/com.unity.shadergraph/Documentation~/Edge.md index 988acaeb150..5a45646a536 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Edge.md +++ b/Packages/com.unity.shadergraph/Documentation~/Edge.md @@ -6,6 +6,6 @@ An **Edge** defines a connection between two [Ports](Port.md). **Edges** define Each **Edge** has a [Data Type](Data-Types.md) which defines what [Ports](Port.md) it can be connected to. Each [Data Type](Data-Types.md) has an associated color for identifying its type. -You can create a new **Edge** by clicking and dragging from a [Port](Port.md) with the left mouse button. Edges can be deleted with Delete (Windows), Command + Backspace (OSX) or from the context menu by right clicking on the [Node](Node.md). +You can create a new **Edge** by clicking and dragging from a [Port](Port.md) with the left mouse button. Edges can be deleted with Delete (Windows), Command + Backspace (OSX) or from the context menu by right clicking on the edge. You can open a contextual [Create Node Menu](Create-Node-Menu.md) by dragging an **Edge** from a [Port](Port.md) with the left mouse button and releasing it in an empty area of the workspace. diff --git a/Packages/com.unity.shadergraph/Documentation~/First-Shader-Graph.md b/Packages/com.unity.shadergraph/Documentation~/First-Shader-Graph.md index 303b7dcda8b..240330c6fd7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/First-Shader-Graph.md +++ b/Packages/com.unity.shadergraph/Documentation~/First-Shader-Graph.md @@ -1,111 +1,121 @@ -# My first Shader Graph +# Create a shader graph and use it with a material -Before you begin, make sure that your project is set up properly, and the graphs are loading correctly. See [Getting started with Shader Graph](Getting-Started.md) for more information. +This example shows you how to do the following: +* Create a simple Lit shader graph with the Universal Render Pipeline (URP). +* Create and manage a material that uses this shader graph in a scene. -## Create a New Graph -Use the Project Browser to create a new [Shader Graph Asset](Shader-Graph-Asset.md) in your project. The **Create > Shader Graph** will display the various creation options. +For more options to get started with Shader Graph, refer to: +* [Create a shader graph asset](create-shader-graph.md) +* [Add and connect nodes in a shader graph](Create-Node-Menu.md) -A **Blank Shader Graph** will create a Shader Graph with no selected active targets or [block nodes](Block-Node.md). You will need to select a target via the [Graph Settings Menu](Graph-Settings-Tab.md) to continue. +## Create a new shader graph -Certain integrations, like Render Pipelines, can also provide pre-configured options for Shader Graphs. For this example, a **Universal > Lit** Shader Graph has been created and opened. +Before you can build a new shader graph, you have to create a shader graph asset to contain it. Follow these steps: -## Create a new node +1. In the **Project** window, right-click and select **Create** > **Shader Graph** > **URP** > **Lit**. + +1. Name the created shader graph asset and press Enter. -Use the **Create Node** menu to create new nodes. There are two ways to open the menu: +The [Shader Graph window](Shader-Graph-Window.md) opens, which allows you to edit the shader graph in the created asset. If the window doesn't open, double-click on the created asset. -1. Right click, and select **Create Node** from the context menu. -2. Press the spacebar. +## Create a new node -In the menu, you can type in the search bar to look for specific nodes, or browse all nodes in the library. In this example, we'll create a Color node. First, type "color" in the **Create Node** menu's search bar. Then, click **Color**, or highlight **Color** and press Enter to create a Color node. +For this example, you need to create a Color node. Follow these steps: -![](images/MyFirstShaderGraph_01.png) +1. Select the Shader Graph window's workspace and press the **Spacebar**. + + The **Create Node** menu opens, with the list of all available nodes. -## Connect nodes +1. In the **Create Node** menu's search bar, type `color`. -To build a graph, you need to connect nodes together. To do so, click the **Output Slot** of a node, and drag that connection into the **Input Slot** of another node. +1. In the **Input** > **Basic** category, double-click on **Color**. -Start by connecting the Color node to the **Base Color** block of our Fragment Stack. +A new **Color** node appears in the workspace. -![](images/MyFirstShaderGraph_02.png) +## Connect the node to the master stack -## Change node output +To use the Color node property as an input for the shader, you need to connect the node to the master stack. Follow these steps: -Notice that the connection updated the main preview, and the 3D Object in the **Main Preview** is now black, which is the color specified in the Color node. You can click on the color bar in that node, and use the color picker to change the color. Any changes you make on the node updates the object in the **Main Preview** in real time. +1. Select the **Out(4)** port of the **Color** node. -For example, if you pick red, the 3D Object immediately reflects this change. +1. Drag it to the **Base Color** block port of the **Fragment** section of the [master stack](Master-Stack.md). -![](images/MyFirstShaderGraph_03.png) +This connection updates the appearance of the 3D object in the **Main Preview**, which is now black, according to the Color node's default value. -## Save the graph +## Change the shader color -Currently, Shader Graphs do not automatically save. There are two ways to save your changes: +You can change the output color of the Color node to view how it affects the final shader. Follow these steps: -1. Click the **Save Asset** button in the top left corner of the window. -3. Close the graph. If Unity detects any unsaved changes, a pop-up window appears, and asks if you want to save those changes. +1. In the **Color** node, click on the color bar. -![](images/MyFirstShaderGraph_04.png) +1. Use the color picker to change the color. -## Create a Material +The color of the 3D object in the **Main Preview** changes to the selected color in real time. -After saving your graph, use the shader to create a new Material. The process of [creating a new Material](https://docs.unity3d.com/Manual/Materials.html) and assigning it a Shader Graph shader is the same as that for regular shaders. In either the main menu or the Project View context menu, select **Assets > Create > Material**. Select the Material you just created. In its Inspector window, select the **Shader** drop-down menu, click **Shader Graphs**, and choose the Shader Graph shader you wish to apply to the Material. +## Save your shader graph -You can also right-click the Shader Graph shader, and select **Create > Material**. This method automatically assigns that Shader Graph shader to the newly created Material. +You need to save your shader graph to use it with a material. To save your shader graph, do one of the following: -![](images/MyFirstShaderGraph_05.png) +* Click the **Save Asset** button in the top left corner of the window. -A Material is also automatically generated as a subasset of the Shader Graph. You can assign it directly to an object in your scene. Modifying a property from the Blackboard on the Shader Graph will update this material in real time, which allows for quick visualization in the scene. +* Close the graph. If Unity detects any unsaved changes, a dialog appears, and asks if you want to save those changes. -## Put the Material in the Scene +## Create a material from your shader graph -Now that you have assigned your shader to a Material, you can apply it to objects in the Scene. Drag and drop the Material onto an object in the Scene. Alternatively, in the object's Inspector window, locate **Mesh Renderer > Materials**, and apply the Material to the **Element**. +After you've saved your shader graph, you can use it to create a new material. -![](images/MyFirstShaderGraph_06.png) +The process of [creating a new Material](https://docs.unity3d.com/Manual/Materials.html) and assigning it a Shader Graph shader is the same as that for regular shaders. -## Use properties to edit the graph +To create a new material from your shader graph, follow these steps: -You can also use properties to alter your shader's appearance. Properties are options that are visible from the Material's Inspector, which lets others change settings in your shader without the need to open the Shader Graph. +1. In the Project window, right-click the shader graph asset you created. -To create a new property, use the **Add (+)** button on the top right corner of the Blackboard, and select the type of property to create. In this example, we'll select **Color**. +1. Select **Create > Material**. -![](images/MyFirstShaderGraph_07.png) +Unity automatically assigns the shader graph asset to the newly created material. You can view the shader graph name selected in the material's Inspector in the **Shader** property. -This adds a new property in the Blackboard with the following options in the **Node Settings** tab of the [Graph Inspector](Internal-Inspector.md) when the property is selected. +## Use the material in the scene -![](images/MyFirstShaderGraph_08.png) +Now that you have assigned your shader to a material, you can apply this material to GameObjects in the scene through one of the following: -| **Option** | **Description** | -| ------------------- | ------------------------------------------------------------ | -| **Property button** | To change the name of the property, right-click the button in the Blackboard, select **Rename**, then enter a new property name. To delete the property, right-click the button, and select **Delete**. | -| **Exposed** | Enable this checkbox to make the property visible from the Material's Inspector. | -| **Reference** | The property's name that appears in C# scripts. To change the **Reference** name, enter a new string. | -| **Default** | The default value of the property. | -| **Mode** | The mode of the property. Each property has different modes. For **Color**, you can select either **Default** or **HDR**. | -| **Precision** | The default [precision](Precision-Modes.md) of the property. | -| **Hybrid Instanced**| An experimental feature that enables this property to be instanced when using the Hybrid DOTS renderer. | +* Drag the material onto a GameObject in the scene. +* In the GameObject's Inspector, go to **Mesh Renderer > Materials**, and set the **Element** property to your material. -There are two ways to reference a property in your graph: +## Control the color from the material's Inspector -1. Drag the property from the Blackboard onto the graph. -2. Right-click and select **Create Node**. The property is listed in the **Properties** category. +You can use a property in the shader graph to alter your shader's appearance directly from the material's Inspector, without the need to edit the shader graph. -![](images/MyFirstShaderGraph_09.png) +To use a Color property instead of a Color node in your shader graph, follow these steps: -Try connecting the property to the **Base Color** block. The object immediately changes to black. +1. Open the shader graph you created earlier in the [Shader Graph window](Shader-Graph-Window.md). -![](images/MyFirstShaderGraph_10.png) +1. In the [Blackboard](Blackboard.md), select **Add (+)**, and then select **Color**. + + The Blackboard now displays a [property of Color type](Property-Types.md#color). -Save your graph, and return to the Material's Inspector. The property now appears in the Inspector. Any changes you make to the property in the Inspector affects all objects that use this Material. +1. Select the property. +1. In the [Graph Inspector](Internal-Inspector.md), in the **Node Settings** tab: + + * Change the **Name** according to the name you want to identify the property within the material's Inspector. + * Make sure to activate the **Show In Inspector** option. -![](images/MyFirstShaderGraph_11.png) +1. Drag the property from the Blackboard onto the Shader Graph window's workspace. -## More Tutorials +1. Connect the property's node to the **Base Color** block port of the **Fragment** section of the [master stack](Master-Stack.md), instead of the Color node you were using previously. + + This connection updates the appearance of the 3D object in the **Main Preview**, which is now black, according to the property's default value. -Older tutorials use an outdated format of Shader Graph with master nodes. When looking at older tutorials, reference the [Upgrade Guide](Upgrade-Guide-10-0-x.md) for tips on how to convert the master node to a [Master Stack](Master-Stack.md). +1. Save your graph, and return to the material's Inspector. + + The property you added in the graph now appears in the material's Inspector. Any changes you make to the property from the Inspector affects all objects that use this material. -To keep exploring how to use Shader Graph to author shaders, check out these blog posts: +## Additional resources -- [Art That Moves: Creating Animated Materials with Shader Graph](https://unity.com/blog/engine-platform/creating-animated-materials-with-shader-graph) -- [Custom Lighting in Shader Graph: Expanding Your Graphs in 2019](https://unity.com/blog/engine-platform/custom-lighting-in-shader-graph-expanding-your-graphs-in-2019) +* [Art That Moves: Creating Animated Materials with Shader Graph](https://unity.com/blog/engine-platform/creating-animated-materials-with-shader-graph) +* [Custom Lighting in Shader Graph: Expanding Your Graphs in 2019](https://unity.com/blog/engine-platform/custom-lighting-in-shader-graph-expanding-your-graphs-in-2019) +* [Shader Graph video tutorials](https://www.youtube.com/user/Unity3D/search?query=shader+graph) (on Unity YouTube Channel) +* [Shader Graph forum](https://discussions.unity.com/tags/c/unity-engine/52/shader-graph) -You can also visit the [Unity YouTube Channel](https://www.youtube.com/channel/UCG08EqOAXJk_YXPDsAvReSg) and look for [video tutorials on Shader Graph](https://www.youtube.com/user/Unity3D/search?query=shader+graph), or head to our [user forum](https://discussions.unity.com/tags/c/unity-engine/52/shader-graph) to find the latest information and conversations about Shader Graph. +> [!NOTE] +> Older tutorials use a former version of Shader Graph with master nodes. To know the differences between the former master node and the [Master Stack](Master-Stack.md), refer to the [Upgrade Guide](Upgrade-Guide-10-0-x.md). diff --git a/Packages/com.unity.shadergraph/Documentation~/Getting-Started.md b/Packages/com.unity.shadergraph/Documentation~/Getting-Started.md index 4ba39a34efe..07bd1887a40 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Getting-Started.md +++ b/Packages/com.unity.shadergraph/Documentation~/Getting-Started.md @@ -1,9 +1,9 @@ # Get started with Shader Graph -Explore the Shader Graph user interface and general workflows to start creating your own shader graphs. +Use the main shader graph creation and editing tools and explore general workflows to start creating your own shader graphs. | Topic | Description | | :--- | :--- | -| **[Creating a new shader graph asset](Create-Shader-Graph.md)** | Create a shader graph asset and get an overview of the main Shader Graph interface elements available to create and configure a shader graph. | -| **[My first Shader Graph](First-Shader-Graph.md)** | Create and configure a shader graph, and create and manipulate a material that uses that shader graph. | -| **[Create a new shader graph from a template](create-shader-graph-template.md)** | Use the Shader Graph template browser to create a shader graph. | +| **[Create a shader graph asset](Create-Shader-Graph.md)** | Create a shader graph asset, either from a template or with a preset target, or from nothing. | +| **[Add and connect nodes in a shader graph](Create-Node-Menu.md)** | Edit your shader graph asset, create nodes, and connect nodes together. | +| **[Create a shader graph and use it with a material](First-Shader-Graph.md)** | Create and configure a shader graph, and create and manipulate a material that uses that shader graph. | diff --git a/Packages/com.unity.shadergraph/Documentation~/Keywords-reference.md b/Packages/com.unity.shadergraph/Documentation~/Keywords-reference.md index c7577407f91..98576807ab3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Keywords-reference.md +++ b/Packages/com.unity.shadergraph/Documentation~/Keywords-reference.md @@ -10,6 +10,7 @@ Parameters that all keyword types have in common. | :--- | :--- | | **Name** | The display name of the keyword. Unity shows this name in the title bar of nodes that reference the corresponding keyword, and also in the Material Inspector if you expose that keyword. | | **Reference** | The internal name for the keyword in the shader. Use this **Reference** name instead of the display **Name** when you reference the keyword in a script.

If you overwrite this parameter, be aware of the following:
  • A Keyword **Reference** has to be in full capitals. Unity converts any lowercase letters to uppercase.
  • If the string contains any characters that HLSL does not support, Unity replaces those characters with underscores.
  • You can revert to the default value: right-click on the **Reference** field label, and select **Reset Reference**.
| +| **Promote to final Shader** | Makes the keyword available across the entire shader rather than only within the subgraph. | | **Definition** | Sets the keyword declaration type, which determines how Unity compiles the shader code. This allows you to [optimize the balance between build time, runtime, and file sizes](Keywords-concepts.md#keyword-impact-optimization).

The options are:
  • **Shader Feature**: Unity only compiles shader variants for keyword combinations used by materials in your build, and removes other shader variants.
  • **Multi Compile**: Unity compiles shader variants for all keyword combinations regardless of whether the build uses these variants.
  • **Predefined**: Specifies that the target/sub-target already defines the keyword and you just want to reuse it. Predefined Keywords can either use a [built-in macro](https://docs.unity3d.com/Manual/shader-branching-built-in-macros.html), which results in static branching at build time, or any of the keywords already defined by the Shader Graph Target (for example, [URP](https://docs.unity3d.com/Manual/urp/urp-shaders/shader-keywords-macros.html)), including [Built-In keyword sets](https://docs.unity3d.com/Manual/SL-MultipleProgramVariants-shortcuts.html), and where the branching depends on that definition.
  • **Dynamic Branch**: Unity keeps branching code in one compiled shader program.
| | **Is Overridable** | Indicates whether the keyword's state can be overridden.
For more information, refer to [Toggle shader keywords in a script](https://docs.unity3d.com/Manual/shader-keywords-scripts.html). | | **Generate Material Property** | Generates a material property declaration to display the keyword as a property in the material inspector.
This adds a `[Toggle(_KEYWORD)]` attribute to the material property. For more information, refer to [`MaterialPropertyDrawer`](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html). | diff --git a/Packages/com.unity.shadergraph/Documentation~/Property-Types.md b/Packages/com.unity.shadergraph/Documentation~/Property-Types.md index 9b83dfdf03a..2aee450abbe 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Property-Types.md +++ b/Packages/com.unity.shadergraph/Documentation~/Property-Types.md @@ -12,13 +12,17 @@ All properties have the following common parameters in addition to those specifi | Parameter | Description | | :--- | :--- | -| **Name** | The display name of the property. | -| **Reference** | The internal name for the property in the shader. Use this **Reference** name instead of the display **Name** when you reference the property in a script.

If you overwrite this parameter, be aware of the following:
  • If the string doesn't begin with an underscore, Unity automatically adds one.
  • If the string contains any characters that HLSL does not support, Unity removes them.
  • You can revert to the default value: right-click on the **Reference** field label, and select **Reset Reference**.
| -| **Precision** | Sets the data precision mode of the Property. The options are **Inherit**, **Single**, **Half**, and **Use Graph Precision**.
For more details, refer to [Precision Modes](Precision-Modes.md). | -| **Scope** | Specifies where you expect to edit the property for materials. The options are:
  • **Global**: Makes the property editable at a global level, through a C# script only, for all materials that use it. Selecting this option hides or grays out all parameters that relate to the Inspector UI display.
  • **Per Material**: Makes the property independently editable per material, either through a C# script, or in the Inspector UI if you enable **Show In Inspector**.
  • **Hybrid Per Instance**: Has the same effect as **Per Material**, unless you're using [DOTS instancing](https://docs.unity3d.com/Packages/com.unity.entities.graphics@latest/index.html?subfolder=/manual/dots-instancing-shader.html).
| -| **Show In Inspector** | Displays the property in the material inspector.
If you disable this option, it includes an `[HideInInspector]` attribute to the material property (refer to [Properties block reference in ShaderLab](https://docs.unity3d.com/Manual/SL-Properties.html#material-property-attributes) for more details). | -| **Read Only** | Adds a [`PerRendererData`](https://docs.unity3d.com/ScriptReference/Rendering.ShaderPropertyFlags.html) attribute to the material property to display the value as read-only in the material inspector. | -| **Custom Attributes** | A list of entries that allow you to call custom functions you scripted to create additional [material property drawers](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html), like static decorators or complex controls.
The **Custom Material Property Drawers** sample, available in the Package Manager among other [Shader Graph samples](ShaderGraph-Samples.md), shows how to display a Vector2 as a min/max slider, for example.

**Note**: When you declare the custom functions in the script, make sure to suffix their names with `Drawer` or `Decorator`.

In the list, use **+** or **-** to add or remove entries. Each entry corresponds to a function call which requires the following parameters:
  • **Name**: A shorthened version of the function name, without its `Drawer` or `Decorator` suffix.
  • **Value**: The input values for the function as the script expects them.
**Note**: A property can only have one drawer at any given time. | +| **Name** | Displays the user-facing name of the property in the UI. | +| **Reference** | Defines the internal identifier used by the shader for this property; use this `Reference` instead of the display `Name` when accessing the property from a script.

If you overwrite this parameter, be aware of the following:
  • If the string doesn't begin with an underscore, Unity automatically adds one.
  • If the string contains any characters that HLSL does not support, Unity removes them.
  • You can revert to the default value: right-click on the **Reference** field label, and select **Reset Reference**.
| +| **Promote to final Shader** | Makes the property accessible across the final shader as a material property, not as an input port on the Subgraph Node. | +| **Precision** | Sets the numeric precision for the property’s data type.

The options are:
  • **Inherit**: Uses the precision defined by the graph or parent context.
  • **Single**: Uses single-precision (float) for maximum accuracy.
  • **Half**: Uses half-precision to reduce memory and improve performance.
  • **Use Graph Precision**: Uses the precision mode set in the graph settings.

For more details, refer to [Precision Modes](Precision-Modes.md). | +| **Scope** | Specifies where and how the property is edited across materials. The options are:
  • **Global**: Makes the property editable at a global level, through a C# script only, for all materials that use it. Selecting this option hides or grays out all parameters that relate to the Inspector UI display.
  • **Per Material**: Makes the property independently editable per material, either through a C# script, or in the Inspector UI if you enable **Show In Inspector**.
  • **Hybrid Per Instance**: Has the same effect as **Per Material**, unless you're using [DOTS instancing](https://docs.unity3d.com/Packages/com.unity.entities.graphics@latest/index.html?subfolder=/manual/dots-instancing-shader.html).
| +| **Default Value** | Sets the property's initial value to be serialized and used when new material instances are created. The value depends on the property type. | +| **Preview Value** | Sets a value to use for preview in the Shader Graph window, only when you set **Scope** to **Global**. | +| **Show In Inspector** | Displays the property in the material Inspector when enabled.
If you disable this option, it includes an `[HideInInspector]` attribute to the material property (refer to [Properties block reference in ShaderLab](https://docs.unity3d.com/Manual/SL-Properties.html#material-property-attributes) for more details). | +| **Read Only** | Marks the property as non-editable in the material Inspector by adding the [`PerRendererData`](https://docs.unity3d.com/ScriptReference/Rendering.ShaderPropertyFlags.html) attribute. | +| **Custom Attributes** | Enables attachment of custom scripted drawers or decorators to extend the material property UI, such as adding static headers or complex controls.
The **Custom Material Property Drawers** sample, available in the Package Manager among other [Shader Graph samples](ShaderGraph-Samples.md), shows how to display a Vector2 as a min/max slider, for example.

**Note**: When you declare the custom functions in the script, make sure to suffix their names with `Drawer` or `Decorator`.

In the list, use **+** or **-** to add or remove entries. Each entry corresponds to a function call which requires the following parameters:
  • **Name**: A shorthened version of the function name, without its `Drawer` or `Decorator` suffix.
  • **Value**: The input values for the function as the script expects them.
**Note**: A property can only have one drawer at any given time. | +| **Use Custom Binding** | Turns the property into a bound input port for connection to the [**Branch On Input Connection**](Branch-On-Input-Connection-Node.md) node. In the **Label** field, enter the label for the default value that displays on your Subgraph node's port binding in its parent Shader Graph.
This property is available only in sub graphs. | ## Float @@ -28,8 +32,9 @@ Parameters specific to Float properties in addition to the [common parameters](# | Parameter | Description | | :--- | :--- | -| **Mode** | Select the UI mode in which you want to display the Property and manipulate its value in the material inspector. You need to define a specific subset of parameters according to the option you select.

The options are:
  • **Default**: Displays a scalar input field in the material inspector. Only requires a **Default Value**.
  • **Slider**: Defines the Float property in [`Range`](https://docs.unity3d.com/Manual/SL-Properties.html#material-property-declaration-syntax-by-type) mode to display a slider field in the material inspector. Use [additional parameters](#slider) to define the slider type.
  • **Integer**: Displays an integer input field in the material inspector. Only requires a **Default Value**.
  • **Enum**: Adds an [`Enum`](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html) attribute to the Float property to display a drop-down with a list of specific values in the material inspector. Use [additional parameters](#enum) to define the enum type.
| -| **Default Value** | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
The value might be either a float or an integer according to the **Mode** and options you select. | +| **Mode** | Selects the UI mode used to display and edit the property value in the material Inspector, requiring a specific subset of parameters depending on the chosen option.

The options are:
  • **Default**: Displays a scalar input field in the material Inspector; only requires a **Default Value**.
  • **Slider**: Defines the Float property in [`Range`](https://docs.unity3d.com/Manual/SL-Properties.html#material-property-declaration-syntax-by-type) mode to display a slider; use [additional parameters](#slider) to define the slider type.
  • **Integer**: Displays an integer input field in the material Inspector; only requires a **Default Value**.
  • **Enum**: Adds an [`Enum`](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html) attribute to the Float property to display a drop-down of specific values; use [additional parameters](#enum) to define the enum type.
| +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
The value is either a float or an integer depending on the selected **Mode** and its options. Not available when **Scope** is set to **Global**. | +| **Requires Literal Input** | Requires the input to be a constant value. When enabled, if the user connects a variable, the shader compilation fails with an error. | ### Slider @@ -37,10 +42,10 @@ Additional parameters available when you set the Float property **Mode** to **Sl | Parameter | Description | | :--- | :--- | -| **Slider Type** | Select the slider response type to apply when you move the slider to change the value in the material inspector.

The options are:
  • **Default**: Displays a slider with a linear response. The value responds linearly within the slider range.
  • **Power**: Adds a [`PowerSlider`](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html) attribute to the Float property to display a slider with a non-linear response. The value responds exponentially within the slider range according to the specified **Power** value.
  • **Integer**: Adds an [`IntRange`](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html) attribute to the Float property to display a slider with an integer value response. The value responds in integer steps within the slider range.
| -| **Min** | The minimum value of the slider range. | -| **Max** | The maximum value of the slider range. | -| **Power** | The exponent to use for non-linear response between **Min** and **Max** when you set the **Slider Type** to **Power**. | +| **Slider Type** | Selects the slider response type applied when adjusting the value in the material Inspector.

The options are:
  • **Default**: Displays a slider with a linear response; the value changes linearly within the slider range.
  • **Power**: Adds a [`PowerSlider`](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html) attribute to display a slider with a non-linear response; the value changes exponentially within the range according to the specified **Power**.
  • **Integer**: Adds an [`IntRange`](https://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html) attribute to display a slider with integer steps; the value changes in whole-number increments within the range.
| +| **Min** | Sets the minimum value of the slider range. | +| **Max** | Sets the maximum value of the slider range. | +| **Power** | Defines the exponent used for non-linear response between **Min** and **Max** when **Slider Type** is set to **Power**. | ### Enum @@ -48,166 +53,163 @@ Additional parameters available when you set the Float property **Mode** to **En | Parameter | Description | | :--- | :--- | -| **Enum Type** | Select the source type to use for the dropdown entries in the material inspector.

The options are:
  • **Explicit Values**: Use a list of **Entries** you directly specify in this interface.
  • **Type Reference**: Use a **C# Enum Type** reference that contains predefined entries.
| -| **Entries** | The list of dropdown entries to define when you set **Enum Type** to **Explicit Values**.

Use **+** or **-** to add or remove entries. You have to define each entry with the following parameters:
  • **Name**: The entry name to display in the dropdown in the material inspector.
  • **Value**: The value to apply to the Float property when you select its **Name** in the dropdown in the material inspector.
**Note**: The **Entries** option allows you to define up to 7 entries. If you need a dropdown with more entries, use the **Type Reference** option. | -| **C# Enum Type** | The existing Enum Type reference to use when you set **Enum Type** to **Type Reference**.
Specify the full path of the type with the namespace. For example, to get Unity's predefined blend mode values: `UnityEngine.Rendering.BlendMode`. | +| **Enum Type** | Selects the source used to populate the dropdown entries in the material Inspector.

The options are:
  • **Explicit Values**: Uses a list of **Entries** you specify directly in this interface.
  • **Type Reference**: Uses a **C# Enum Type** reference that contains predefined entries.
| +| **Entries** | Defines the list of dropdown entries when **Enum Type** is set to **Explicit Values**.

Use **+** or **-** to add or remove entries. Each entry requires the following parameters:
  • **Name**: Sets the label displayed in the dropdown in the material Inspector.
  • **Value**: Sets the numeric value applied to the Float property when its **Name** is selected.
**Note**: Supports up to 7 entries. If you need more, use **Type Reference**. | +| **C# Enum Type** | Specifies the existing enum type to reference when **Enum Type** is set to **Type Reference**.
Enter the full type path with namespace, for example: `UnityEngine.Rendering.BlendMode`. | ## Vector 2 Defines a **Vector 2** value. Displays a **Vector 4** input field in the material inspector, where the z and w components are not used. -| Data Type | Modes | -|:-------------|:------| -| Vector 2 | | - -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Vector 2 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A 2D vector value (Vector2). | ## Vector 3 Defines a **Vector 3** value. Displays a **Vector 4** input field in the material inspector, where the w component is not used. -| Data Type | Modes | -|:-------------|:------| -| Vector 3 | | - -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Vector 3 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A 3D vector value (Vector3). | ## Vector 4 Defines a **Vector 4** value. Displays a **Vector 4** input field in the material inspector. -| Data Type | Modes | -|:-------------|:------| -| Vector 4 | | - -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Vector 4 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A 4D vector value (Vector4). | ## Color Defines a **Color** value. If the Property Inspector displays **Main Color**, this is the [Main Color](https://docs.unity3d.com/Manual/SL-Properties.html) for the shader. To select or deselect this node as the **Main Color**, right-click it in the graph or Blackboard and select **Set as Main Color** or **Clear Main Color**. Corresponds to the [`MainColor`](https://docs.unity3d.com/Manual/SL-Properties.html) ShaderLab Properties attribute. -| Data Type | Modes | -|:-------------|:------| -| Color | Default, HDR | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +| **Mode** | Selects the color input mode.

The options are:
  • **Default**: Allows to select a standard sRGB color.
  • **HDR**: Allows to select an HDR color and sets its intensity from -10 to 10 exposure stops.
| + +**Note:** In versions prior to 10.0, Shader Graph didn't correct HDR colors for the project colorspace. Version 10.0 corrected this behavior. HDR color properties that you created with older versions maintain the old behavior, but you can use the [Graph Inspector](Internal-Inspector.md) to upgrade them. To mimic the old behavior in a gamma space project, you can use the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to convert a new HDR **Color** property from **RGB** to **Linear** space. -#### Default +## Boolean + +Defines a **Boolean** value. Displays a **ToggleUI** field in the material inspector. Note that internally to the shader this value is a **Float**. The **Boolean** type in Shader Graph is merely for usability. -Displays an sRGB color field in the material inspector. +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A boolean value. | -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Vector 4 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +## Gradient -#### HDR +Defines a constant **Gradient**. -Displays an HDR color field in the material inspector. +Parameters specific to Gradient properties in addition to the [common parameters](#common-parameters): -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Vector 4 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Displays the **HDR Gradient Editor** with selectable modes.
The options are:
  • **Blend (Classic)**: Creates transitions based on traditional HDR handling.
  • **Blend (Perceptual)**: Creates human vision–based gradient transitions in HDR.
  • **Fixed**: Creates a discrete gradient with fixed steps.
| -NOTE: In versions prior to 10.0, Shader Graph didn't correct HDR colors for the project colorspace. Version 10.0 corrected this behavior. HDR color properties that you created with older versions maintain the old behavior, but you can use the [Graph Inspector](Internal-Inspector.md) to upgrade them. To mimic the old behavior in a gamma space project, you can use the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to convert a new HDR **Color** property from **RGB** to **Linear** space. +**Note:** The **Promote to final Shader** parameter is not available for this property. ## Texture 2D Defines a [Texture 2D](https://docs.unity3d.com/Manual/class-TextureImporter.html) value. Displays an object field of type [Texture](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the material inspector. If the Property Inspector displays **Main Texture**, this is the `Main Texture` for the shader. To select or deselect this node as the `Main Texture`, right-click on it in the graph or Blackboard and select **Set as Main Texture** or **Clear Main Texture**. Corresponds to the [`MainTexture`](https://docs.unity3d.com/Manual/SL-Properties.html) ShaderLab Properties attribute. -| Data Type | Modes | -|:-------------|:------| -| Texture | White, Black, Grey, Bump | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A texture asset reference. | +| **Mode** | Defines the fallback texture Unity uses when none is provided.

The options are:
  • **White**: Sets a solid white (1,1,1) texture to ensure full-intensity sampling.
  • **Black**: Sets a solid black (0,0,0) texture to yield zero contribution.
  • **Grey**: Sets a mid-grey in sRGB (~0.5) as a neutral fallback.
  • **Normal Map**: Sets a flat normal value to keep surfaces flat without a normal texture.
  • **Linear Grey**: Sets a mid-grey in linear color space.
  • **Red**: Sets a solid red (1,0,0) texture, useful for data expected in the red channel.
| +| **Use Tiling and Offset** | Toggles the property `NoScaleOffset` to enable manipulating scale and offset separately from other texture properties; see [SplitTextureTransformNode](Split-Texture-Transform-Node.md).
A boolean value. | +| **Use TexelSize** | Uses the size of texels expressed in UV space. | + +## Texture 2D Array + +Defines a [Texture 2D Array](https://docs.unity3d.com/Manual/class-TextureImporter.html) value. Displays an object field of type [Texture 2D Array](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the material inspector. -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Texture | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | -| Use Tiling and Offset | Boolean | When set to false, activates the property [NoScaleOffset](https://docs.unity3d.com/Manual/SL-Properties.html), to enable manipulation of scale and offset separately from other texture properties. See [SplitTextureTransformNode](Split-Texture-Transform-Node.md).| +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A texture asset reference. | ## Texture 3D Defines a [Texture 3D](https://docs.unity3d.com/Manual/class-TextureImporter.html) value. Displays an object field of type [Texture 3D](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the material inspector. -| Data Type | Modes | -|:-------------|:------| -| Texture | | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A texture asset reference. | -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Texture | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +## Cubemap -## Texture 2D Array +Defines a [Cubemap](https://docs.unity3d.com/Manual/class-Cubemap.html) value. Displays an object field of type [Texture](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the material inspector. -Defines a [Texture 2D Array](https://docs.unity3d.com/Manual/class-TextureImporter.html) value. Displays an object field of type [Texture 2D Array](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the material inspector. +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A cubemap asset reference. | -| Data Type | Modes | -|:-------------|:------| -| Texture | | + +## Virtual Texture -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Texture | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +Defines a [Texture Stack](https://docs.unity3d.com/2020.1/Documentation/Manual/svt-use-in-shader-graph.html), which appears as object fields of type [Texture](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the Material Inspector. The number of fields corresponds to the number of layers in the property. -## Cubemap +| Parameter | Description | +| :--- | :--- | +| **Layers** | Manages the collection of layers in the stack.

The options are:
  • **Add (+)**: Adds a new layer.
  • **Remove (−)**: Removes the selected layer.

Select the active layer to edit its parameters. | +| **Layer Name** | Displays the user-defined name for the selected layer. | +| **Layer Reference** | Defines the internal identifier used to reference the selected layer. | +| **Layer Texture** | Assigns the default texture asset for the selected layer. | +| **Layer Texture Type** | Specifies the expected data type for the selected layer’s texture, which determines import settings and sampling behavior, such as sRGB vs Linear and normal map decoding.

The options are:
  • **Normal tangent space**: Encodes per-texel normals relative to the mesh’s tangent basis so surface detail follows UVs and local orientation.
  • **Normal object space**: Preserves per-texel normals in object coordinates.
| -Defines a [Cubemap](https://docs.unity3d.com/Manual/class-Cubemap.html) value. Displays an object field of type [Texture](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the material inspector. +**Note:** The **Use Custom Binding** parameter isn't available for this property. -| Data Type | Modes | -|:-------------|:------| -| Cubemap | | +**Note:** The **Promote to final Shader** parameter is not available for this property. -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Cubemap | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +## Matrix 2 - -## Virtual Texture +Defines a Matrix 2. Matrices do not display in the **Inspector** window of the material. -Defines a [Texture Stack](https://docs.unity3d.com/2020.1/Documentation/Manual/svt-use-in-shader-graph.html), which appears as object fields of type [Texture](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the Material Inspector. The number of fields correspond to the number of layers in the property. +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A 2×2 matrix value (Matrix2). | -| Data Type | Modes | -|:----------|-------| -| Virtual Texture | | +## Matrix 3 -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Texture | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +Defines a Matrix 3 value. Can't be displayed in the material inspector. -## Boolean +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A 3×3 matrix value (Matrix3). | -Defines a **Boolean** value. Displays a **ToggleUI** field in the material inspector. Note that internally to the shader this value is a **Float**. The **Boolean** type in Shader Graph is merely for usability. +## Matrix 4 -| Data Type | Modes | -|:-------------|:------| -| Boolean | | +Defines a Matrix 4 value. Can't be displayed in the material inspector. -| Field | Type | Description | -|:-------------|:------|:------------| -| Default | Boolean | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Sets the initial value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html).
A 4×4 matrix value (Matrix4). | -## Matrix 2x2 +## SamplerState -Defines a Matrix 2. Matrices do not display in the **Inspector** window of the material. +Defines a **SamplerState**. -| Field | Type | -|:--------|:---------| -| Default | Matrix 2 | +Parameters specific to Float properties in addition to the [common parameters](#common-parameters): -## Matrix 3x3 +| Parameter | Description | +| :--- | :--- | +| **Filter** | Specifies the texture filtering mode used when sampling. The options are:
  • **Linear**: Sets bilinear filtering within mip levels for smoother results, at the cost of potential blur.
  • **Point**: Sets nearest-neighbor sampling for a crisp, pixelated look.
  • **Trilinear**: Sets bilinear filtering with interpolation between mip levels for smoother transitions.
| +| **Wrap** | Specifies how UVs outside the [0–1] range are handled. The options are:
  • **Repeat**: Tiles the texture infinitely.
  • **Clamp**: Clamps to edge texels with no tiling.
  • **Mirror**: Tiles by mirroring each repeat.
  • **MirrorOnce**: Mirrors once, then clamps.
| +| **Aniso** | Specifies the anisotropic filtering level to improve texture clarity at grazing angles. The options are:
  • **None**: Disables anisotropic filtering.
  • **x2**: Applies a low level for higher performance.
  • **x4**: Applies a moderate level.
  • **x8**: Applies a high level.
  • **x16**: Applies the maximum level for best quality at lower performance.
| -Defines a Matrix 3 value. Can't be displayed in the material inspector. +## Dropdown -| Field | Type | -|:--------|:---------| -| Default | Matrix 3 | +Defines a **Dropdown**. This property is available only in sub graphs. -## Matrix 4x4 +Parameters specific to Dropdown properties in addition to the [common parameters](#common-parameters): -Defines a Matrix 4 value. Can't be displayed in the material inspector. +| Parameter | Description | +| :--- | :--- | +| **Default Value** | Selects the default Entry that you want Shader Graph to select on your property. | +| **Entries** | Adds a corresponding input port to the node for each entry.

The options are:
  • **Add to the list (+)**: Adds a new option to your dropdown.
  • **Remove selection from the list (-)**: Removes the selected entry from the list.
| + +**Note:** The **Promote to final Shader** parameter is not available for this property. -| Field | Type | -|:--------|:---------| -| Default | Matrix 4 | diff --git a/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md index 143a0bbcb90..f43d5783719 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md @@ -1,20 +1,23 @@ -# Rounded Rectangle Node +# Rounded Rectangle node -## Description +The Rounded Rectangle node generates a filled rounded rectangle shape with a border around it. The output is 1 for the rectangle and 0 for the border. -Generates a rounded rectangle shape based on input **UV** at the size specified by inputs **Width** and **Height**. The radius of each corner is defined by input **Radius**. The generated shape can be offset or tiled by connecting a [Tiling And Offset Node](Tiling-And-Offset-Node.md). Note that in order to preserve the ability to offset the shape within the UV space the shape will not automatically repeat if tiled. To achieve a repeating rounded rectangle effect first connect your input through a [Fraction Node](Fraction-Node.md). +To move the rectangle within the space, do the following: -NOTE: This [Node](Node.md) can only be used in the **Fragment** [Shader Stage](Shader-Stage.md). +- To offset the shape, input a [Tiling And Offset node](Tiling-And-Offset-Node.md) and adjust the **Offset** property. +- To tile the shape, input a [Tiling and Offset node](Fraction-Node.md) into a [Fraction node](Tiling-And-Offset-Node.md), then input the Fraction node into the Rounded Rectangle node. + +You can only output this node into the Fragment Context. ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| UV | Input | Vector 2 | UV | Input UV value | -| Width | Input | Float | None | Rounded Rectangle width | -| Height | Input | Float | None | Rounded Rectangle height | -| Radius | Input | Float | None | Corner radius | -| Out | Output | Float | None | Output value | +| Name | Direction | Type | Binding | Description | +|-|-|-|-|-| +| **UV** | Input | Vector 2 | UV | Sets the UV coordinates to use to sample the rounded rectangle shape and the border. | +| **Width** | Input | Float | None | Sets how much horizontal space the rectangle fills, where 1 is a full-width rectangle without a border on the left and right. | +| **Height** | Input | Float | None | Sets how much vertical space the rectangle fills, where 1 is a full height rectangle without a border above and below. | +| **Radius** | Input | Float | None | Sets the roundness of the corners of the rectangle. The range is 0 to 1, where 0 is right-angled corners. | +| **Out** | Output | Float | None | The rounded rectangle and the border, where 1 is the rectangle and 0 is the border. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Asset.md b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Asset.md index 80417b2b67a..7a908788bcf 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Asset.md +++ b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Asset.md @@ -1,9 +1,36 @@ -# Shader Graph Asset +# Shader Graph Asset reference -## Description +A Shader Graph asset is a file that contains a graph you create and edit in the [**Shader Graph** window](Shader-Graph-Window.md). It is also a shader that you can select from a material's shader dropdown, as any other shader. -The **Shader Graph Asset** is the new **Asset** type introduced with the shader graph. You can create a **Shader Graph Asset** from the [Project Window](https://docs.unity3d.com/Manual/ProjectView.html) from the **Create** menu. +To access the properties of a Shader Graph asset in the **Inspector** window, select the asset in your project. -For convenience there is a **Create** menu entry for **Blank Shader Graph** and [Sub-graph](Sub-graph.md). They can be found in the **Shader** sub-menu. Additional options may be provided by render pipelines. These options will create a new Shader Graph with required settings and [Block]() nodes in the [Master Stack]() for the selected shading model. +## Action buttons -You can open the [Shader Graph Window](Shader-Graph-Window.md) by double clicking a **Shader Graph Asset** or by clicking **Open Shader Editor** in the [Inspector](https://docs.unity3d.com/Manual/UsingTheInspector.html) when the **Shader Graph Asset** is selected. +Manage Shader Graph assets code. + +| Property | Description | +|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Open Shader Editor** | Opens the selected asset in the [Shader Graph window](Shader-Graph-Window.md) so you can edit the graph. | +| **View Generated Shader** | Opens the shader code that the shader graph generates in a text editor or an IDE, such as Visual Studio. The code includes all possible passes and targets. | +| **Regenerate** | Updates the code you edited in your text editor or IDE. This button appears only when you select **View Generated Shader**. | +| **Copy Shader** | Copies the shader code to the clipboard. | + +## Properties + +Manage Shader Graph assets templates. + +| Property | Description | +|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Use As Template** | Marks the selected Shader Graph asset as a template. When enabled, the asset appears in the [Shader Graph template browser](template-browser.md), but is no longer listed in any material's **Shader** dropdown by default. | +| **Expose As Shader** | Keeps the asset listed in a material's **Shader** dropdown so you can still use it as a shader when you also use it as a template. This is available only when **Use As Template** is enabled. | +| **Name** | Sets the name of the template in the Shader Graph template browser. | +| **Category** | Sets the category of the template in the Shader Graph template browser. | +| **Description** | Sets the description of the template in the Shader Graph template browser. | +| **Icon** | Sets the icon that represents the template in the Shader Graph template browser. | +| **Thumbnail** | Sets the image that represents the template in the Shader Graph template browser. | + +## Additional resources + +* [Creating a new shader graph asset](Create-Shader-Graph.md) +* [Shader Graph Window](Shader-Graph-Window.md) +* [Shader Graph template browser](template-browser.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md index 02dbbad75cc..f5a678148d3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md +++ b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md @@ -7,12 +7,14 @@ Use the Shader Graph preferences to define shader graph settings for your system ## Settings -| Name | Description | -|:--------------------------|:----------------------------------------| -| **Preview Variant Limit** | Set the maximum number of variants allowed in local projects. This is a local version of the **Shader Variant Limit** in the project settings. If your graph exceeds this maximum value, Unity returns the following error:
_Validation: Graph is generating too many variants. Either delete Keywords, reduce Keyword variants or increase the **Shader Variant Limit** in Preferences > Shader Graph._
For more information about shader variants, refer to [Making multiple shader program variants](https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html). For more information about the Shader Variant Limit, refer to [Shader graph project settings](Shader-Graph-Project-Settings.md)| -| **Automatically Add and Remove Block Nodes** | Automatically add [Block nodes](Block-Node.md) to, or remove them from, the [Master Stack](Master-Stack.md) as needed. If you select this option, any [Block nodes](Block-Node.md) that your Shader graph needs are added to the [Master Stack](Master-Stack.md) automatically. Any incompatible [Block nodes](Block-Node.md) that have no incoming connections will be removed from the [Master Stack](Master-Stack.md). If you don't select this option, no [Block nodes](Block-Node.md) are added to, or removed from, the [Master Stack](Master-Stack.md) automatically. | -| **Enable Deprecated Nodes** | Disable warnings for deprecated nodes and properties. If you select this option, Shader Graph doesn't display warnings if your graph contains deprecated nodes or properties. If you don't select this option, Shader Graph displays warnings for deprecated nodes and properties, and any new nodes and properties you create use the latest version. | -| **Zoom Step Size** | Control how much the camera in Shader Graph zooms each time you roll the mouse wheel. This makes it easier to control the difference in zoom speed between the touchpad and mouse. A touchpad simulates hundreds of steps, which causes very fast zooms, whereas a mouse wheel steps once with each click. | +| Name | Description | +|:---------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Preview Variant Limit** | Sets the maximum number of variants allowed in local projects. This is a local version of the **Shader Variant Limit** in the project settings. If your graph exceeds this maximum value, Unity returns the following error:
_Validation: Graph is generating too many variants. Either delete Keywords, reduce Keyword variants, or increase the **Shader Variant Limit** in Preferences > Shader Graph._
For more information about shader variants, refer to [Making multiple shader program variants](https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html). For more information about the Shader Variant Limit, refer to [Shader graph project settings](Shader-Graph-Project-Settings.md) | +| **Automatically Add and Remove Block Nodes** | Adds to the [Master Stack](Master-Stack.md) any needed [Block nodes](Block-Node.md) and removes from the [Master Stack](Master-Stack.md) any Block nodes with no incoming connections. | +| **Enable Deprecated Nodes** | Disables warnings for deprecated nodes and properties. When enabled, Shader Graph doesn't display warnings if your graph contains deprecated nodes or properties. When disabled, Shader Graph displays warnings for deprecated nodes and properties, and the new nodes and properties you create use the latest version. | +| **Zoom Step Size** | Adjusts how much the Shader Graph camera zooms with each mouse wheel movement. This helps balance zoom speed, since touchpads can zoom much faster than regular mouse wheels.
Only affects materials created automatically, such as when you make a new shader graph from a Decal Projector or Fullscreen Renderer Feature. | +| **Graph Template Workflow** | Sets whether Unity creates new materials as [material variants](https://docs.unity3d.com/Manual/materialvariant-concept.html) from the child asset of the shader graph asset, or as standalone materials. The options are:
  • **Material Variant**: Unity creates material variants from the child asset of the shader graph asset.
  • **Material**: Unity creates standalone materials.
| +| **Open new Shader Graphs automatically** | Makes Unity open the Shader Graph window immediately after you create a new shader graph asset. When disabled, Unity does not open the window, and you must open the graph manually. | ## Additional resources diff --git a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md index e771e131aa6..d49036d4740 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md +++ b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md @@ -1,14 +1,25 @@ # Shader Graph Window -## Description +The **Shader Graph Window** contains the workspace to edit your shader graphs. -The **Shader Graph Window** contains the workspace for creating shaders with the **Shader Graph** system. To open the **Shader Graph Window**, you must first create a [Shader Graph Asset](index.md). For more information, refer to the [Getting Started](Getting-Started.md) section. +To access the **Shader Graph Window**, you must first create a [Shader Graph Asset](index.md). If the Shader Graph window doesn't open automatically after you [create a new shader graph asset](create-shader-graph.md), you have to double-click on the created asset. -The **Shader Graph** window contains various individual elements such as the [Blackboard](Blackboard.md), [Graph Inspector](Internal-Inspector.md), and [Main Preview](Main-Preview.md). You can move these elements around inside the workspace. They automatically anchor to the nearest corner when scaling the **Shader Graph Window**. +## Shader Graph window layout + +![The Shader Graph window with its main elements labeled from A to F.](images/ShaderGraphWindow.png) + +| Label | Name | Description | +| :--- | :--- | :--- | +| **A** | [Toolbar](#toolbar) | A set of tools to manage the shader graph asset, display elements in the window, and more. | +| **B** | [Workspace](#workspace) | The area where you create your graph. | +| **C** | [Master Stack](Master-Stack.md) | The final connection that determines your shader output. It consists of two separate contexts: **Vertex** and **Fragment**. | +| **D** | [Main Preview](Main-Preview.md) | Previews the current shader output. Use this to rotate the object, and zoom in and out. You can also change the basic mesh on which the shader is previewed. | +| **E** | [Blackboard](Blackboard.md) | Contains all of the shader's properties and keywords in a single, collected view. Use the Blackboard to add, remove, rename, and reorder properties and keywords. | +| **F** | [Graph Inspector](Internal-Inspector.md) | Displays the properties of the currently selected component. Use this to modify properties, node options, and the graph settings. This window is hidden by default and only appears when something is selected that can be edited by the user. | ## Toolbar -The toolbar at the top of the **Shader Graph Window** contains the following commands. +Use the **Shader Graph Window** toolbar to manage the shader graph asset, display elements in the window, and more. | Icon | Item | Description | |:--------------------|:--------------------|:------------| @@ -25,42 +36,42 @@ The toolbar at the top of the **Shader Graph Window** contains the following com ## Workspace -The workspace is where you create [Node](Node.md) networks. +Use the **Shader Graph Window** workspace to create [Node](Node.md) networks and connect them to the **Master Stack**. + To navigate the workspace, do the following: - Press and hold the Alt key and drag with the left mouse button to pan. - Use the mouse scroll wheel to zoom in and out. You can hold the left mouse button and drag to select multiple [Nodes](Node.md) with a marquee. There are also various [shortcut keys](Keyboard-shortcuts.md) you can use for better workflow. +### Context Menu -## Context Menu - -Right-click within the workspace to open a context menu. However, if you right-click on an item within the workspace, such as a [Node](Node.md), the context menu for that item opens. The workspace context menu provides the following options. +Right-click in the workspace area, on a node, or on a selection of nodes to open a context menu. | Item | Description | |:-----------------------------|:------------| | **Create Node** | Opens the [Create Node Menu](Create-Node-Menu.md). | | **Create Sticky Note** | Creates a new [Sticky Note](Sticky-Notes.md) on the Graph. | -| **Collapse All Previews** | Collapses previews on all [Nodes](Node.md). | -| **Cut** | Removes the selected [Nodes](Node.md) from the graph and places them in the clipboard. | -| **Copy** | Copies the selected [Nodes](Node.md) to the clipboard. | -| **Paste** | Pastes the [Nodes](Node.md) from the clipboard. | -| **Delete** | Deletes the selected [Nodes](Node.md). | -| **Duplicate** | Duplicates the selected [Nodes](Node.md). | -| **Select / Unused Nodes** | Selects all nodes on the graph that are not contributing to the final shader output from the [Master Stack](Master-Stack.md). | -| **View / Collapse Ports** | Collapses unused ports on all selected [Nodes](Node.md). | -| **View / Expand Ports** | Expands unused ports on all selected [Nodes](Node.md). | -| **View / Collapse Previews** | Collapses previews on all selected [Nodes](Node.md). | -| **View / Expand Previews** | Expands previews on all selected [Nodes](Node.md). | -| **Precision / Inherit** | Sets the precision of all selected Nodes to Inherit. | -| **Precision / Float** | Sets the precision of all selected nodes to Float. | -| **Precision / Half** | Sets the precision of all selected nodes to Half. | +| **Collapse All Previews** | Collapses previews on all nodes. | +| **Cut** | Removes the selected nodes from the graph and places them in the clipboard. | +| **Copy** | Copies the selected nodes to the clipboard. | +| **Paste** | Pastes the nodes from the clipboard. | +| **Delete** | Deletes the selected nodes. | +| **Duplicate** | Duplicates the selected nodes. | +| **Select** > **Unused Nodes** | Selects all nodes on the graph that are not contributing to the final shader output from the [Master Stack](Master-Stack.md). | +| **View** > **Collapse Ports** | Collapses unused ports on all selected nodes. | +| **View** > **Expand Ports** | Expands unused ports on all selected nodes. | +| **View** > **Collapse Previews** | Collapses previews on all selected nodes. | +| **View** > **Expand Previews** | Expands previews on all selected nodes. | +| **Precision** > **Inherit** | Sets the precision of all selected nodes to Inherit. | +| **Precision** > **Float** | Sets the precision of all selected nodes to Float. | +| **Precision** > **Half** | Sets the precision of all selected nodes to Half. | ## Additional resources -- [Color Modes](Color-Modes.md) -- [Create Node Menu](Create-Node-Menu.md) -- [Keyboard shortcuts](Keyboard-shortcuts.md) -- [Master Stack](Master-Stack.md) -- [Nodes](Node.md) -- [Sticky Notes](Sticky-Notes.md) \ No newline at end of file +* [Color Modes](Color-Modes.md) +* [Create Node Menu](Create-Node-Menu.md) +* [Keyboard shortcuts](Keyboard-shortcuts.md) +* [Master Stack](Master-Stack.md) +* [Nodes](Node.md) +* [Sticky Notes](Sticky-Notes.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md index 59e48029acc..55cfcd1eef1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md +++ b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md @@ -4,18 +4,17 @@ * [Install Shader Graph](install-shader-graph.md) * [Upgrade to Shader Graph 10.0.x](Upgrade-Guide-10-0-x.md) * [Get started with Shader Graph](Getting-Started.md) - * [Creating a new Shader Graph Asset](Create-Shader-Graph.md) - * [My first Shader Graph](First-Shader-Graph.md) - * [Create a new shader graph from a template](create-shader-graph-template.md) + * [Create a shader graph asset](Create-Shader-Graph.md) + * [Add and connect nodes](Create-Node-Menu.md) + * [Create a shader graph and use it with a material](First-Shader-Graph.md) * [Shader Graph UI reference](ui-reference.md) * [Shader Graph template browser](template-browser.md) * [Shader Graph Window](Shader-Graph-Window.md) - * [Blackboard](Blackboard.md) + * [Master Stack](Master-Stack.md) * [Main Preview](Main-Preview.md) + * [Blackboard](Blackboard.md) * [Graph Inspector](Internal-Inspector.md) - * [Create Node Menu](Create-Node-Menu.md) - * [Graph Settings Tab](Graph-Settings-Tab.md) - * [Master Stack](Master-Stack.md) + * [Graph Settings Tab](Graph-Settings-Tab.md) * [Shader Graph Preferences](Shader-Graph-Preferences.md) * [Shader Graph Project Settings](Shader-Graph-Project-Settings.md) * [Shader Graph Keyboard Shortcuts](Keyboard-shortcuts.md) @@ -46,7 +45,9 @@ * [Port Bindings](Port-Bindings.md) * [Shader Stage](Shader-Stage.md) * [Surface options](surface-options.md) - * [Custom Interpolators](Custom-Interpolators.md) + * [Using Custom Interpolators](Custom-Interpolators-landing.md) + * [Custom Interpolators](Custom-Interpolators.md) + * [Custom Interpolator reference](Custom-Interpolators-reference.md) * [Node Library](Node-Library.md) * [Artistic](Artistic-Nodes.md) * Adjustment diff --git a/Packages/com.unity.shadergraph/Documentation~/Time-Node.md b/Packages/com.unity.shadergraph/Documentation~/Time-Node.md index 118a42b41af..a7f3155fbc4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Time-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Time-Node.md @@ -8,11 +8,11 @@ Provides access to various **Time** parameters in the shader. | Name | Direction | Type | Binding | Description | |:------------ |:-------------|:-----|:---|:---| -| Time | Output | Float | None | Time value | -| Sine Time | Output | Float | None | Sine of Time value | -| Cosine Time | Output | Float | None | Cosine of Time value | -| Delta Time | Output | Float | None | Current frame time | -| Smooth Delta | Output | Float | None | Current frame time smoothed | +| Time | Output | Float | None | Elapsed time in seconds. | +| Sine Time | Output | Float | None | Sine of the **Time** value. Output ranges from −1 to 1. | +| Cosine Time | Output | Float | None | Cosine of the **Time** value. Output ranges from −1 to 1. | +| Delta Time | Output | Float | None | The time that has elapsed between the current frame and the last frame, in seconds. | +| Smooth Delta | Output | Float | None | The time that has elapsed between the current frame and the last frame, in seconds, averaged over several frames to reduce jitter. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/create-shader-graph-template.md b/Packages/com.unity.shadergraph/Documentation~/create-shader-graph-template.md deleted file mode 100644 index 5e791693749..00000000000 --- a/Packages/com.unity.shadergraph/Documentation~/create-shader-graph-template.md +++ /dev/null @@ -1,20 +0,0 @@ -# Create a new shader graph from a template - -To create a new shader graph from a template, follow these steps: - -1. In the **Project** window, right-click and select **Create** > **Shader Graph** > **From Template**. - - The [template browser](template-browser.md) opens. - -1. Select the desired template and click **Create**. - - Unity creates a new shader graph asset in your project. - -1. Name the shader graph asset. - -You can now edit the graph in the [Shader Graph window](Shader-Graph-Window.md). - -## Additional resources - -* [Shader Graph template browser](template-browser.md) -* [Create a custom shader graph template](template-browser.md#create-a-custom-shader-graph-template) diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blackboard.png b/Packages/com.unity.shadergraph/Documentation~/images/Blackboard.png deleted file mode 100644 index d640d95c4bf..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blackboard.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Alpha-Clip-Threshold.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Alpha-Clip-Threshold.png deleted file mode 100644 index fc825b9dc18..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Alpha-Clip-Threshold.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Alpha.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Alpha.png deleted file mode 100644 index 439e5d27ee8..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Alpha.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Ambient-Occlusion.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Ambient-Occlusion.png deleted file mode 100644 index 8a9eead1029..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Ambient-Occlusion.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Base-Color.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Base-Color.png deleted file mode 100644 index ed2dff6d2cf..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Base-Color.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Emission.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Emission.png deleted file mode 100644 index 402ba4867e0..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Emission.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Metallic.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Metallic.png deleted file mode 100644 index 55ba5f8f670..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Metallic.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalOS.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalOS.png deleted file mode 100644 index 4033fefb73f..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalOS.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalTS.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalTS.png deleted file mode 100644 index 3347ae2d954..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalTS.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalWS.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalWS.png deleted file mode 100644 index 5b64475606d..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-NormalWS.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Smoothness.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Smoothness.png deleted file mode 100644 index d14faa9055c..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Smoothness.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Specular.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Specular.png deleted file mode 100644 index 4f56810aa7b..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Fragment-Specular.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Color.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Color.png deleted file mode 100644 index 027bf61ee2c..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Color.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Normal.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Normal.png deleted file mode 100644 index 215c5f69694..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Normal.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Position.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Position.png deleted file mode 100644 index 7804d5b24dc..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Position.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Tangent.png b/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Tangent.png deleted file mode 100644 index 50121c1808f..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Blocks-Vertex-Tangent.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/Inspector.png b/Packages/com.unity.shadergraph/Documentation~/images/Inspector.png deleted file mode 100644 index d84f421f3e1..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/Inspector.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MainPreview.png b/Packages/com.unity.shadergraph/Documentation~/images/MainPreview.png deleted file mode 100644 index 58aeed8c6d5..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MainPreview.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_01.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_01.png deleted file mode 100644 index 592e811dcc9..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_01.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_02.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_02.png deleted file mode 100644 index 04fc3b16446..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_02.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_03.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_03.png deleted file mode 100644 index db0ba8f5099..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_03.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_04.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_04.png deleted file mode 100644 index bf11c53a696..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_04.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_05.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_05.png deleted file mode 100644 index 4aa103b2bca..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_05.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_06.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_06.png deleted file mode 100644 index 02105363417..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_06.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_07.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_07.png deleted file mode 100644 index ebe636f976e..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_07.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_08.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_08.png deleted file mode 100644 index b3029961798..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_08.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_09.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_09.png deleted file mode 100644 index 6b595db6f84..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_09.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_10.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_10.png deleted file mode 100644 index 4a5591fd796..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_10.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_11.png b/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_11.png deleted file mode 100644 index 720ce333461..00000000000 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/MyFirstShaderGraph_11.png and /dev/null differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/ShaderGraphWindow.png b/Packages/com.unity.shadergraph/Documentation~/images/ShaderGraphWindow.png index 2f1479a1849..c505be42269 100644 Binary files a/Packages/com.unity.shadergraph/Documentation~/images/ShaderGraphWindow.png and b/Packages/com.unity.shadergraph/Documentation~/images/ShaderGraphWindow.png differ diff --git a/Packages/com.unity.shadergraph/Documentation~/ui-reference.md b/Packages/com.unity.shadergraph/Documentation~/ui-reference.md index 4abf26114eb..00e36e1dac8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/ui-reference.md +++ b/Packages/com.unity.shadergraph/Documentation~/ui-reference.md @@ -5,14 +5,11 @@ Explore the main user interface elements you need to know to create and configur | Topic | Description | | :--- | :--- | | [Shader Graph template browser](template-browser.md) | Browse the list of available templates to create your shader graphs from. | -| [Shader Graph Window](Shader-Graph-Window.md) | Display and edit your shader graph assets in Unity, including the Blackboard, the Main Preview, and the Graph Inspector. | -| [Create Node Menu](Create-Node-Menu.md) | Create nodes in your graph and create block nodes in the Master Stack. | -| [Graph Settings Tab](Graph-Settings-Tab.md) | Change settings that affect your shader graph as a whole. | -| [Master Stack](Master-Stack.md) | Explore the end point of a shader graph, which defines the final surface appearance of a shader. | +| [Shader Graph Window](Shader-Graph-Window.md) | Display and edit your shader graph assets in Unity, including the [Master Stack](Master-Stack.md), the [Main Preview](Main-Preview.md), the [Blackboard](Blackboard.md), and the [Graph Inspector](Internal-Inspector.md). | | [Shader Graph Preferences](Shader-Graph-Preferences.md) | Define shader graph settings for your system. | | [Shader Graph Project Settings](Shader-Graph-Project-Settings.md) | Define shader graph settings for your entire project. | | [Shader Graph Keyboard Shortcuts](Keyboard-shortcuts.md) | Use keyboard shortcuts to work more efficiently when you're using Shader Graph. | ## Additional resources -* [Node Library](Node-Library.md) \ No newline at end of file +* [Node Library](Node-Library.md) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs index 3537a87b587..97875671a97 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs @@ -209,7 +209,8 @@ internal void AddTextureInfo(List infos) name = layerRefName, textureId = texture != null ? texture.GetInstanceID() : 0, dimension = texture != null ? texture.dimension : UnityEngine.Rendering.TextureDimension.Any, - modifiable = true + modifiable = true, + generatePropertyBlock = generatePropertyBlock }; infos.Add(textureInfo); } diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs index 709bb00d708..2d8e4e4b3ef 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultBitmapTextNode.cs @@ -35,7 +35,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine("float4 {0} = float4(1, 1, 0, 1);", outputVarName); - sb.AppendLine("[branch] if (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeBitmapText)"); + sb.AppendLine("[branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeText && (!(GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0)))"); using (sb.BlockScope()) { bool hasTint = GetInputNodeFromSlot(k_InputSlotIdTint) != null; @@ -43,6 +43,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine("Unity_UIE_EvaluateBitmapNode_Input.tint = {0};", hasTint ? GetSlotValue(k_InputSlotIdTint, generationMode) : "IN.color"); sb.AppendLine("Unity_UIE_EvaluateBitmapNode_Input.textureSlot = IN.typeTexSettings.y;"); sb.AppendLine("Unity_UIE_EvaluateBitmapNode_Input.uv = IN.uvClip.xy;"); + sb.AppendLine("Unity_UIE_EvaluateBitmapNode_Input.opacity = IN.typeTexSettings.z;"); sb.AppendLine("CommonFragOutput Unity_UIE_EvaluateBitmapNode_Output = uie_std_frag_bitmap_text(Unity_UIE_EvaluateBitmapNode_Input);"); sb.AppendLine("{0}.rgb = Unity_UIE_EvaluateBitmapNode_Output.color.rgb;", outputVarName); // To correctly apply the opacity we have to multiply the alpha values by the input color's alpha if input color is not used as the tint diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs index b4665271ab9..8791c282b74 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/DefaultSDFTextNode.cs @@ -35,7 +35,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine("float4 {0} = float4(1, 1, 0, 1);", outputVarName); - sb.AppendLine("[branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeSdfText)"); + sb.AppendLine("[branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeText && (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0))"); using (sb.BlockScope()) { bool hasTint = GetInputNodeFromSlot(k_InputSlotIdTint) != null; diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs index 6c2cffbc114..4d35f17f2fb 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeBranchNode.cs @@ -95,45 +95,50 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.a;", outputVarNameAlpha); } } - sb.AppendLine("else [branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && TestType(IN.typeTexSettings.x, k_FragTypeSdfText))"); + sb.AppendLine("else [branch] if ((_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && TestType(IN.typeTexSettings.x, k_FragTypeText))"); using (sb.BlockScope()) { - if (GetInputNodeFromSlot(k_InputSlotIdSdfText) != null) + sb.AppendLine("[branch] if (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0)"); + using (sb.BlockScope()) { - sb.AppendLine("{0} = {1}.rgb;", outputVarNameColor, GetSlotValue(k_InputSlotIdSdfText, generationMode)); - sb.AppendLine("{0} = {1}.a;", outputVarNameAlpha, GetSlotValue(k_InputSlotIdSdfText, generationMode)); + if (GetInputNodeFromSlot(k_InputSlotIdSdfText) != null) + { + sb.AppendLine("{0} = {1}.rgb;", outputVarNameColor, GetSlotValue(k_InputSlotIdSdfText, generationMode)); + sb.AppendLine("{0} = {1}.a;", outputVarNameAlpha, GetSlotValue(k_InputSlotIdSdfText, generationMode)); + } + else + { + sb.AppendLine("SdfTextFragInput Unity_UIE_RenderTypeSwitchNode_SdfText_Input;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.tint = IN.color;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textureSlot = IN.typeTexSettings.y;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.uv = IN.uvClip.xy;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.extraDilate = IN.circle.x;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textCoreLoc = round(IN.textCoreLoc);"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.opacity = IN.typeTexSettings.z;"); + sb.AppendLine("CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_sdf_text(Unity_UIE_RenderTypeSwitchNode_SdfText_Input);"); + sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;", outputVarNameColor); + sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.a;", outputVarNameAlpha); + } } - else + sb.AppendLine("else"); + using (sb.BlockScope()) { - sb.AppendLine("SdfTextFragInput Unity_UIE_RenderTypeSwitchNode_SdfText_Input;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.tint = IN.color;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textureSlot = IN.typeTexSettings.y;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.uv = IN.uvClip.xy;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.extraDilate = IN.circle.x;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.textCoreLoc = round(IN.textCoreLoc);"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_SdfText_Input.opacity = IN.typeTexSettings.z;"); - sb.AppendLine("CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_sdf_text(Unity_UIE_RenderTypeSwitchNode_SdfText_Input);"); - sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;", outputVarNameColor); - sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.a;", outputVarNameAlpha); - } - } - sb.AppendLine("else [branch] if (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY && TestType(IN.typeTexSettings.x, k_FragTypeBitmapText))"); - using (sb.BlockScope()) - { - if (GetInputNodeFromSlot(k_InputSlotIdBitmapText) != null) - { - sb.AppendLine("{0} = {1}.rgb;", outputVarNameColor, GetSlotValue(k_InputSlotIdBitmapText, generationMode)); - sb.AppendLine("{0} = {1}.a;", outputVarNameAlpha, GetSlotValue(k_InputSlotIdBitmapText, generationMode)); - } - else - { - sb.AppendLine("BitmapTextFragInput Unity_UIE_RenderTypeSwitchNode_BitmapText_Input;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.tint = IN.color;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.textureSlot = IN.typeTexSettings.y;"); - sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.uv = IN.uvClip.xy;"); - sb.AppendLine("CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_bitmap_text(Unity_UIE_RenderTypeSwitchNode_BitmapText_Input);"); - sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;", outputVarNameColor); - sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.a;", outputVarNameAlpha); + if (GetInputNodeFromSlot(k_InputSlotIdBitmapText) != null) + { + sb.AppendLine("{0} = {1}.rgb;", outputVarNameColor, GetSlotValue(k_InputSlotIdBitmapText, generationMode)); + sb.AppendLine("{0} = {1}.a;", outputVarNameAlpha, GetSlotValue(k_InputSlotIdBitmapText, generationMode)); + } + else + { + sb.AppendLine("BitmapTextFragInput Unity_UIE_RenderTypeSwitchNode_BitmapText_Input;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.tint = IN.color;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.textureSlot = IN.typeTexSettings.y;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.uv = IN.uvClip.xy;"); + sb.AppendLine("Unity_UIE_RenderTypeSwitchNode_BitmapText_Input.opacity = IN.typeTexSettings.z;"); + sb.AppendLine("CommonFragOutput Unity_UIE_RenderTypeSwitchNode_Output = uie_std_frag_bitmap_text(Unity_UIE_RenderTypeSwitchNode_BitmapText_Input);"); + sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.rgb;", outputVarNameColor); + sb.AppendLine("{0} = Unity_UIE_RenderTypeSwitchNode_Output.color.a;", outputVarNameAlpha); + } } } sb.AppendLine("else"); // k_FragTypeSvgGradient diff --git a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs index 965f96a56b4..3aaed5f3bcf 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Nodes/UI/RenderTypeNode.cs @@ -41,8 +41,8 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo { sb.AppendLine("bool {0} = _UIE_RENDER_TYPE_SOLID || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSolid;", GetVariableNameForSlot(k_OutputSlotIdSolid)); sb.AppendLine("bool {0} = _UIE_RENDER_TYPE_TEXTURE || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeTexture;", GetVariableNameForSlot(k_OutputSlotIdTexture)); - sb.AppendLine("bool {0} = (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeSdfText;", GetVariableNameForSlot(k_OutputSlotIdSDFText)); - sb.AppendLine("bool {0} = (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeBitmapText;", GetVariableNameForSlot(k_OutputSlotIdBitmapText)); + sb.AppendLine("bool {0} = (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeText && (GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0);", GetVariableNameForSlot(k_OutputSlotIdSDFText)); + sb.AppendLine("bool {0} = (_UIE_RENDER_TYPE_TEXT || _UIE_RENDER_TYPE_ANY) && round(IN.typeTexSettings.x) == k_FragTypeText && (!(GetTextureInfo(IN.typeTexSettings.y).sdfScale > 0.0));", GetVariableNameForSlot(k_OutputSlotIdBitmapText)); sb.AppendLine("bool {0} = _UIE_RENDER_TYPE_GRADIENT || _UIE_RENDER_TYPE_ANY && round(IN.typeTexSettings.x) == k_FragTypeSvgGradient;", GetVariableNameForSlot(k_OutputSlotIdGradient)); } diff --git a/Packages/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs b/Packages/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs index c4b63e3be8f..d0a96c4089e 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs @@ -15,6 +15,7 @@ public struct TextureInfo public EntityId textureId; public TextureDimension dimension; public bool modifiable; + public bool generatePropertyBlock; } bool m_ReadOnly; @@ -268,7 +269,8 @@ public List GetConfiguredTextures() name = prop.referenceName, textureId = prop.value.texture != null ? prop.value.texture.GetEntityId() : EntityId.None, dimension = TextureDimension.Tex2D, - modifiable = prop.modifiable + modifiable = prop.modifiable, + generatePropertyBlock = prop.generatePropertyBlock }; result.Add(textureInfo); } @@ -283,7 +285,8 @@ public List GetConfiguredTextures() name = prop.referenceName, textureId = prop.value.textureArray != null ? prop.value.textureArray.GetEntityId() : EntityId.None, dimension = TextureDimension.Tex2DArray, - modifiable = prop.modifiable + modifiable = prop.modifiable, + generatePropertyBlock = prop.generatePropertyBlock }; result.Add(textureInfo); } @@ -298,7 +301,8 @@ public List GetConfiguredTextures() name = prop.referenceName, textureId = prop.value.texture != null ? prop.value.texture.GetEntityId() : EntityId.None, dimension = TextureDimension.Tex3D, - modifiable = prop.modifiable + modifiable = prop.modifiable, + generatePropertyBlock = prop.generatePropertyBlock }; result.Add(textureInfo); } @@ -313,7 +317,8 @@ public List GetConfiguredTextures() name = prop.referenceName, textureId = prop.value.cubemap != null ? prop.value.cubemap.GetEntityId() : EntityId.None, dimension = TextureDimension.Cube, - modifiable = prop.modifiable + modifiable = prop.modifiable, + generatePropertyBlock = prop.generatePropertyBlock }; result.Add(textureInfo); } diff --git a/Packages/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs b/Packages/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs index b5eb5949896..6f348d985cd 100644 --- a/Packages/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs +++ b/Packages/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs @@ -95,7 +95,7 @@ internal ConcretePrecision concretePrecision internal void SetTextureInfos(IList textures) { - m_TextureInfos = textures.Select(t => new TextureInfo(t.name, EditorUtility.EntityIdToObject(t.textureId) as Texture, t.dimension)).ToArray(); + m_TextureInfos = textures.Where(t => t.generatePropertyBlock).Select(t => new TextureInfo(t.name, EditorUtility.EntityIdToObject(t.textureId) as Texture, t.dimension)).ToArray(); } internal void SetOutputs(OutputMetadata[] outputs) diff --git a/Packages/com.unity.shadergraph/Editor/Importers/ShaderGraphTemplateHelper.cs b/Packages/com.unity.shadergraph/Editor/Importers/ShaderGraphTemplateHelper.cs index dcd8c508c17..0ad2212d83f 100644 --- a/Packages/com.unity.shadergraph/Editor/Importers/ShaderGraphTemplateHelper.cs +++ b/Packages/com.unity.shadergraph/Editor/Importers/ShaderGraphTemplateHelper.cs @@ -34,6 +34,8 @@ public string OpenSaveFileDialog() public GraphViewTemplateWindow.ISaveFileDialogHelper saveFileDialogHelper { get; set; } = new SaveFileDialog(); + public void RaiseImportSampleDependencies(PackageManager.PackageInfo packageInfo, PackageManager.UI.Sample sample) { } + public void RaiseTemplateUsed(GraphViewTemplateDescriptor usedTemplate) => ShaderGraphAnalytics.SendShaderGraphTemplateEvent(usedTemplate); diff --git a/Packages/com.unity.visualeffectgraph/Documentation~/Context-OutputSharedSettings.md b/Packages/com.unity.visualeffectgraph/Documentation~/Context-OutputSharedSettings.md index 103f1f468c5..922f4e8ac59 100644 --- a/Packages/com.unity.visualeffectgraph/Documentation~/Context-OutputSharedSettings.md +++ b/Packages/com.unity.visualeffectgraph/Documentation~/Context-OutputSharedSettings.md @@ -32,7 +32,7 @@ All outputs share these settings and property ports. In case of Shader Graph Out | **Indirect Draw** | Bool | **(Inspector)** Indicates whether the system only outputs alive particles as opposed to outputting all particles and culling dead ones in the vertex shader. Enable this setting to improve performance when the number of particles is not at the system capacity or there is a high number of vertices per particle (typically with mesh outputs).
Other settings can implicitly enable **Indirect Draw**. In this case, this setting is enabled, but not visible. The settings that can implicitly enable **Indirect Draw** are **Sort**, **Compute Culling**, and **Frustum Culling**. | | **Compute Culling** | Bool | **(Inspector)** Indicates whether the system culls particles that are not alive in a compute pass rather than in the vertex shader. Enable this to improve performance if you set the **alive** attribute in the output and have a high number of vertices per particle.
If you enable **Frustum Culling**, it implicitly enables **Indirect Draw** too. In this case, this setting is enabled, but not visible. | | **Frustum Culling** | Bool | **(Inspector)** Indicates whether to cull particles that are outside of the camera frustum in a compute pass. Enable this to improve the performance of large systems where a significant amount of particles can be out of the camera frustum.
Note that frustum culling can cause issues with shadow casting as the system does not take culled particles outside of the camera frustum into account during shadow passes. | -| **Enable Ray Tracing** **[HDRP]** | Bool | **(Inspector)** Indicates whether the particles are added to the Ray Tracing Acceleration Structure to be taken into account in Ray-traced effects. To be effective, the "Ray Tracing VFX" and "Visual Effects Ray Tracing" options must be enabled in the HDRP Global Settings and in the HDRP Asset respectively.
Experimental: This feature is currently experimental and is subject to change in later major versions. To use this feature, enable Experimental Operators/Blocks in the Visual Effects tab of your Project's Preferences. | +| **Enable Ray Tracing** **[HDRP]** | Bool | **(Inspector)** Indicates whether the particles are added to the Ray Tracing Acceleration Structure to be taken into account in Ray-traced effects. To be effective, the "Ray Tracing VFX" and "Visual Effects Ray Tracing" options must be enabled in the HDRP Global Settings and in the HDRP Asset respectively. This setting only appears on [Output Particle Primitive](https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@latest/index.html?subfolder=/manual/Context-OutputPrimitive.html) and [Output ShaderGraph Quad](https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@latest/index.html?subfolder=/manual/Context-OutputShaderGraphPlanarPrimitive.html).
Experimental: This feature is currently experimental and is subject to change in later major versions. To use this feature, enable Experimental Operators/Blocks in the Visual Effects tab of your Project's Preferences. | ## Context Properties diff --git a/Packages/com.unity.visualeffectgraph/Documentation~/TableOfContents.md b/Packages/com.unity.visualeffectgraph/Documentation~/TableOfContents.md index bb93a54f5ce..802734e35e1 100644 --- a/Packages/com.unity.visualeffectgraph/Documentation~/TableOfContents.md +++ b/Packages/com.unity.visualeffectgraph/Documentation~/TableOfContents.md @@ -58,10 +58,10 @@ * [Spawner Callbacks](SpawnerCallbacks.md) * [Realistic smoke lighting](six-way-lighting-landing.md) * [Realistic smoke lighting with six-way lighting](six-way-lighting.md) - * [Use tools to generate six-way lightmap textures](use-tools-generate-six-way-lightmap-textures.md) + * [Generate six-way lightmap textures for visual effects](use-tools-generate-six-way-lightmap-textures.md) * [Import six-way lightmap textures into unity](import-six-way-lightmap-textures-unity.md) - * [Create and configure a six-way lit particle system](create-configure-six-way-lit-particle-system.md) - * [Customize free six-way lighting lightmap textures](create-effects-with-six-way-lighting.md) + * [Create a six-way lit particle system in Visual Effect Graph](create-configure-six-way-lit-particle-system.md) + * [Customize existing six-way lightmap textures](create-effects-with-six-way-lighting.md) * [Six-way smoke lit reference](six-way-lighting-reference.md) * [Node Library](node-library.md) * [Context](Context.md) @@ -97,7 +97,7 @@ * [Collision Depth Buffer](Block-CollideWithDepthBuffer.md) * [Kill Shape](Block-KillShape.md) * [Trigger Shape](Block-TriggerShape.md) - * [Flipbook Player](Block-FlipbookPlayer.md) + * [Flipbook Player](Block-FlipbookPlayer.md) * [Force](Force.md) * [Attractor Shape Signed Distance Field](Block-ConformToSignedDistanceField.md) * [Attractor Shape Sphere](Block-ConformToSphere.md) diff --git a/Packages/com.unity.visualeffectgraph/Documentation~/sg-working-with.md b/Packages/com.unity.visualeffectgraph/Documentation~/sg-working-with.md index 897f48c345f..e1b719d9fd1 100644 --- a/Packages/com.unity.visualeffectgraph/Documentation~/sg-working-with.md +++ b/Packages/com.unity.visualeffectgraph/Documentation~/sg-working-with.md @@ -94,7 +94,7 @@ Shader Graph does not support some features in specific Targets. - [Fog Volume Shader Graph](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/fog-volume-master-stack-reference.html) - [Motion vectors](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/Motion-Vectors.html) for vertex animation. - The URP does not support the following: - - [Decal Shader Graph](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest?subfolder=/manual/decal-shader.html. + - [Decal Shader Graph](https://docs.unity3d.com/Documentation/Manual/urp/prebuilt-shader-graphs-urp-decal.html) - The Visual Effect Target (deprecated) does not support: - HDRP or Universal material types. - Access to the shader's Vertex stage. diff --git a/Packages/com.unity.visualeffectgraph/Documentation~/six-way-lighting-landing.md b/Packages/com.unity.visualeffectgraph/Documentation~/six-way-lighting-landing.md index 99e733cb2d4..9cba768bb52 100644 --- a/Packages/com.unity.visualeffectgraph/Documentation~/six-way-lighting-landing.md +++ b/Packages/com.unity.visualeffectgraph/Documentation~/six-way-lighting-landing.md @@ -5,10 +5,11 @@ Implement custom lighting models to have more control over the visual style of s | Page | Description | |-------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------| | [Realistic smoke lighting with six-way lighting]( six-way-lighting.md) | Learn how and why to use six-way lighting in Unity to illuminate smoke. | -| [Use tools to generate six-way lightmap textures](use-tools-generate-six-way-lightmap-textures.md) | Learn how to create six-way lightmap textures in your preferred VFX tool for use in Unity. | +| [Generate six-way lightmap textures for visual effects](use-tools-generate-six-way-lightmap-textures.md) | Learn how to create six-way lightmap textures in your preferred VFX tool for use in Unity. | | [Import six-way lightmap textures into Unity](import-six-way-lightmap-textures-unity.md) | Learn how to import and configure six-way lightmap textures for use in Visual Effect Graph. | -| [Create and configure a six-way lit particle system](create-configure-six-way-lit-particle-system.md) | Learn how to achieve enhanced realism for smoke or explosion effects. | -| [Customize free six-way lighting lightmap textures](create-effects-with-six-way-lighting.md) | Learn how to generate high-quality smoke or dust effects with free lightmap textures. | +| [Create a six-way lit particle system in Visual Effect Graph](create-configure-six-way-lit-particle-system.md) | Learn how to achieve enhanced realism for smoke or explosion effects. | +| [Customize existing six-way lightmap textures](create-effects-with-six-way-lighting.md) | Learn how to generate high-quality smoke or dust effects with free lightmap textures. | +| [Six-way smoke lit reference](six-way-lighting-reference.md) | Explore the properties of the **Smoke Shader UI**.| ## Additional resources diff --git a/Packages/com.unity.visualeffectgraph/Editor/Data/VFXData.cs b/Packages/com.unity.visualeffectgraph/Editor/Data/VFXData.cs index 9ebc74a6936..d59cff00059 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Data/VFXData.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Data/VFXData.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Text; using UnityEngine; -using UnityEditor.VFX; using UnityEngine.VFX; namespace UnityEditor.VFX @@ -74,6 +73,9 @@ public static VFXData CreateDataType(VFXDataType type) } } + public static bool IsCompatible(VFXDataType fromType, VFXDataType toType) => (fromType & toType) != 0; + public static bool CanConvert(VFXDataType fromType, VFXDataType toType) => (fromType & toType) == toType; + public override void OnEnable() { base.OnEnable(); diff --git a/Packages/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs b/Packages/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs index cd431b56def..7ad48051466 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs @@ -749,6 +749,7 @@ VisualElement SetSystemInfosTitle() { var toggleAll = new Toggle(); toggleAll.value = true; + toggleAll.tooltip = "Show/Hide all particle system curves"; toggleAll.RegisterValueChangedCallback(ToggleAll); var SystemInfoName = new TextElement(); @@ -786,13 +787,14 @@ void AddSystemInfoEntry(string systemName, int id, Color color) m_SystemInfosContainer.Add(statContainer); var toggle = new Toggle(); + toggle.tooltip = "Show/Hide particle system curve"; toggle.value = true; var name = new Button(); name.name = "debug-system-stat-entry-name"; name.text = systemName; + name.tooltip = "Click to frame on the particle system"; name.style.color = color; - name.style.backgroundColor = new Color(0.16f, 0.16f, 0.16f); name.clickable.clicked += FocusParticleSystem(systemName); var alive = new TextElement(); diff --git a/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXFilterWindow.cs b/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXFilterWindow.cs index 3a20442301c..ae59a71cf0b 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXFilterWindow.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXFilterWindow.cs @@ -1020,7 +1020,9 @@ private float GetTextMatchScore(string text, ref string pattern, string[] patter matchHighlight = text; foreach (var match in s_PatternMatches) { - matchHighlight = matchHighlight.Replace(match, $"#@{match}#", StringComparison.OrdinalIgnoreCase); + int index = matchHighlight.IndexOf(match, StringComparison.InvariantCultureIgnoreCase); + matchHighlight = matchHighlight.Insert(index, "#@"); + matchHighlight = matchHighlight.Insert(index + 2 + match.Length, "#"); } return score / text.Length; diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboard.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboard.cs index a40a35d9431..a325de77c99 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboard.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboard.cs @@ -147,6 +147,7 @@ enum ViewMode const string PropertiesCategoryTitle = "Properties"; const string BuiltInAttributesCategoryTitle = "Built-in Attributes"; const string AttributesCategoryTitle = "Attributes"; + const uint MaximumAttemptsToScrollToSelection = 10; static readonly Rect defaultRect = new Rect(100, 100, 300, 500); static System.Reflection.PropertyInfo s_LayoutManual = typeof(VisualElement).GetProperty("isLayoutManual", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); @@ -1393,17 +1394,10 @@ public void Update(bool force = false) m_Treeview.RefreshItems(); UpdateSubtitle(); SynchronizeExpandState(); - if (m_pendingSelectionItems.Count > 0) + if (m_Treeview.selectedItem != null) { - var lastItemToSelect = m_ParametersController.SelectMany(GetDataRecursive).LastOrDefault(x => m_pendingSelectionItems.Contains(x.data.title)); - if (lastItemToSelect.data != null) - { - m_Treeview.ScrollToItemById(lastItemToSelect.id); - } - else - { - m_pendingSelectionItems.Clear(); - } + EditorApplication.delayCall += () => ScrollToSelection(); + m_pendingSelectionItems.Clear(); } } finally @@ -1412,6 +1406,30 @@ public void Update(bool force = false) } } + /// + /// Scroll to selection and check on next frame if it has properly scrolled. + /// If not try again, but there's a maximum retry attempts to avoid infinite loop + /// + private void ScrollToSelection(uint iteration = 0) + { + if (iteration >= MaximumAttemptsToScrollToSelection) + return; + + m_Treeview.ScrollToItem(m_Treeview.selectedIndex); + EditorApplication.delayCall += () => + { + var element = m_Treeview.GetRootElementForIndex(m_Treeview.selectedIndex); + if (element == null) + { + ScrollToSelection(iteration + 1); + } + else if (!m_Treeview.Q().worldBound.Overlaps(element.worldBound)) + { + ScrollToSelection(iteration + 1); + } + }; + } + private int SortCategory(string category, List parameters) { switch (category) diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs index 3fcdf939e3f..472a0736018 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs @@ -289,6 +289,7 @@ public void SelfChange(int change) } else { + TryUnregisterSubproperties(false); m_Property = null; m_ExposedProperty = null; m_SubProperties = null; @@ -313,15 +314,7 @@ public void SelfChange(int change) private void RecreateSubproperties(ref int insertIndex) { - if (m_SubProperties != null) - { - foreach (var subProperty in m_SubProperties) - { - (subProperty.provider as Controller).UnregisterHandler(this); - subProperty.RemoveFromHierarchy(); - } - } - else + if (!TryUnregisterSubproperties(true)) { m_SubProperties = new List(); } @@ -333,6 +326,23 @@ private void RecreateSubproperties(ref int insertIndex) } } + bool TryUnregisterSubproperties(bool removeFromHierarchy) + { + if (m_SubProperties != null) + { + foreach (var subProperty in m_SubProperties) + { + (subProperty.provider as Controller).UnregisterHandler(this); + if (removeFromHierarchy) + subProperty.RemoveFromHierarchy(); + } + + return true; + } + + return false; + } + void OnAttachToPanel(AttachToPanelEvent e) { RegisterCallback(OnGeometryChanged); diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D.meta b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D.meta deleted file mode 100644 index de6720abc28..00000000000 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 0066c6c7d0c4b3e46882bbc8b1b263d1 -folderAsset: yes -timeCreated: 1503589466 -licenseType: Pro -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Preview3D.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Preview3D.cs deleted file mode 100644 index 5f913f97311..00000000000 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Preview3D.cs +++ /dev/null @@ -1,67 +0,0 @@ -#if false -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; -using UnityEngine.UIElements; -using UnityEditor.UIElements; -using UnityEditor.Experimental.GraphView; - -namespace UnityEditor.VFX.UI -{ - /* class Preview3DController : SimpleElementPresenter - { - public Preview3DController() - { - title = "3D Preview"; - - position = new Rect(100, 100, 300, 300); - } - - public new void OnEnable() - { - base.OnEnable(); - capabilities |= Capabilities.Movable | Capabilities.Resizable; - } - }*/ - class Preview3D : GraphElement - { - Label m_Label; - Element3D m_Element; - - - public Preview3D() - { - style.flexDirection = FlexDirection.Column; - style.alignItems = Align.Stretch; - - m_Label = new Label(); - Add(m_Label); - - - m_Element = new Element3D(); - Add(m_Element); - - m_Element.style.flex = 1; - - - style.width = style.height = 300; - - - m_Element.AddManipulator(new Rotate3DManipulator(m_Element)); - } - - /* - public void OnDataChanged() - { - base.OnDataChanged(); - - Preview3DController controller = GetPresenter(); - - m_Label.text = controller.title; - } - */ - } -} -#endif diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Rotate3DManipulator.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Rotate3DManipulator.cs deleted file mode 100644 index b9266471ed7..00000000000 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Rotate3DManipulator.cs +++ /dev/null @@ -1,86 +0,0 @@ -#if false -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; -using UnityEngine.UIElements; -using UnityEditor; - -namespace UnityEditor.VFX.UI -{ - class Rotate3DManipulator : Manipulator - { - public Rotate3DManipulator(Element3D element3D) - { - m_Element3D = element3D; - } - - Element3D m_Element3D; - - protected override void RegisterCallbacksOnTarget() - { - target.RegisterCallback(OnMouseUp, Capture.Capture); - target.RegisterCallback(OnMouseDown, Capture.Capture); - //target.RegisterCallback(OnKeyDown); - } - - protected override void UnregisterCallbacksFromTarget() - { - target.UnregisterCallback(OnMouseUp); - target.UnregisterCallback(OnMouseDown); - //target.UnregisterCallback(OnKeyDown); - } - - void Release() - { - if (m_Dragging) - { - m_Dragging = false; - if (target.HasMouseCapture()) - target.ReleaseMouseCapture(); - EditorGUIUtility.SetWantsMouseJumping(0); - - target.UnregisterCallback(OnMouseMove); - } - } - - bool m_Dragging; - - void OnMouseDown(MouseDownEvent e) - { - m_Dragging = true; - EditorGUIUtility.SetWantsMouseJumping(1); - target.TakeMouseCapture(); - target.RegisterCallback(OnMouseMove, Capture.Capture); - m_Dragging = true; - e.StopPropagation(); - } - - void OnMouseUp(MouseUpEvent e) - { - Release(); - e.StopPropagation(); - } - - void OnMouseMove(MouseMoveEvent e) - { - if (m_Dragging) - { - if (!target.HasMouseCapture()) - { - Release(); - return; - } - Quaternion rotation = m_Element3D.rotation; - rotation = Quaternion.AngleAxis(e.mouseDelta.y * .003f * Mathf.Rad2Deg, rotation * Vector3.right) * rotation; - rotation = Quaternion.AngleAxis(e.mouseDelta.x * .003f * Mathf.Rad2Deg, Vector3.up) * rotation; - - m_Element3D.rotation = rotation; - e.StopPropagation(); - } - } - } -} - -#endif diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Rotate3DManipulator.cs.meta b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Rotate3DManipulator.cs.meta deleted file mode 100644 index cc5026fa3d9..00000000000 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/3D/Rotate3DManipulator.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 188a0d48fcc58b44fbcd0e78baaee4f7 -timeCreated: 1503589466 -licenseType: Pro -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs index 3e2607c7000..62e203dbafd 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs @@ -77,7 +77,7 @@ public static VFXViewWindow GetWindow(VFXGraph vfxGraph, bool createIfNeeded = f public static VFXViewWindow GetWindow(VisualEffectResource resource, bool createIfNeeded = false, bool show = true) { - return GetWindowLambda(x => x.graphView?.controller?.graph.visualEffectResource == resource, createIfNeeded, show); + return GetWindowLambda(x => x.displayedResource == resource, createIfNeeded, show); } public static VFXViewWindow GetWindow(VFXParameter vfxParameter, bool createIfNeeded = false) diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs index cac8e3f7550..722db581de8 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs @@ -1557,6 +1557,9 @@ public void ForceReload() Clear(); ModelChanged(model); GraphChanged(); + + var window = VFXViewWindow.GetWindow(this.graph, false, false); + window?.graphView?.blackboard.Update(true); } bool m_Syncing; @@ -1749,6 +1752,15 @@ public void SetCategoryExpanded(string categoryName, bool expanded) } } + private void ReorderParameters() + { + var index = 0; + foreach (var parameter in m_ParameterControllers.OrderBy(x => x.Value.order)) + { + parameter.Value.order = index++; + } + } + private void AddControllersFromModel(VFXModel model) { List newControllers = new List(); @@ -1815,7 +1827,8 @@ private void AddControllersFromModel(VFXModel model) parameter.ValidateNodes(); - m_ParameterControllers[parameter] = new VFXParameterController(parameter, this); + var newParameterController = new VFXParameterController(parameter, this) { order = m_ParameterControllers.Count }; + m_ParameterControllers[parameter] = newParameterController; m_SyncedModels[model] = new List(); } @@ -1856,10 +1869,11 @@ private void RemoveControllersFromModel(VFXModel model) } m_SyncedModels.Remove(model); } - if (model is VFXParameter) + if (model is VFXParameter parameter) { - m_ParameterControllers[model as VFXParameter].OnDisable(); - m_ParameterControllers.Remove(model as VFXParameter); + m_ParameterControllers[parameter].OnDisable(); + m_ParameterControllers.Remove(parameter); + ReorderParameters(); } } @@ -1919,7 +1933,7 @@ VFXUI.GroupInfo PrivateAddGroupNode(Vector2 position) else ui.groupInfos = new VFXUI.GroupInfo[] { newGroupInfo }; - return ui.groupInfos.Last(); + return newGroupInfo; } public void GroupNodes(VFXNodeController[] nodes) => GroupNodes(nodes, Array.Empty()); @@ -1929,13 +1943,14 @@ public void GroupNodes(VFXNodeController[] nodes, VFXStickyNoteController[] stic // If a node from the selection already belongs to a group, remove it from this group foreach (var g in groupNodes.ToArray()) { + if (g.nodes.Count() == 0) + continue; g.RemoveNodes(nodes); g.RemoveStickyNotes(stickyNoteControllers); if (g.nodes.Count() == 0) { RemoveGroupNode(g); } - } // Use a node or a sticky note position when possible to avoid the group to go back to (0,0) when emptied @@ -2042,41 +2057,11 @@ public void UpdateSystems() systemController.OnDisable(); } + graph.SyncContextLetters(); for (int i = 0; i < systems.Count(); ++i) { var contextToController = systems[i].Keys.Select(t => new KeyValuePair((VFXContextController)GetNodeController(t, 0), t)).Where(t => t.Key != null).ToDictionary(t => t.Value, t => t.Key); m_Systems[i].contexts = contextToController.Values.ToArray(); - VFXContextType type = VFXContextType.None; - VFXContext prevContext = null; - var orderedContexts = contextToController.Keys.OrderBy(t => t.contextType).ThenBy(t => systems[i][t]).ThenBy(t => t.position.x).ThenBy(t => t.position.y).ToArray(); - - char letter = 'A'; - foreach (var context in orderedContexts) - { - if (context.contextType == type) - { - if (prevContext != null) - { - letter = 'A'; - prevContext.letter = letter; - prevContext = null; - } - - if (letter == 'Z') // loop back to A in the unlikely event that there are more than 26 contexts - letter = 'a'; - else if (letter == 'z') - letter = 'α'; - else if (letter == 'ω') - letter = 'A'; - context.letter = ++letter; - } - else - { - context.letter = '\0'; - prevContext = context; - } - type = context.contextType; - } } } catch (Exception e) diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs index 0370c9cbb9a..936bc999d90 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs @@ -434,24 +434,6 @@ protected void NotifyValueChanged() void OnExpand(EventBase evt) { - // Allow expand/collapse on when clicking over the arrow icon (which can be embedded in the label's background) - if (evt is PointerUpEvent pointerUpEvent) - { - var label = this.Q