diff --git a/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md b/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md index 64d6a5bb3d6..69dc9bb9147 100644 --- a/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md +++ b/Packages/com.unity.render-pipelines.core/Documentation~/custom-material-inspector.md @@ -6,7 +6,7 @@ Custom Material Inspectors enable you to define how Unity displays properties in The implementation for custom Material Inspectors differs between URP and HDRP. For example, for compatibility purposes, every custom Material Inspector in HDRP must inherit from `HDShaderGUI` which does not exist in URP. For information on how to create custom Material Inspectors for the respective render pipelines, see: -- **HDRP**: [HDRP custom Material Inspectors](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/hdrp-custom-material-inspector.html). +- **HDRP**: [HDRP custom Material Inspectors](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/custom-material-inspectors.html). - **URP**: [Unity Custom Shader GUI](https://docs.unity3d.com/Manual/SL-CustomShaderGUI.html). ## Assigning a custom Material Inspector diff --git a/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md b/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md index 8904d765f99..4c1f399ae7f 100644 --- a/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md +++ b/Packages/com.unity.render-pipelines.core/Documentation~/render-graph-writing-a-render-pipeline.md @@ -15,7 +15,7 @@ public class MyRenderPipeline : RenderPipeline void InitializeRenderGraph() { - m_RenderGraph = new RenderGraph(“MyRenderGraph”); + m_RenderGraph = new RenderGraph("MyRenderGraph"); } void CleanupRenderGraph() diff --git a/Packages/com.unity.render-pipelines.core/Editor/HeaderFoldout.cs b/Packages/com.unity.render-pipelines.core/Editor/HeaderFoldout.cs index 53224611565..ecf57e7d89b 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/HeaderFoldout.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/HeaderFoldout.cs @@ -77,7 +77,15 @@ public HeaderFoldout() : base() m_HelpButton.SetEnabled(!string.IsNullOrEmpty(m_DocumentationURL)); line.Add(m_HelpButton); - m_ContextMenuButton = new Button(Background.FromTexture2D(CoreEditorStyles.paneOptionsIcon), () => ShowMenu()); + m_ContextMenuButton = + new Button(Background.FromTexture2D(CoreEditorStyles.paneOptionsIcon), () => ShowMenu()) + { + style = + { + paddingRight = 2 + } + }; + m_ContextMenuButton.SetEnabled(m_ContextMenuGenerator != null); line.Add(m_ContextMenuButton); diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader index 7460bf116cc..13b0330dd00 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader @@ -1,4 +1,4 @@ -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal webgpu #define UNIFIED_RT_GROUP_SIZE_X 64 #define UNIFIED_RT_GROUP_SIZE_Y 1 diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeCellDilation.compute b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeCellDilation.compute index eb87df797ce..04dd0fa3d1f 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeCellDilation.compute +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeCellDilation.compute @@ -1,6 +1,6 @@ #pragma kernel DilateCell -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch webgpu #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl" diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeSubdivide.compute b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeSubdivide.compute index ba7e4d63718..2b7fb853aee 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeSubdivide.compute +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeSubdivide.compute @@ -6,7 +6,7 @@ #pragma kernel VoxelizeProbeVolumeData #pragma kernel Subdivide -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch webgpu // #pragma enable_d3d11_debug_symbols diff --git a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader index 45f7011a9fc..f15265fdf19 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader +++ b/Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/VirtualOffset/TraceVirtualOffset.urtshader @@ -1,4 +1,4 @@ -#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal +#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal webgpu switch #define UNIFIED_RT_GROUP_SIZE_X 64 #define UNIFIED_RT_GROUP_SIZE_Y 1 diff --git a/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.SidePanel.cs b/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.SidePanel.cs index 5a98999d1b3..37419dc3794 100644 --- a/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.SidePanel.cs +++ b/Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.SidePanel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using UnityEditor.UIElements; using UnityEditorInternal; @@ -122,7 +122,37 @@ bool IsSearchFilterMatch(string str, string searchString, out int startIndex, ou return true; } + private IVisualElementScheduledItem m_PreviousSearch; + private string m_PendingSearchString = string.Empty; + private const int k_SearchStringLimit = 15; void OnSearchFilterChanged(Dictionary> elementCache, string searchString) + { + // Ensure the search string is within the allowed length limit (15 chars max) + if (searchString.Length > k_SearchStringLimit) + { + searchString = searchString[..k_SearchStringLimit]; // Trim to max 15 chars + Debug.LogWarning("[Render Graph Viewer] Search string limit exceeded: " + k_SearchStringLimit); + } + + // If the search string hasn't changed, avoid repeating the same search + if (m_PendingSearchString == searchString) + return; + + m_PendingSearchString = searchString; + + if (m_PreviousSearch != null && m_PreviousSearch.isActive) + m_PreviousSearch.Pause(); + + m_PreviousSearch = rootVisualElement + .schedule + .Execute(() => + { + PerformSearchAsync(elementCache, searchString); + }) + .StartingIn(5); // Avoid spamming multiple search if the user types really fast + } + + private void PerformSearchAsync(Dictionary> elementCache, string searchString) { // Display filter foreach (var (foldout, descendants) in elementCache) @@ -362,8 +392,12 @@ void CreateTextElement(VisualElement parent, string text, string className = nul { var attachmentFoldout = new Foldout(); + string subResourceText = string.Empty; + if (attachmentInfo.attachment.mipLevel > 0) subResourceText += $" Mip:{attachmentInfo.attachment.mipLevel}"; + if (attachmentInfo.attachment.depthSlice > 0) subResourceText += $" Slice:{attachmentInfo.attachment.depthSlice}"; + // Abuse Foldout to allow two-line header (same as above) - attachmentFoldout.text = $"{attachmentInfo.resourceName}
"; + attachmentFoldout.text = $"{attachmentInfo.resourceName + subResourceText}
"; Label attachmentIndexLabel = new Label($"
Attachment #{attachmentInfo.attachmentIndex}"); attachmentIndexLabel.AddToClassList(Classes.kInfoFoldoutSecondaryText); @@ -384,13 +418,13 @@ void CreateTextElement(VisualElement parent, string text, string className = nul attachmentFoldout.Add(new TextElement { - text = $"Load action: {attachmentInfo.loadAction}\n- {attachmentInfo.loadReason}" + text = $"Load action: {attachmentInfo.attachment.loadAction}\n- {attachmentInfo.loadReason}" }); bool addMsaaInfo = !string.IsNullOrEmpty(attachmentInfo.storeMsaaReason); string resolvedTexturePrefix = addMsaaInfo ? "Resolved surface: " : ""; - string storeActionText = $"Store action: {attachmentInfo.storeAction}" + + string storeActionText = $"Store action: {attachmentInfo.attachment.storeAction}" + $"\n - {resolvedTexturePrefix}{attachmentInfo.storeReason}"; if (addMsaaInfo) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Debug/ProbeVolumeDebugBase.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Debug/ProbeVolumeDebugBase.hlsl index 29e41d06b43..9e124643602 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Debug/ProbeVolumeDebugBase.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Debug/ProbeVolumeDebugBase.hlsl @@ -35,6 +35,7 @@ float GetCurrentExposureMultiplier() return LOAD_TEXTURE2D(_ExposureTexture, int2(0, 0)).x; } +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureXR.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" #include "Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/DecodeSH.hlsl" #include "Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl" @@ -267,6 +268,7 @@ bool ShouldCull(inout v2f o) bool shouldCull = false; if (distance(position.xyz + _APVWorldOffset, GetCurrentViewPosition()) > _CullDistance || brickSize > _MaxAllowedSubdiv || brickSize < _MinAllowedSubdiv) { + ZERO_INITIALIZE(v2f, o); DoCull(o); shouldCull = true; } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.Jobs.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.Jobs.cs index 9909408ef61..27c3fd30ed1 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.Jobs.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.Jobs.cs @@ -379,7 +379,6 @@ private unsafe struct ProbesUpdateJob : IJobParallelForBatch { public const int k_BatchSize = 64; - [ReadOnly] public bool initialize; [NativeDisableContainerSafetyRestriction, NoAlias][ReadOnly] public NativeArray instances; [NativeDisableParallelForRestriction][NativeDisableContainerSafetyRestriction, NoAlias] public CPUInstanceData instanceData; [ReadOnly] public CPUSharedInstanceData sharedInstanceData; @@ -403,11 +402,6 @@ public void Execute(int startIndex, int count) int sharedInstanceIndex = sharedInstanceData.InstanceToIndex(instanceData, instance); TransformUpdateFlags flags = sharedInstanceData.flags[sharedInstanceIndex].transformUpdateFlags; - bool isStaticObject = (flags & TransformUpdateFlags.IsPartOfStaticBatch) != 0; - - if (!initialize && isStaticObject) - continue; - bool hasLightProbe = (flags & TransformUpdateFlags.HasLightProbeCombined) != 0; if (!hasLightProbe) @@ -976,7 +970,7 @@ public void Execute(int index) instanceData.editorData.selectedBits.Set(instanceData.InstanceToIndex(instance), true); } } - + #endif } } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs index 20525c1d85b..9ed79f922ae 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/GPUDriven/InstanceData/InstanceDataSystem.cs @@ -351,7 +351,6 @@ private unsafe void UpdateInstanceTransformsData(bool initialize, NativeArray instanc new ProbesUpdateJob() { - initialize = false, instances = instances, instanceData = m_InstanceData, sharedInstanceData = m_SharedInstanceData, diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs b/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs index b4ed805a62c..49c57b5e4a6 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs @@ -1707,7 +1707,7 @@ static public void DoLensFlareDataDrivenCommon(Material lensFlareShader, Camera Vector2 occlusionRadiusEdgeScreenPos1 = (Vector2)WorldToViewport(cam, !isDirLight, isCameraRelative, viewProjMatrix, positionWS + cam.transform.up * adjustedOcclusionRadius); float occlusionRadius = (occlusionRadiusEdgeScreenPos1 - occlusionRadiusEdgeScreenPos0).magnitude; - if (comp.useOcclusion) + if (comp.useOcclusion && occlusionRT != null) { cmd.SetGlobalTexture(_FlareOcclusionTex, occlusionRT); cmd.EnableShaderKeyword("FLARE_HAS_OCCLUSION"); 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 88f87b1cb63..7e8520dd24f 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 @@ -36,11 +36,10 @@ static RenderGraph.DebugData.PassData.NRPInfo.NativeRenderPassInfo.AttachmentInf { resourceName = pointTo.GetName(ctx, attachment.handle), attachmentIndex = attachmentIndex, - loadAction = attachment.loadAction.ToString(), loadReason = loadReason, - storeAction = attachment.storeAction.ToString(), storeReason = storeReason, - storeMsaaReason = storeMsaaReason + storeMsaaReason = storeMsaaReason, + attachment = attachment }; } @@ -207,6 +206,8 @@ internal void GenerateNativeCompilerDebugData(ref RenderGraph.DebugData debugDat debugResource.textureData.depth = resourceUnversioned.volumeDepth; debugResource.textureData.samples = resourceUnversioned.msaaSamples; debugResource.textureData.format = info.format; + debugResource.textureData.bindMS = resourceUnversioned.bindMS; + debugResource.textureData.clearBuffer = resourceUnversioned.clear; debugResource.memoryless = resourceUnversioned.memoryLess; debugResource.consumerList = new List(); @@ -240,7 +241,7 @@ internal void GenerateNativeCompilerDebugData(ref RenderGraph.DebugData debugDat debugPass.resourceReadLists = new List[(int)RenderGraphResourceType.Count]; debugPass.resourceWriteLists = new List[(int)RenderGraphResourceType.Count]; - RenderGraph.DebugData.s_PassScriptMetadata.TryGetValue(passName, out debugPass.scriptInfo); + RenderGraph.DebugData.s_PassScriptMetadata.TryGetValue(graphPass, out debugPass.scriptInfo); debugPass.syncFromPassIndex = -1; // TODO async compute support debugPass.syncToPassIndex = -1; // TODO async compute support 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 23066848f12..ba880599e08 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 @@ -40,11 +40,15 @@ public override int GetHashCode() return hash; } - public static bool EqualForMerge(PassFragmentData x, PassFragmentData y) + // If you modify this, check if struct RenderPassSetup::Attachment in "GfxDevice\RenderPassSetup.h" also needs changes + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool SameSubResource(in PassFragmentData x, in PassFragmentData y) { // We ignore the version for now we assume if one pass writes version x and the next y they can // be merged in the same native render pass - return x.resource.index == y.resource.index && x.accessFlags == y.accessFlags && x.mipLevel == y.mipLevel && x.depthSlice == y.depthSlice; + // We also do not look at the access flags as they get OR-ed together when adding subpasses to the native pass so the access flags + // will always cover the required access (and thus possibly more if required by other passes) + return x.resource.index == y.resource.index && x.mipLevel == y.mipLevel && x.depthSlice == y.depthSlice; } } @@ -693,7 +697,7 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ for (int i = 0; i < nativePass.fragments.size; ++i) { - if (nativePass.fragments[i].resource.index == fragment.resource.index) + if (PassFragmentData.SameSubResource(nativePass.fragments[i], fragment)) { alreadyAttached = true; break; @@ -723,7 +727,7 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ for (int i = 0; i < nativePass.fragments.size; ++i) { - if (nativePass.fragments[i].resource.index == fragmentInput.resource.index) + if (PassFragmentData.SameSubResource(nativePass.fragments[i], fragmentInput)) { alreadyAttached = true; break; @@ -816,7 +820,7 @@ static bool CanMergeNativeSubPass(CompilerContextData contextData, NativePassDat int colorAttachmentIdx = -1; for (int fragmentId = 0; fragmentId < fragmentList.size; ++fragmentId) { - if (fragmentList[fragmentId].resource.index == graphPassFragment.resource.index) + if (PassFragmentData.SameSubResource(fragmentList[fragmentId], graphPassFragment)) { colorAttachmentIdx = fragmentId; break; @@ -849,7 +853,7 @@ static bool CanMergeNativeSubPass(CompilerContextData contextData, NativePassDat int inputAttachmentIdx = -1; for (int fragmentId = 0; fragmentId < fragmentList.size; ++fragmentId) { - if (fragmentList[fragmentId].resource.index == graphFragmentInput.resource.index) + if (PassFragmentData.SameSubResource(fragmentList[fragmentId], graphFragmentInput)) { inputAttachmentIdx = fragmentId; break; @@ -928,7 +932,7 @@ public static void TryMergeNativeSubPass(CompilerContextData contextData, ref Na int colorAttachmentIdx = -1; for (int fragmentId = 0; fragmentId < fragmentList.size; ++fragmentId) { - if (fragmentList[fragmentId].resource.index == graphPassFragment.resource.index) + if (PassFragmentData.SameSubResource(fragmentList[fragmentId], graphPassFragment)) { colorAttachmentIdx = fragmentId; break; @@ -955,7 +959,7 @@ public static void TryMergeNativeSubPass(CompilerContextData contextData, ref Na int inputAttachmentIdx = -1; for (int fragmentId = 0; fragmentId < fragmentList.size; ++fragmentId) { - if (fragmentList[fragmentId].resource.index == fragmentInput.resource.index) + if (PassFragmentData.SameSubResource(fragmentList[fragmentId], fragmentInput)) { inputAttachmentIdx = fragmentId; break; @@ -1118,7 +1122,7 @@ public static PassBreakAudit TryMerge(CompilerContextData contextData, int activ for (int i = 0; i < nativePass.fragments.size; ++i) { ref var existingAttach = ref nativePass.fragments[i]; - if (existingAttach.resource.index == newAttach.resource.index) + if (PassFragmentData.SameSubResource(existingAttach, newAttach)) { // Update the attached version access flags and version existingAttach.accessFlags |= newAttach.accessFlags; @@ -1145,7 +1149,7 @@ public static PassBreakAudit TryMerge(CompilerContextData contextData, int activ for (int i = 0; i < nativePass.fragments.size; ++i) { ref var existingAttach = ref nativePass.fragments[i]; - if (existingAttach.resource.index == newAttach.resource.index) + if (PassFragmentData.SameSubResource(existingAttach, newAttach)) { // Update the attached version access flags and version existingAttach.accessFlags |= newAttach.accessFlags; diff --git a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.DebugData.cs b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.DebugData.cs index 3dd5b98652a..a533c2b7870 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.DebugData.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.DebugData.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Diagnostics; using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler; namespace UnityEngine.Rendering.RenderGraphModule { @@ -68,12 +69,11 @@ public class NativeRenderPassInfo public class AttachmentInfo { public string resourceName; - public int attachmentIndex; - public string loadAction; public string loadReason; - public string storeAction; public string storeReason; public string storeMsaaReason; + public int attachmentIndex; + public NativePassAttachment attachment; } public struct PassCompatibilityInfo @@ -189,7 +189,7 @@ public void Clear() } // Script metadata for passes. - internal static readonly Dictionary s_PassScriptMetadata = new (); + internal static readonly Dictionary s_PassScriptMetadata = new (); // Pass script metadata. public class PassScriptInfo @@ -202,24 +202,17 @@ public class PassScriptInfo readonly string[] k_PassNameDebugIgnoreList = new string[] { k_BeginProfilingSamplerPassName, k_EndProfilingSamplerPassName }; [Conditional("UNITY_EDITOR")] - void AddPassDebugMetadata(string passName, string file, int line) + void AddPassDebugMetadata(RenderGraphPass renderPass, string file, int line) { // Does nothing unless debug data capture is requested if (m_CaptureDebugDataForExecution == null) return; for (int i = 0; i < k_PassNameDebugIgnoreList.Length; ++i) - if (passName == k_PassNameDebugIgnoreList[i]) + if (renderPass.name == k_PassNameDebugIgnoreList[i]) return; - if (!DebugData.s_PassScriptMetadata.TryAdd(passName, new DebugData.PassScriptInfo { filePath = file, line = line })) - { - var existingFile = DebugData.s_PassScriptMetadata[passName].filePath; - var existingLine = DebugData.s_PassScriptMetadata[passName].line; - if (existingFile != file || existingLine != line) - Debug.LogWarning($"Two passes called {passName} in different locations: {existingFile}:{existingLine}" + - $" and {file}:{line}. Jumping to source from Render Graph Viewer will only work correctly for {existingFile}:{existingLine}."); - } + DebugData.s_PassScriptMetadata.TryAdd(renderPass, new DebugData.PassScriptInfo { filePath = file, line = line }); } [Conditional("UNITY_EDITOR")] 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 8fbb4f0743a..a59c8efba8c 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs @@ -958,11 +958,11 @@ public IRasterRenderGraphBuilder AddRasterRenderPass(string passName, [CallerLineNumber] int line = 0) where PassData : class, new() #endif { - AddPassDebugMetadata(passName, file, line); - var renderPass = m_RenderGraphPool.Get>(); renderPass.Initialize(m_RenderPasses.Count, m_RenderGraphPool.Get(), passName, RenderGraphPassType.Raster, sampler); + AddPassDebugMetadata(renderPass, file, line); + passData = renderPass.data; m_RenderPasses.Add(renderPass); @@ -1005,11 +1005,11 @@ public IComputeRenderGraphBuilder AddComputePass(string passName, out [CallerLineNumber] int line = 0) where PassData : class, new() #endif { - AddPassDebugMetadata(passName, file, line); - var renderPass = m_RenderGraphPool.Get>(); renderPass.Initialize(m_RenderPasses.Count, m_RenderGraphPool.Get(), passName, RenderGraphPassType.Compute, sampler); + AddPassDebugMetadata(renderPass, file, line); + passData = renderPass.data; m_RenderPasses.Add(renderPass); @@ -1066,12 +1066,12 @@ public IUnsafeRenderGraphBuilder AddUnsafePass(string passName, out Pa [CallerLineNumber] int line = 0) where PassData : class, new() #endif { - AddPassDebugMetadata(passName, file, line); - var renderPass = m_RenderGraphPool.Get>(); renderPass.Initialize(m_RenderPasses.Count, m_RenderGraphPool.Get(), passName, RenderGraphPassType.Unsafe, sampler); renderPass.AllowGlobalState(true); + AddPassDebugMetadata(renderPass, file, line); + passData = renderPass.data; m_RenderPasses.Add(renderPass); @@ -1096,12 +1096,12 @@ public RenderGraphBuilder AddRenderPass(string passName, out PassData [CallerLineNumber] int line = 0) where PassData : class, new() #endif { - AddPassDebugMetadata(passName, file, line); - - var renderPass = m_RenderGraphPool.Get>(); + var renderPass = m_RenderGraphPool.Get>(); renderPass.Initialize(m_RenderPasses.Count, m_RenderGraphPool.Get(), passName, RenderGraphPassType.Legacy, sampler); renderPass.AllowGlobalState(true);// Old pass types allow global state by default as HDRP relies on it + AddPassDebugMetadata(renderPass, file, line); + passData = renderPass.data; m_RenderPasses.Add(renderPass); @@ -2472,6 +2472,7 @@ void GenerateCompilerDebugData(ref DebugData debugData) textureData.depth = renderTargetInfo.volumeDepth; textureData.samples = renderTargetInfo.msaaSamples; textureData.format = renderTargetInfo.format; + textureData.bindMS = renderTargetInfo.bindMS; newResource.textureData = textureData; } 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 f26aea44706..c1aa76d80c7 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs @@ -1109,14 +1109,14 @@ void ReleaseTextureCallback(InternalRenderGraphContext rgContext, IRenderGraphRe [Conditional("DEVELOPMENT_BUILD"), Conditional("UNITY_EDITOR")] void ValidateTextureDesc(in TextureDesc desc) { - if(RenderGraph.enableValidityChecks) + if (RenderGraph.enableValidityChecks) { if (desc.format == GraphicsFormat.None ) { throw new ArgumentException("Texture was created with with no format. The texture needs to either have a color format or a depth stencil format."); } - if (desc.dimension == TextureDimension.None) + if (desc.dimension == TextureDimension.None || desc.dimension == TextureDimension.Any) { throw new ArgumentException("Texture was created with an invalid texture dimension."); } @@ -1125,6 +1125,21 @@ void ValidateTextureDesc(in TextureDesc desc) { throw new ArgumentException("Texture was created with a slices parameter value of zero."); } + else if (desc.slices > 1) + { + if (desc.dimension == TextureDimension.Tex2D || desc.dimension == TextureDimension.Cube) + { + if (SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES3) + throw new ArgumentException("Non-array texture was created with a slices parameter larger than one."); + } + } + + // Bind ms textures need to use the ms texture sampling functions so there is no "silent" fallback or interoperability between a "non-ms texture" and an "ms texture which happens to have 1 sample" + // it's either ms with > 1 sample or "normal texture". This is unlike array textures where you can have an array with 1 slice. + if ((int)desc.msaaSamples <= 1 && desc.bindTextureMS == true) + { + throw new ArgumentException("A single sample texture was created with bindTextureMS."); + } if (desc.sizeMode == TextureSizeMode.Explicit) { 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 8e54c7de191..e37aa350392 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/STP/STP.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/STP/STP.cs @@ -402,6 +402,7 @@ public bool Update(ref HistoryUpdateInfo info) Vector2Int historyTextureSize = info.useHwDrs ? info.postUpscaleSize : info.preUpscaleSize; TextureDimension texDimension = info.useTexArray ? TextureDimension.Tex2DArray : TextureDimension.Tex2D; + int numSlices = info.useTexArray ? TextureXR.slices : 1; int width = 0; int height = 0; @@ -464,7 +465,7 @@ public bool Update(ref HistoryUpdateInfo info) int offset = (frameIndex * kNumHistoryTextureTypes) + historyTypeIndex; m_textures[offset] = RTHandles.Alloc( - width, height, format, TextureXR.slices, dimension: texDimension, enableRandomWrite: true, + width, height, format, numSlices, dimension: texDimension, enableRandomWrite: true, name: name, useDynamicScaleExplicit: useDynamicScaleExplicit ); } diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs index a7464021326..27d7fa2be8d 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs @@ -249,7 +249,6 @@ static internal void DrawTriangle(RasterCommandBuffer cmd, Material material, in static internal void DrawTriangle(CommandBuffer cmd, Material material, int shaderPass) { DrawTriangle(cmd, material, shaderPass, s_PropertyBlock); - s_PropertyBlock.Clear(); } static internal void DrawTriangle(CommandBuffer cmd, Material material, int shaderPass, MaterialPropertyBlock propertyBlock) @@ -273,7 +272,6 @@ static internal void DrawQuad(RasterCommandBuffer cmd, Material material, int sh static internal void DrawQuad(CommandBuffer cmd, Material material, int shaderPass) { DrawQuad(cmd, material, shaderPass, s_PropertyBlock); - s_PropertyBlock.Clear(); } static internal void DrawQuad(CommandBuffer cmd, Material material, int shaderPass, MaterialPropertyBlock propertyBlock) diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/Dynamic-Resolution.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/Dynamic-Resolution.md index 731e64df2b2..8578689db89 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/Dynamic-Resolution.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/Dynamic-Resolution.md @@ -149,3 +149,7 @@ The intensity of the sharpening filter used by FSR can be controlled using the * > [!NOTE] > This setting is not available in the editor if the **Override FSR Sharpness** checkbox is not checked. The checkbox itself is not available if the default upscaling filter is set to FSR. + +## Additional resources + +- [Introduction to changing resolution scale](https://docs.unity3d.com/6000.0/Documentation/Manual/resolution-scale-introduction.html) diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/create-a-fullscreen-material.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/create-a-fullscreen-material.md index b20cb4bb9cc..96337127347 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/create-a-fullscreen-material.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/create-a-fullscreen-material.md @@ -83,7 +83,7 @@ To set a source material for the `Blit()` command to use in shader graph: ### Set the Blit pass in a C# script -Shader Graph outputs multiple passes for compatibility reasons. This means you need to manually tell the `Blit()` command to use the correct pass. You can do this in any script that uses a full-screen pass, for example a custom pass or a custom render texture script. +Shader Graph outputs multiple passes for compatibility reasons. This means you need to manually tell the `Blit()` command to use the correct pass. You can do this in any script that uses a full-screen pass, for example a custom pass or a custom post-process script. The Blit pass is pass number `0`. Use the following line to reference this pass: diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/deep-learning-super-sampling-in-hdrp.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/deep-learning-super-sampling-in-hdrp.md index 2d63a398267..993a539074f 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/deep-learning-super-sampling-in-hdrp.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/deep-learning-super-sampling-in-hdrp.md @@ -82,3 +82,8 @@ Out = SAMPLE_TEXTURE2D_BIAS(TextureInput, SamplerInput, UV, MipBias); ![](Images/CustomMipSupportNodeExample.png) + +## Additional resources + +- [Introduction to changing resolution scale](https://docs.unity3d.com/6000.0/Documentation/Manual/resolution-scale-introduction.html) + diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md index d6cb6c832f5..b7e08041c98 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/surface-options/shadow-matte.md @@ -2,5 +2,8 @@ Shadow Matte -Indicates whether or not the Shader receives shadows. Shadow matte only supports shadow maps. It does not support Screen Space Shadows, Ray-Traced Shadows, or Contact Shadows. +Indicates whether the shader receives shadows. Shadow matte only supports shadow maps. +It doesn't support screen-space shadows, ray-traced Shadows, or contact shadows.
+Enable **Shadow Matte** if you add a custom Node that samples shadow maps, otherwise shadows might not render correctly. + diff --git a/Packages/com.unity.render-pipelines.high-definition/Documentation~/stp/stp-upscaler.md b/Packages/com.unity.render-pipelines.high-definition/Documentation~/stp/stp-upscaler.md index a5276cadf21..1db366b1a29 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Documentation~/stp/stp-upscaler.md +++ b/Packages/com.unity.render-pipelines.high-definition/Documentation~/stp/stp-upscaler.md @@ -33,3 +33,8 @@ To enable STP in the High Definition Render Pipeline (HDRP), do the following: 3. Set **Dynamic Resolution Type** to **Hardware**. STP remains active when **Render Scale** is set to **1.0** as it applies temporal anti-aliasing (TAA) to the final rendered output. + +## Additional resources + +- [Introduction to changing resolution scale](https://docs.unity3d.com/6000.0/Documentation/Manual/resolution-scale-introduction.html) + diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs index 302aa95b93f..78c94c8aa18 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs @@ -1,9 +1,11 @@ using System; using System.Collections.Generic; using UnityEditor.IMGUI.Controls; +using UnityEditor.Rendering.HighDefinition.ShaderGraph; using UnityEditor.ShaderGraph; using UnityEditor.ShortcutManagement; using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using static UnityEditorInternal.EditMode; using RenderingLayerMask = UnityEngine.RenderingLayerMask; @@ -17,6 +19,16 @@ partial class DecalProjectorEditor : Editor const float k_Limit = 100000; const float k_LimitInv = 1 / k_Limit; + + static public readonly GUIContent k_NewDecalMaterialButtonText = EditorGUIUtility.TrTextContent("New", "Creates a new Decal material."); + static public readonly string k_NewDecalText = "HDRP Decal"; + static public readonly string k_NewSGDecalText = "ShaderGraph Decal"; + + internal enum DefaultDecal + { + HDRPDecal, + SGDecal + } static Color fullColor { get @@ -715,7 +727,7 @@ public override void OnInspectorGUI() ReinitSavedRatioSizePivotPosition(); EditorGUI.EndProperty(); - EditorGUILayout.PropertyField(m_MaterialProperty, k_MaterialContent); + DecalMaterialFieldWithButton(m_MaterialProperty); bool decalLayerEnabled = false; if (hdrp != null) @@ -837,6 +849,54 @@ public override void OnInspectorGUI() } } + internal void DecalMaterialFieldWithButton(SerializedProperty prop) + { + const int k_NewFieldWidth = 70; + + var rect = EditorGUILayout.GetControlRect(); + rect.xMax -= k_NewFieldWidth + 2; + + EditorGUI.PropertyField(rect, prop); + + var newFieldRect = rect; + newFieldRect.x = rect.xMax + 2; + newFieldRect.width = k_NewFieldWidth; + + if (!EditorGUI.DropdownButton(newFieldRect, k_NewDecalMaterialButtonText, FocusType.Keyboard)) + return; + + GenericMenu menu = new GenericMenu(); + menu.AddItem(new GUIContent(k_NewDecalText), false, () => CreateDefaultDecalMaterial(target as MonoBehaviour, DefaultDecal.HDRPDecal)); + menu.AddItem(new GUIContent(k_NewSGDecalText), false, () => CreateDefaultDecalMaterial(target as MonoBehaviour, DefaultDecal.SGDecal)); + menu.DropDown(newFieldRect); + } + + public static void CreateDefaultDecalMaterial(MonoBehaviour obj, DefaultDecal defaultDecal) + { + string materialName = ""; + var materialIcon = AssetPreview.GetMiniTypeThumbnail(typeof(Material)); + + var action = ScriptableObject.CreateInstance(); + action.decalProjector = obj as DecalProjector; + + switch (defaultDecal) + { + case DefaultDecal.HDRPDecal: + materialName = "New " + k_NewDecalText; + action.isShaderGraph = false; + break; + case DefaultDecal.SGDecal: + materialName = "New " + k_NewSGDecalText; + action.isShaderGraph = true; + break; + default: + Debug.LogError("Decal creation failed."); + break; + } + + ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, action, materialName, materialIcon, null); + } + [Shortcut("HDRP/Decal: Handle changing size stretching UV", typeof(SceneView), KeyCode.Keypad1, ShortcutModifiers.Action)] static void EnterEditModeWithoutPreservingUV(ShortcutArguments args) { @@ -904,4 +964,33 @@ static void ExitEditMode(ShortcutArguments args) QuitEditMode(); } } + + class DoCreateDecalDefaultMaterial : ProjectWindowCallback.EndNameEditAction + { + public DecalProjector decalProjector; + public bool isShaderGraph = false; + public override void Action(int instanceId, string pathName, string resourceFile) + { + string shaderGraphName = AssetDatabase.GenerateUniqueAssetPath(pathName + ".shadergraph"); + string materialName = AssetDatabase.GenerateUniqueAssetPath(pathName + ".mat"); + Shader shader = null; + + if (isShaderGraph) + { + shader = DecalSubTarget.CreateDecalGraphAtPath(shaderGraphName); + } + else + { + shader = Shader.Find("HDRP/Decal"); + } + + if (shader != null) + { + var material = new Material(shader); + AssetDatabase.CreateAsset(material, materialName); + ProjectWindowUtil.ShowCreatedAsset(material); + decalProjector.material = material; + } + } + } } diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs index a1b1e2317ec..dc4ee23b8da 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs @@ -8,6 +8,7 @@ using static UnityEngine.Rendering.HighDefinition.HDMaterial; using static UnityEngine.Rendering.HighDefinition.HDMaterialProperties; using static UnityEditor.Rendering.HighDefinition.HDFields; +using UnityEngine; namespace UnityEditor.Rendering.HighDefinition.ShaderGraph { @@ -224,6 +225,38 @@ void AddColorMaskProperty(string referenceName) } } + internal static Shader CreateDecalGraphAtPath(string path) + { + var target = (HDTarget)Activator.CreateInstance(typeof(HDTarget)); + target.TrySetActiveSubTarget(typeof(DecalSubTarget)); + + var blockDescriptors = new[] + { + BlockFields.VertexDescription.Position, + BlockFields.VertexDescription.Normal, + BlockFields.VertexDescription.Tangent, + BlockFields.SurfaceDescription.BaseColor, + BlockFields.SurfaceDescription.Alpha, + BlockFields.SurfaceDescription.NormalTS, + HDBlockFields.SurfaceDescription.NormalAlpha, + BlockFields.SurfaceDescription.Metallic, + BlockFields.SurfaceDescription.Occlusion, + BlockFields.SurfaceDescription.Smoothness, + HDBlockFields.SurfaceDescription.MAOSAlpha, + BlockFields.SurfaceDescription.Emission, + }; + + var graph = new GraphData(); + graph.AddContexts(); + graph.InitializeOutputs(new[] { target }, blockDescriptors); + + graph.path = "Shader Graphs"; + FileUtilities.WriteShaderGraphToDisk(path, graph); + AssetDatabase.Refresh(); + + return AssetDatabase.LoadAssetAtPath(path); + } + #region SubShaders static class SubShaders { diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Water/ShaderGraph/WaterDecalSubTarget.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Water/ShaderGraph/WaterDecalSubTarget.cs index 8a85526e0b0..56feeca41b9 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Water/ShaderGraph/WaterDecalSubTarget.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Material/Water/ShaderGraph/WaterDecalSubTarget.cs @@ -253,6 +253,8 @@ PassDescriptor GeneratePass(WaterDecal.PassType type) StructFields.Varyings.texCoord0, StructFields.Varyings.texCoord1, StructFields.Varyings.instanceID, + StructFields.Varyings.stereoTargetEyeIndexAsBlendIdx0, + StructFields.Varyings.stereoTargetEyeIndexAsRTArrayIdx, } }, @@ -273,6 +275,8 @@ PassDescriptor GeneratePass(WaterDecal.PassType type) { Pragma.Vertex("Vert") }, { Pragma.Fragment("Frag") }, { Pragma.EditorSyncCompilation }, + { Pragma.DOTSInstancing }, + Pragma.MultiCompileInstancing, //{ Pragma.DebugSymbols }, }, defines = WaterDecalDefines.GetPassDefines(type), diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs index 635c6296ee4..6ec7c5a1fe0 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs @@ -1,5 +1,5 @@ -using UnityEditor.Rendering; using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.Rendering.HighDefinition @@ -47,6 +47,11 @@ class PhysicallyBasedSkyEditor : SkySettingsEditor GUIContent[] m_ModelTypes = { new GUIContent("Earth (Simple)"), new GUIContent("Earth (Advanced)"), new GUIContent("Custom Planet") }; int[] m_ModelTypeValues = { (int)PhysicallyBasedSkyModel.EarthSimple, (int)PhysicallyBasedSkyModel.EarthAdvanced, (int)PhysicallyBasedSkyModel.Custom }; + static public readonly GUIContent k_NewMaterialButtonText = EditorGUIUtility.TrTextContent("New", "Creates a new Physically Based Sky Material asset template."); + static public readonly GUIContent k_CustomMaterial = EditorGUIUtility.TrTextContent("Material", "Sets a custom material that will be used to render the PBR Sky. If set to None, the default Rendering Mode is used."); + + static public readonly string k_NewSkyMaterialText = "Physically Based Sky"; + public override void OnEnable() { base.OnEnable(); @@ -130,7 +135,10 @@ public override void OnInspectorGUI() if (hasMaterial) { using (new IndentLevelScope()) - PropertyField(m_Material); + { + MaterialFieldWithButton(m_Material, k_CustomMaterial); + } + } DrawHeader("Planet"); @@ -200,5 +208,47 @@ public override void OnInspectorGUI() base.CommonSkySettingsGUI(); } + + internal void MaterialFieldWithButton(SerializedDataParameter prop, GUIContent label) + { + using (var scope = new OverridablePropertyScope(prop, prop.displayName, this)) + { + if (!scope.displayed) + return; + + const int k_NewFieldWidth = 70; + var rect = EditorGUILayout.GetControlRect(); + rect.xMax -= k_NewFieldWidth + 2; + + var newFieldRect = rect; + newFieldRect.x = rect.xMax + 2; + newFieldRect.width = k_NewFieldWidth; + + EditorGUI.PropertyField(rect, prop.value, label); + + if (GUI.Button(newFieldRect, k_NewMaterialButtonText)) + { + string materialName = "New " + k_NewSkyMaterialText + ".mat"; + var materialIcon = AssetPreview.GetMiniTypeThumbnail(typeof(Material)); + var action = ScriptableObject.CreateInstance(); + action.physicallyBasedSky = target as PhysicallyBasedSky; + ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, action, materialName, materialIcon, null); + } + } + } + } + + class DoCreatePBRSkyDefaultMaterial : ProjectWindowCallback.EndNameEditAction + { + public PhysicallyBasedSky physicallyBasedSky; + public Material material = null; + public override void Action(int instanceId, string pathName, string resourceFile) + { + var shader = GraphicsSettings.GetRenderPipelineSettings().pbrSkyMaterial; + material = new Material(shader); + AssetDatabase.CreateAsset(material, pathName); + ProjectWindowUtil.ShowCreatedAsset(material); + physicallyBasedSky.material.value = material; + } } } diff --git a/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterDecal/WaterDecalEditor.cs b/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterDecal/WaterDecalEditor.cs index c8618b0d3a2..d04ede0c722 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterDecal/WaterDecalEditor.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Editor/Water/WaterDecal/WaterDecalEditor.cs @@ -1,5 +1,6 @@ using UnityEngine; using UnityEngine.Assertions; +using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.Rendering.HighDefinition @@ -26,6 +27,12 @@ partial class WaterDecalEditor : Editor HierarchicalBox m_BoxHandle; + internal enum DefaultWaterDecal + { + Empty, + DeformerAndFoam + } + void OnEnable() { var o = new PropertyFetcher(serializedObject); @@ -67,6 +74,9 @@ void OnDisable() static public readonly GUIContent k_SurfaceFoamDimmerText = EditorGUIUtility.TrTextContent("Surface Foam Dimmer", "Specifies the dimmer for the surface foam."); static public readonly GUIContent k_DeepFoamDimmerText = EditorGUIUtility.TrTextContent("Deep Foam Dimmer", "Specifies the dimmer for the deep foam."); + static public readonly GUIContent k_NewWaterDecalMaterialButtonText = EditorGUIUtility.TrTextContent("New", "Creates a new Water Decal shader and Material asset templates."); + static public readonly string k_NewEmptyWaterDecalText = "Empty Water Decal"; + static public readonly string k_NewDeformerAndFoamWaterDecalText = "Deformer and Foam Water Decal"; public override void OnInspectorGUI() { serializedObject.Update(); @@ -80,11 +90,31 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } + internal void WaterDecalMaterialFieldWithButton(SerializedProperty prop) + { + const int k_NewFieldWidth = 70; + + var rect = EditorGUILayout.GetControlRect(); + rect.xMax -= k_NewFieldWidth + 2; + + EditorGUI.PropertyField(rect, prop); + + var newFieldRect = rect; + newFieldRect.x = rect.xMax + 2; + newFieldRect.width = k_NewFieldWidth; + + if (!EditorGUI.DropdownButton(newFieldRect, k_NewWaterDecalMaterialButtonText, FocusType.Keyboard)) + return; + + GenericMenu menu = new GenericMenu(); + menu.AddItem(new GUIContent(k_NewEmptyWaterDecalText), false, () => CreateDefaultDecalMaterial(target as MonoBehaviour, DefaultWaterDecal.Empty)); + menu.AddItem(new GUIContent(k_NewDeformerAndFoamWaterDecalText), false, () => CreateDefaultDecalMaterial(target as MonoBehaviour, DefaultWaterDecal.DeformerAndFoam)); + menu.DropDown(newFieldRect); + } + public void MaterialGUI() { - WaterSurfaceEditor.MaterialFieldWithButton(null, m_Material, () => { - return CreateDefaultDecalMaterial(target as MonoBehaviour); - }); + WaterDecalMaterialFieldWithButton(m_Material); if (m_Material.objectReferenceValue == null) return; @@ -116,19 +146,46 @@ public void MaterialGUI() EditorGUILayout.HelpBox("Water Decals only work with Water Decal Materials.", MessageType.Error); } - public static Material CreateDefaultDecalMaterial(MonoBehaviour obj) + public static Material CreateDefaultDecalMaterial(MonoBehaviour obj, DefaultWaterDecal defaultWaterDecal) { string directory = WaterSurfaceEditor.GetWaterResourcesPath(obj); System.IO.Directory.CreateDirectory(directory); - string baseName = directory + "/" + "New Water Decal Shader Graph"; - var path = AssetDatabase.GenerateUniqueAssetPath(baseName + ".shadergraph"); - var shader = ShaderGraph.WaterDecalSubTarget.CreateWaterDecalGraphAtPath(path); + string baseName = ""; + string materialName = ""; + string path = ""; + Material material = null; + + switch (defaultWaterDecal) + { + case DefaultWaterDecal.Empty: + materialName = "New " + k_NewEmptyWaterDecalText; + baseName = directory + "/" + materialName; + path = AssetDatabase.GenerateUniqueAssetPath(baseName + ".shadergraph"); + material = new Material(ShaderGraph.WaterDecalSubTarget.CreateWaterDecalGraphAtPath(path)); + break; + case DefaultWaterDecal.DeformerAndFoam: + materialName = "New " + k_NewDeformerAndFoamWaterDecalText; + baseName = directory + "/" + materialName; + path = AssetDatabase.GenerateUniqueAssetPath(baseName + ".shadergraph"); + material = new Material(GraphicsSettings.GetRenderPipelineSettings().waterDecalMigrationShader); + break; + default: + Debug.LogError("Water Decal creation failed."); + break; + } + + if (material != null) + { + material.parent = AssetDatabase.LoadAssetAtPath(path); + AssetDatabase.CreateAsset(material, AssetDatabase.GenerateUniqueAssetPath(baseName + ".mat")); + EditorGUIUtility.PingObject(material); + + // Setting this new material on the current water decal + WaterDecal waterDecal = obj as WaterDecal; + waterDecal.material = material; + } - Material material = new Material(shader); - material.parent = AssetDatabase.LoadAssetAtPath(path); - AssetDatabase.CreateAsset(material, AssetDatabase.GenerateUniqueAssetPath(baseName + ".mat")); - EditorGUIUtility.PingObject(material); return material; } 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 f61e54ba8ce..2342bb73623 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 @@ -3347,7 +3347,7 @@ internal void UpdateAllLightValues(bool fromTimeLine) internal void RefreshCachedShadow() { bool wentThroughCachedShadowSystem = lightIdxForCachedShadows >= 0; - if (wentThroughCachedShadowSystem) + if (!preserveCachedShadow && wentThroughCachedShadowSystem) HDShadowManager.cachedShadowManager.EvictLight(this, legacyLight.type); RegisterCachedShadowLightOptional(); diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricClouds.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricClouds.cs index 4f9d1543dd0..e9b32a04a78 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricClouds.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricClouds.cs @@ -591,7 +591,7 @@ internal void CombineVolumetricClouds(RenderGraph renderGraph, HDCamera hdCamera if (passData.perPixelSorting) { - builder.UseDepthBuffer(transparentPrepass.beforeRefraction, DepthAccess.Read); // Dummy buffer to avoid 'Setting MRT without a depth buffer is not supported' + builder.UseDepthBuffer(transparentPrepass.depthBufferPreRefraction, DepthAccess.Read); // Dummy buffer to avoid 'Setting MRT without a depth buffer is not supported' builder.UseColorBuffer(transparentPrepass.beforeRefraction, 1); builder.UseColorBuffer(transparentPrepass.beforeRefractionAlpha, 2); opticalFogBufferIndex = 3; @@ -604,6 +604,7 @@ internal void CombineVolumetricClouds(RenderGraph renderGraph, HDCamera hdCamera { if (!opticalFogTransmittance.IsValid()) opticalFogTransmittance = renderGraph.CreateTexture(HDRenderPipeline.GetOpticalFogTransmittanceDesc(hdCamera)); + builder.UseDepthBuffer(transparentPrepass.depthBufferPreRefraction, DepthAccess.Read); // Dummy buffer to avoid 'Setting MRT without a depth buffer is not supported' builder.UseColorBuffer(opticalFogTransmittance, opticalFogBufferIndex); } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricCloudsSky.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricCloudsSky.cs index e2da7049ad9..4554d80a976 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricCloudsSky.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricClouds/HDRenderPipeline.VolumetricCloudsSky.cs @@ -22,7 +22,7 @@ TextureDesc GetVolumetricCloudsIntermediateDepthBufferDesc() TextureDesc GetVolumetricCloudsIntermediateCubeTextureDesc() { return new TextureDesc(skyReflectionSize, skyReflectionSize, false, false) - { slices = TextureXR.slices, dimension = TextureDimension.Cube, format = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, useMipMap = true, autoGenerateMips = false }; + { dimension = TextureDimension.Cube, format = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, useMipMap = true, autoGenerateMips = false }; } TextureDesc GetVolumetricCloudsMetalCopyBufferDesc() diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/WorldLightManager.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/WorldLightManager.cs index 9186de26cfe..33934362745 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/WorldLightManager.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/WorldLightManager.cs @@ -154,12 +154,9 @@ internal void ResizeLightDataGraphicsBuffer(int numLights) m_LightDataGPUArray = new GraphicsBuffer(GraphicsBuffer.Target.Structured, numLightsGpu, System.Runtime.InteropServices.Marshal.SizeOf(typeof(LightData))); } - internal const int k_MaxPlanarReflectionsOnScreen = 16; - internal const int k_MaxCubeReflectionsOnScreen = 64; - internal unsafe void SetPlanarReflectionDataRT(int index, ref Matrix4x4 vp, ref Vector4 scaleOffset) { - Debug.Assert(index < k_MaxPlanarReflectionsOnScreen); + Debug.Assert(index < HDRenderPipeline.k_MaxPlanarReflectionsOnScreen); for (int j = 0; j < 16; ++j) m_EnvLightReflectionDataRT._PlanarCaptureVPWL[index * 16 + j] = vp[j]; @@ -170,7 +167,7 @@ internal unsafe void SetPlanarReflectionDataRT(int index, ref Matrix4x4 vp, ref internal unsafe void SetCubeReflectionDataRT(int index, ref Vector4 scaleOffset) { - Debug.Assert(index < k_MaxCubeReflectionsOnScreen); + Debug.Assert(index < HDRenderPipeline.k_MaxCubeReflectionsOnScreen); for (int j = 0; j < 4; ++j) m_EnvLightReflectionDataRT._CubeScaleOffsetWL[index * 4 + j] = scaleOffset[j]; @@ -354,16 +351,16 @@ public static void CollectWorldLights(in HDCamera hdCamera, in WorldLightsSettin // this to ensure that we don't process more lights than before if ((flagFunc(hdCamera, hdLight, light) & 0xfffffffe) == 0) continue; - + // TODO-WL: Directional lights if (hdLight.legacyLight.type == LightType.Directional) continue; - + // Compute the camera relative position Vector3 lightPositionRWS = hdLight.gameObject.transform.position; if (ShaderConfig.s_CameraRelativeRendering != 0) lightPositionRWS -= camPosWS; - + var lightType = hdLight.legacyLight.type; float lightRange = light.range; bool isAreaLight = lightType.IsArea(); @@ -401,10 +398,10 @@ public static void CollectWorldLights(in HDCamera hdCamera, in WorldLightsSettin // Let's now compute an AABB that matches the previously defined OOBB Bounds lightBounds = new Bounds(); OOBBToAABBBounds(oobbCenter, extents, hdLight.gameObject.transform.up, hdLight.gameObject.transform.right, hdLight.gameObject.transform.forward, ref lightBounds); - + if (!bounds.Intersects(lightBounds)) continue; - + visibleLight.bounds = lightBounds; } @@ -679,7 +676,7 @@ public static void BuildWorldLightVolumes(in HDCamera hdCamera, in HDRenderPipel lightVolume.position = visibleLight.bounds.center; lightVolume.lightType = isAreaLight ? 1u : 0u; lightVolume.shape = isAreaLight || isBoxLight ? 1u : 0u; - + worldLightsVolumes.bounds.Encapsulate(visibleLight.bounds); realIndex++; } diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs index 3a711f5c921..1b00ab03e71 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs @@ -562,7 +562,7 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo cameraPosPS -= (upAltitude.w - 1.0f) * (Vector3)upAltitude.xyz; bool simpleEarthMode = pbrSky.type.value == PhysicallyBasedSkyModel.EarthSimple; - bool customMaterial = pbrSky.renderingMode.value == PhysicallyBasedSky.RenderingMode.Material && pbrSky.material.value != null; + bool customMaterial = pbrSky.renderingMode.value == PhysicallyBasedSky.RenderingMode.Material && pbrSky.material.value != null && pbrSky.material.overrideState; var material = customMaterial ? pbrSky.material.value : m_PbrSkyMaterial; // Common material properties diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index 6c57c89be5b..81a7a6a9ffd 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -812,7 +812,7 @@ internal void RenderSkyAmbientProbe(RenderGraph renderGraph, SkyUpdateContext sk float dimmer = 1.0f, float anisotropy = 0.7f /*Default value used by volumetric clouds and cloud layer*/) { var cubemap = renderGraph.CreateTexture(new TextureDesc(m_LowResolution, m_LowResolution) - { slices = TextureXR.slices, dimension = TextureDimension.Cube, format = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true }); + { dimension = TextureDimension.Cube, format = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true }); RenderSkyToCubemap(renderGraph, skyContext, hdCamera, cubemap, m_FacePixelCoordToViewDirMatricesLowRes, renderBackgroundClouds, profileId); UpdateAmbientProbe(renderGraph, cubemap, outputForClouds: true, null, null, probeBuffer, new Vector4(dimmer, anisotropy, 0.0f, 0.0f), null); diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/ShaderPassWaterMask.hlsl b/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/ShaderPassWaterMask.hlsl index e10481e1aaf..7592befec01 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/ShaderPassWaterMask.hlsl +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/ShaderPassWaterMask.hlsl @@ -97,7 +97,7 @@ void Frag(PackedVaryingsToPS packedInput, else if (_WaterDebugMode == WATERDEBUGMODE_DEFORMATION) { // Sample the deformation region - float verticalDeformation = SAMPLE_TEXTURE2D_LOD(_WaterDeformationBuffer, s_linear_clamp_sampler, decalUV, 0); + float verticalDeformation = SAMPLE_TEXTURE2D_LOD(_WaterDeformationBuffer, s_linear_clamp_sampler, decalUV, 0).x; // Checkerboard pattern to visualize resolution float scale = _DeformationRegionResolution; diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/WaterExclusion.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/WaterExclusion.shader index a826a90cc16..1e72406e005 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/WaterExclusion.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/Shaders/WaterExclusion.shader @@ -26,6 +26,7 @@ Shader "Hidden/HDRP/WaterExclusion" HLSLPROGRAM #pragma target 4.5 #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile _ DOTS_INSTANCING_ON // #pragma enable_d3d11_debug_symbols diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/WaterDecal/WaterDecal.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/WaterDecal/WaterDecal.cs index b2a7d610669..5ea37fbe72f 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/WaterDecal/WaterDecal.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/Water/WaterDecal/WaterDecal.cs @@ -64,9 +64,9 @@ internal enum PassType public CustomRenderTextureUpdateMode updateMode = CustomRenderTextureUpdateMode.OnLoad; /// - /// Specifies the material used for the deformer. + /// Specifies the material used for the water decal. /// - [Tooltip("Specifies the material used for the deformer.")] + [Tooltip("Specifies the material used for the water decal.")] public Material material = null; internal int updateCount = 0; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.Skin.cs b/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.Skin.cs index da10211d51e..2294730d57b 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.Skin.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.Skin.cs @@ -21,7 +21,9 @@ partial class DecalProjectorEditor static readonly GUIContent k_UVBiasContent = EditorGUIUtility.TrTextContent("Offset", "Sets the offset for the decal Material. Moves the decal along its UV axes."); static readonly GUIContent k_OpacityContent = EditorGUIUtility.TrTextContent("Opacity", "Controls the transparency of the decal."); static readonly GUIContent k_Offset = EditorGUIUtility.TrTextContent("Pivot", "Controls the position of the pivot point of the decal."); + static readonly GUIContent k_NewMaterialButtonText = EditorGUIUtility.TrTextContent("New", "Creates a new decal Material asset template."); + static readonly string k_NewDecalMaterialText = "New Decal"; static readonly string k_BaseSceneEditingToolText = "Decal Scene Editing Mode: "; static readonly string k_EditShapeWithoutPreservingUVName = k_BaseSceneEditingToolText + "Scale"; static readonly string k_EditShapePreservingUVName = k_BaseSceneEditingToolText + "Crop"; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.cs index 09b57f54482..cf7b308e277 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalProjectorEditor.cs @@ -4,6 +4,7 @@ using UnityEditor.ShortcutManagement; using UnityEditorInternal; using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using static UnityEditorInternal.EditMode; @@ -626,7 +627,7 @@ public override void OnInspectorGUI() EditorGUILayout.Space(); EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(m_MaterialProperty, k_MaterialContent); + MaterialFieldWithButton(m_MaterialProperty, k_MaterialContent); materialChanged = EditorGUI.EndChangeCheck(); EditorUtils.DrawRenderingLayerMask(m_RenderingLayerMask, k_RenderingLayerMaskContent); @@ -729,6 +730,30 @@ public override void OnInspectorGUI() } } + internal void MaterialFieldWithButton(SerializedProperty prop, GUIContent label) + { + const int k_NewFieldWidth = 70; + + var rect = EditorGUILayout.GetControlRect(); + rect.xMax -= k_NewFieldWidth + 2; + + EditorGUI.PropertyField(rect, prop, label); + + var newFieldRect = rect; + newFieldRect.x = rect.xMax + 2; + newFieldRect.width = k_NewFieldWidth; + + if (GUI.Button(newFieldRect, k_NewMaterialButtonText)) + { + string materialName = k_NewDecalMaterialText + ".mat"; + var materialIcon = AssetPreview.GetMiniTypeThumbnail(typeof(Material)); + var action = ScriptableObject.CreateInstance(); + action.decalProjector = target as DecalProjector; + ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, action, materialName, materialIcon, null); + } + + } + [Shortcut("URP/Decal: Handle changing size stretching UV", typeof(SceneView), KeyCode.Keypad1, ShortcutModifiers.Action)] static void EnterEditModeWithoutPreservingUV(ShortcutArguments args) { @@ -796,4 +821,17 @@ static void ExitEditMode(ShortcutArguments args) QuitEditMode(); } } + + class DoCreateDecalDefaultMaterial : ProjectWindowCallback.EndNameEditAction + { + public DecalProjector decalProjector; + public override void Action(int instanceId, string pathName, string resourceFile) + { + var shader = DecalProjector.defaultMaterial.shader; + var material = new Material(shader); + AssetDatabase.CreateAsset(material, pathName); + ProjectWindowUtil.ShowCreatedAsset(material); + decalProjector.material = material; + } + } } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/Templates/URPDecal/PassGBuffer.template b/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/Templates/URPDecal/PassGBuffer.template index 09287c918d0..0b2b53f207f 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/Templates/URPDecal/PassGBuffer.template +++ b/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/Templates/URPDecal/PassGBuffer.template @@ -43,7 +43,9 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DecalInput.hlsl" #if _RENDER_PASS_ENABLED + #define GBUFFER3 0 #define GBUFFER4 1 + FRAMEBUFFER_INPUT_X_HALF(GBUFFER3); FRAMEBUFFER_INPUT_X_HALF(GBUFFER4); #endif diff --git a/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXDecal.template b/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXDecal.template index b57d8132580..09f18abbe69 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXDecal.template @@ -51,7 +51,7 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, out PositionInputs #endif -#if _RENDER_PASS_ENABLED && !defined(DECAL_RECONSTRUCT_NORMAL) +#if _RENDER_PASS_ENABLED float depth = LOAD_FRAMEBUFFER_X_INPUT(GBUFFER3, positionCS.xy).x; #else float depth = LoadSceneDepth(positionCS.xy); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXPasses.template b/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXPasses.template index f53b1184f51..da79d4d51c6 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXPasses.template +++ b/Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/VFXPasses.template @@ -47,6 +47,7 @@ ${VFXBegin:VFXPassGBufferAdditionalPragma} #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" //See Lit.shader, these multi_compile aren't used in GBuffer //#pragma multi_compile _ _ADDITIONAL_LIGHTS diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs index 64d6698adde..21f8a8de8a1 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.Universal { internal sealed partial class Renderer2D : ScriptableRenderer { - #if UNITY_SWITCH || UNITY_EMBEDDED_LINUX || UNITY_QNX + #if UNITY_SWITCH || UNITY_EMBEDDED_LINUX || UNITY_QNX || UNITY_ANDROID const GraphicsFormat k_DepthStencilFormat = GraphicsFormat.D24_UNorm_S8_UInt; #else const GraphicsFormat k_DepthStencilFormat = GraphicsFormat.D32_SFloat_S8_UInt; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalCameraData.cs b/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalCameraData.cs index 6e50635426a..6099d4b9d6c 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalCameraData.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalCameraData.cs @@ -442,12 +442,28 @@ public bool IsRenderTargetProjectionMatrixFlipped(RTHandle color, RTHandle depth return targetTexture != null || IsHandleYFlipped(color ?? depth); } + /// + /// Returns true if temporal anti-aliasing has been requested + /// Use IsTemporalAAEnabled() to ensure that TAA is active at runtime + /// + /// True if TAA is requested + internal bool IsTemporalAARequested() + { + return antialiasing == AntialiasingMode.TemporalAntiAliasing; + } + + /// + /// Returns true if the pipeline and the given camera are configured to render with temporal anti-aliasing post processing enabled + /// + /// Once selected, TAA necessitates some pre-requisites from the pipeline to run, mostly from the camera itself. + /// + /// True if TAA is enabled internal bool IsTemporalAAEnabled() { UniversalAdditionalCameraData additionalCameraData; camera.TryGetComponent(out additionalCameraData); - return (antialiasing == AntialiasingMode.TemporalAntiAliasing) // Enabled + return IsTemporalAARequested() // Requested && postProcessEnabled // Postprocessing Enabled && (taaHistory != null) // Initialized && (cameraTargetDescriptor.msaaSamples == 1) // No MSAA @@ -457,17 +473,27 @@ internal bool IsTemporalAAEnabled() } /// - /// Returns true if the pipeline is configured to render with the STP upscaler + /// Returns true if the STP upscaler has been requested + /// Use IsSTPEnabled() to ensure that STP upscaler is active at runtime, it necessitates TAA pre-processing + /// + /// True if STP is requested + internal bool IsSTPRequested() + { + return (imageScalingMode == ImageScalingMode.Upscaling) && (upscalingFilter == ImageUpscalingFilter.STP); + } + + /// + /// Returns true if the pipeline and the given camera are configured to render with the STP upscaler /// /// When STP runs, it relies on much of the existing TAA infrastructure provided by URP's native TAA. Due to this, URP forces the anti-aliasing mode to - /// TAA when STP is enabled to ensure that most TAA logic remains active. A side effect of this behavior is that STP inherits all of the same configuration + /// TAA when STP is requested to ensure that most TAA logic remains active. A side effect of this behavior is that STP inherits all of the same configuration /// restrictions as TAA and effectively cannot run if IsTemporalAAEnabled() returns false. The post processing pass logic that executes STP handles this /// situation and STP should behave identically to TAA in cases where TAA support requirements aren't met at runtime. /// /// True if STP is enabled internal bool IsSTPEnabled() { - return (imageScalingMode == ImageScalingMode.Upscaling) && (upscalingFilter == ImageUpscalingFilter.STP); + return IsSTPRequested() && IsTemporalAAEnabled(); } /// diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs index e2ea0124db6..8f2b5f0861d 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs @@ -10,57 +10,80 @@ namespace UnityEngine.Rendering.Universal.Internal /// public partial class AdditionalLightsShadowCasterPass : ScriptableRenderPass { - private static class AdditionalShadowsConstantBuffer - { - public static int _AdditionalLightsWorldToShadow; - public static int _AdditionalShadowParams; - public static int _AdditionalShadowOffset0; - public static int _AdditionalShadowOffset1; - public static int _AdditionalShadowFadeParams; - public static int _AdditionalShadowmapSize; - } - - /// - /// x is used in RenderAdditionalShadowMapAtlas to skip shadow map rendering for non-shadow-casting lights. - /// w is perLightFirstShadowSliceIndex, used in Lighting shader to find if Additional light casts shadows. - /// - readonly static Vector4 c_DefaultShadowParams = new Vector4(0, 0, 0, -1); - - static int m_AdditionalLightsWorldToShadow_SSBO; - static int m_AdditionalShadowParams_SSBO; - bool m_UseStructuredBuffer; - - const int k_ShadowmapBufferBits = 16; - private int m_AdditionalLightsShadowmapID; + // Internal internal RTHandle m_AdditionalLightsShadowmapHandle; + internal static Vector4[] s_EmptyAdditionalLightIndexToShadowParams = null; + // Private + private int renderTargetWidth; + private int renderTargetHeight; private bool m_CreateEmptyShadowmap; - private bool m_EmptyShadowmapNeedsClear = false; + private bool m_EmptyShadowmapNeedsClear; + private bool m_IssuedMessageAboutShadowSlicesTooMany; + private bool m_IssuedMessageAboutShadowMapsRescale; + private bool m_IssuedMessageAboutShadowMapsTooBig; + private bool m_IssuedMessageAboutRemovedShadowSlices; + private static bool m_IssuedMessageAboutPointLightHardShadowResolutionTooSmall; + private static bool m_IssuedMessageAboutPointLightSoftShadowResolutionTooSmall; + private readonly bool m_UseStructuredBuffer; + private float m_MaxShadowDistanceSq; + private float m_CascadeBorder; + private PassData m_PassData; private RTHandle m_EmptyAdditionalLightShadowmapTexture; + private bool[] m_VisibleLightIndexToIsCastingShadows; // maps a "global" visible light index (index to lightData.visibleLights) to a shadow casting state (Is the light casting shadows or not?) + private short[] m_VisibleLightIndexToAdditionalLightIndex; // maps a "global" visible light index (index to lightData.visibleLights) to an "additional light index" (index to arrays _AdditionalLightsPosition, _AdditionalShadowParams, ...), or -1 if it is not an additional light (i.e if it is the main light) + private short[] m_AdditionalLightIndexToVisibleLightIndex; // maps additional light index (index to arrays _AdditionalLightsPosition, _AdditionalShadowParams, ...) to its "global" visible light index (index to lightData.visibleLights) + private Vector4[] m_AdditionalLightIndexToShadowParams; // per-additional-light shadow info passed to the lighting shader (x: shadowStrength, y: softShadows, z: light type, w: perLightFirstShadowSliceIndex) + private List m_GlobalShadowSliceIndexToPerLightShadowSliceIndex = new(); // For each shadow slice, store its "per-light shadow slice index" in the punctual light that casts it (can be up to 5 for point lights) + private List m_ShadowSliceToAdditionalLightIndex = new (); // For each shadow slice, store the "additional light indices" of the punctual light that casts it + private Matrix4x4[] m_AdditionalLightShadowSliceIndexTo_WorldShadowMatrix; // per-shadow-slice info passed to the lighting shader + private ShadowSliceData[] m_AdditionalLightsShadowSlices; + private Dictionary m_ShadowRequestsHashes = new(); // used to keep track of changes in the shadow requests and shadow atlas configuration (per camera) + private ProfilingSampler m_ProfilingSetupSampler = new ProfilingSampler("Setup Additional Shadows"); + private RenderTextureDescriptor m_AdditionalLightShadowDescriptor; + + // Constants and Statics + private const int k_ShadowmapBufferBits = 16; private const int k_EmptyShadowMapDimensions = 1; private const string k_AdditionalLightShadowMapTextureName = "_AdditionalLightsShadowmapTexture"; private const string k_EmptyAdditionalLightShadowMapTextureName = "_EmptyAdditionalLightShadowmapTexture"; - internal static Vector4[] s_EmptyAdditionalLightIndexToShadowParams = null; - - float m_MaxShadowDistanceSq; - float m_CascadeBorder; - - ShadowSliceData[] m_AdditionalLightsShadowSlices = null; - - bool[] m_VisibleLightIndexToIsCastingShadows = null; // maps a "global" visible light index (index to lightData.visibleLights) to a shadow casting state (Is the light casting shadows or not?) - short[] m_VisibleLightIndexToAdditionalLightIndex = null; // maps a "global" visible light index (index to lightData.visibleLights) to an "additional light index" (index to arrays _AdditionalLightsPosition, _AdditionalShadowParams, ...), or -1 if it is not an additional light (i.e if it is the main light) - short[] m_AdditionalLightIndexToVisibleLightIndex = null; // maps additional light index (index to arrays _AdditionalLightsPosition, _AdditionalShadowParams, ...) to its "global" visible light index (index to lightData.visibleLights) - Vector4[] m_AdditionalLightIndexToShadowParams = null; // per-additional-light shadow info passed to the lighting shader (x: shadowStrength, y: softShadows, z: light type, w: perLightFirstShadowSliceIndex) - Matrix4x4[] m_AdditionalLightShadowSliceIndexTo_WorldShadowMatrix = null; // per-shadow-slice info passed to the lighting shader - List m_ShadowSliceToAdditionalLightIndex = new (); // For each shadow slice, store the "additional light indices" of the punctual light that casts it - List m_GlobalShadowSliceIndexToPerLightShadowSliceIndex = new(); // For each shadow slice, store its "per-light shadow slice index" in the punctual light that casts it (can be up to 5 for point lights) + // x is used in RenderAdditionalShadowMapAtlas to skip shadow map rendering for non-shadow-casting lights. + // w is perLightFirstShadowSliceIndex, used in Lighting shader to find if Additional light casts shadows. + readonly static Vector4 c_DefaultShadowParams = new Vector4(0, 0, 0, -1); + // Magic numbers used to identify light type when rendering shadow receiver. + // Keep in sync with AdditionalLightRealtimeShadow code in com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl + private const float LightTypeIdentifierInShadowParams_Spot = 0; + private const float LightTypeIdentifierInShadowParams_Point = 1; - int renderTargetWidth; - int renderTargetHeight; - private RenderTextureDescriptor m_AdditionalLightShadowDescriptor; + // Classes + private static class AdditionalShadowsConstantBuffer + { + public static int _AdditionalLightsWorldToShadow = Shader.PropertyToID("_AdditionalLightsWorldToShadow"); + public static int _AdditionalShadowParams = Shader.PropertyToID("_AdditionalShadowParams"); + public static int _AdditionalShadowOffset0 = Shader.PropertyToID("_AdditionalShadowOffset0"); + public static int _AdditionalShadowOffset1 = Shader.PropertyToID("_AdditionalShadowOffset1"); + public static int _AdditionalShadowFadeParams = Shader.PropertyToID("_AdditionalShadowFadeParams"); + public static int _AdditionalShadowmapSize = Shader.PropertyToID("_AdditionalShadowmapSize"); + public static int _AdditionalLightsShadowmapID = Shader.PropertyToID(k_AdditionalLightShadowMapTextureName); + public static int _AdditionalLightsWorldToShadow_SSBO = Shader.PropertyToID("_AdditionalLightsWorldToShadow_SSBO"); + public static int _AdditionalShadowParams_SSBO = Shader.PropertyToID("_AdditionalShadowParams_SSBO"); + } - ProfilingSampler m_ProfilingSetupSampler = new ProfilingSampler("Setup Additional Shadows"); - private PassData m_PassData; + private class PassData + { + internal int shadowmapID; + internal bool emptyShadowmap; + internal bool useStructuredBuffer; + internal bool stripShadowsOffVariants; + internal Matrix4x4 viewMatrix; + internal Vector2Int allocatedShadowAtlasSize; + internal TextureHandle shadowmapTexture; + internal RendererList[] shadowRendererLists = new RendererList[ShaderOptions.k_MaxVisibleLightCountDesktop]; + internal RendererListHandle[] shadowRendererListsHdl = new RendererListHandle[ShaderOptions.k_MaxVisibleLightCountDesktop]; + internal UniversalLightData lightData; + internal UniversalShadowData shadowData; + internal AdditionalLightsShadowCasterPass pass; + } /// /// Creates a new AdditionalLightsShadowCasterPass instance. @@ -73,17 +96,6 @@ public AdditionalLightsShadowCasterPass(RenderPassEvent evt) renderPassEvent = evt; m_PassData = new PassData(); - AdditionalShadowsConstantBuffer._AdditionalLightsWorldToShadow = Shader.PropertyToID("_AdditionalLightsWorldToShadow"); - AdditionalShadowsConstantBuffer._AdditionalShadowParams = Shader.PropertyToID("_AdditionalShadowParams"); - AdditionalShadowsConstantBuffer._AdditionalShadowOffset0 = Shader.PropertyToID("_AdditionalShadowOffset0"); - AdditionalShadowsConstantBuffer._AdditionalShadowOffset1 = Shader.PropertyToID("_AdditionalShadowOffset1"); - AdditionalShadowsConstantBuffer._AdditionalShadowFadeParams = Shader.PropertyToID("_AdditionalShadowFadeParams"); - AdditionalShadowsConstantBuffer._AdditionalShadowmapSize = Shader.PropertyToID("_AdditionalShadowmapSize"); - m_AdditionalLightsShadowmapID = Shader.PropertyToID(k_AdditionalLightShadowMapTextureName); - - m_AdditionalLightsWorldToShadow_SSBO = Shader.PropertyToID("_AdditionalLightsWorldToShadow_SSBO"); - m_AdditionalShadowParams_SSBO = Shader.PropertyToID("_AdditionalShadowParams_SSBO"); - m_UseStructuredBuffer = RenderingUtils.useStructuredBuffer; // Preallocated a fixed size. CommandBuffer.SetGlobal* does allow this data to grow. @@ -104,11 +116,9 @@ public AdditionalLightsShadowCasterPass(RenderPassEvent evt) for (int i = 0; i < s_EmptyAdditionalLightIndexToShadowParams.Length; i++) s_EmptyAdditionalLightIndexToShadowParams[i] = c_DefaultShadowParams; + // Uniform buffers are faster on some platforms, but they have stricter size limitations if (!m_UseStructuredBuffer) - { - // Uniform buffers are faster on some platforms, but they have stricter size limitations m_AdditionalLightShadowSliceIndexTo_WorldShadowMatrix = new Matrix4x4[maxVisibleAdditionalLights]; - } m_EmptyShadowmapNeedsClear = true; } @@ -122,12 +132,6 @@ public void Dispose() m_EmptyAdditionalLightShadowmapTexture?.Release(); } - // Magic numbers used to identify light type when rendering shadow receiver. - // Keep in sync with AdditionalLightRealtimeShadow code in com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl - private const float LightTypeIdentifierInShadowParams_Spot = 0; - private const float LightTypeIdentifierInShadowParams_Point = 1; - - // Returns the guard angle that must be added to a frustum angle covering a projection map of resolution sliceResolutionInTexels, // in order to also cover a guard band of size guardBandSizeInTexels around the projection map. // Formula illustrated in https://i.ibb.co/wpW5Mnf/Calc-Guard-Angle.png @@ -152,7 +156,6 @@ internal static float CalcGuardAngle(float frustumAngleInDegrees, float guardBan return guardAngleInDegree; } - // Returns the guard angle that must be added to a point light shadow face frustum angle // in order to avoid shadows missing at the boundaries between cube faces. internal static float GetPointLightShadowFrustumFovBiasInDegrees(int shadowSliceResolution, bool shadowFiltering) @@ -166,7 +169,6 @@ internal static float GetPointLightShadowFrustumFovBiasInDegrees(int shadowSlice return fudgeFactor * CalcGuardAngle(90, shadowFiltering ? 5 : 1, shadowSliceResolution); #endif - float fovBias = 4.00f; // Empirical value found to remove gaps between point light shadow faces in test scenes. @@ -229,16 +231,7 @@ internal static float GetPointLightShadowFrustumFovBiasInDegrees(int shadowSlice return fovBias; } - private bool m_IssuedMessageAboutShadowSlicesTooMany = false; - private bool m_IssuedMessageAboutShadowMapsRescale = false; - private bool m_IssuedMessageAboutShadowMapsTooBig = false; - private bool m_IssuedMessageAboutRemovedShadowSlices = false; - private static bool m_IssuedMessageAboutPointLightHardShadowResolutionTooSmall = false; - private static bool m_IssuedMessageAboutPointLightSoftShadowResolutionTooSmall = false; - - Dictionary m_ShadowRequestsHashes = new Dictionary(); // used to keep track of changes in the shadow requests and shadow atlas configuration (per camera) - - ulong ResolutionLog2ForHash(int resolution) + private ulong ResolutionLog2ForHash(int resolution) { switch (resolution) { @@ -250,7 +243,7 @@ ulong ResolutionLog2ForHash(int resolution) return 08; } - ulong ComputeShadowRequestHash(UniversalLightData lightData, UniversalShadowData shadowData) + private ulong ComputeShadowRequestHash(UniversalLightData lightData, UniversalShadowData shadowData) { ulong numberOfShadowedPointLights = 0; ulong numberOfSoftShadowedLights = 0; @@ -605,7 +598,7 @@ private void UpdateTextureDescriptorIfNeeded() } } - bool SetupForEmptyRendering(bool stripShadowsOffVariants, UniversalShadowData shadowData) + private bool SetupForEmptyRendering(bool stripShadowsOffVariants, UniversalShadowData shadowData) { if (!stripShadowsOffVariants) return false; @@ -636,12 +629,6 @@ public override void Configure(CommandBuffer cmd, RenderTextureDescriptor camera if (!m_EmptyShadowmapNeedsClear) { - // UUM-63146 - glClientWaitSync: Expected application to have kicked everything until job: 96089 (possibly by calling glFlush)" are thrown in the Android Player on some devices with PowerVR Rogue GE8320 - // Resetting of target would clean up the color attachment buffers and depth attachment buffers, which inturn is preventing the leak in the said platform. This is likely a symptomatic fix, but is solving the problem for now. - - if (Application.platform == RuntimePlatform.Android && PlatformAutoDetect.isRunningOnPowerVRGPU) - ResetTarget(); - return; } @@ -668,7 +655,7 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData if (m_CreateEmptyShadowmap) { SetEmptyAdditionalShadowmapAtlas(CommandBufferHelpers.GetRasterCommandBuffer(renderingData.commandBuffer)); - universalRenderingData.commandBuffer.SetGlobalTexture(m_AdditionalLightsShadowmapID, m_EmptyAdditionalLightShadowmapTexture); + universalRenderingData.commandBuffer.SetGlobalTexture(AdditionalShadowsConstantBuffer._AdditionalLightsShadowmapID, m_EmptyAdditionalLightShadowmapTexture); return; } @@ -682,7 +669,7 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData m_PassData.allocatedShadowAtlasSize = m_AdditionalLightsShadowmapHandle.referenceSize; InitRendererLists(ref universalRenderingData.cullResults, ref m_PassData, context, default(RenderGraph), false); RenderAdditionalShadowmapAtlas(CommandBufferHelpers.GetRasterCommandBuffer(universalRenderingData.commandBuffer), ref m_PassData, false); - universalRenderingData.commandBuffer.SetGlobalTexture(m_AdditionalLightsShadowmapID, m_AdditionalLightsShadowmapHandle.nameID); + universalRenderingData.commandBuffer.SetGlobalTexture(AdditionalShadowsConstantBuffer._AdditionalLightsShadowmapID, m_AdditionalLightsShadowmapHandle.nameID); } /// @@ -698,13 +685,13 @@ public int GetShadowLightIndexFromLightIndex(int visibleLightIndex) return m_VisibleLightIndexToAdditionalLightIndex[visibleLightIndex]; } - void Clear() + private void Clear() { m_ShadowSliceToAdditionalLightIndex.Clear(); m_GlobalShadowSliceIndexToPerLightShadowSliceIndex.Clear(); } - void SetEmptyAdditionalShadowmapAtlas(RasterCommandBuffer cmd) + private void SetEmptyAdditionalShadowmapAtlas(RasterCommandBuffer cmd) { cmd.EnableKeyword(ShaderGlobalKeywords.AdditionalLightShadows); SetEmptyAdditionalLightShadowParams(cmd, m_AdditionalLightIndexToShadowParams); @@ -716,7 +703,7 @@ internal static void SetEmptyAdditionalLightShadowParams(RasterCommandBuffer cmd { ComputeBuffer shadowParamsBuffer = ShaderData.instance.GetAdditionalLightShadowParamsStructuredBuffer(lightIndexToShadowParams.Length); shadowParamsBuffer.SetData(lightIndexToShadowParams); - cmd.SetGlobalBuffer(m_AdditionalShadowParams_SSBO, shadowParamsBuffer); + cmd.SetGlobalBuffer(AdditionalShadowsConstantBuffer._AdditionalShadowParams_SSBO, shadowParamsBuffer); } else { @@ -724,7 +711,7 @@ internal static void SetEmptyAdditionalLightShadowParams(RasterCommandBuffer cmd } } - void RenderAdditionalShadowmapAtlas(RasterCommandBuffer cmd, ref PassData data, bool useRenderGraph) + private void RenderAdditionalShadowmapAtlas(RasterCommandBuffer cmd, ref PassData data, bool useRenderGraph) { NativeArray visibleLights = data.lightData.visibleLights; @@ -802,19 +789,19 @@ void RenderAdditionalShadowmapAtlas(RasterCommandBuffer cmd, ref PassData data, } // Set constant buffer data that will be used during the lighting/shadowing pass - void SetupAdditionalLightsShadowReceiverConstants(RasterCommandBuffer cmd, Vector2Int allocatedShadowAtlasSize, bool useStructuredBuffer, bool softShadows) + private void SetupAdditionalLightsShadowReceiverConstants(RasterCommandBuffer cmd, Vector2Int allocatedShadowAtlasSize, bool useStructuredBuffer, bool softShadows) { if (useStructuredBuffer) { // per-light data var shadowParamsBuffer = ShaderData.instance.GetAdditionalLightShadowParamsStructuredBuffer(m_AdditionalLightIndexToShadowParams.Length); shadowParamsBuffer.SetData(m_AdditionalLightIndexToShadowParams); - cmd.SetGlobalBuffer(m_AdditionalShadowParams_SSBO, shadowParamsBuffer); + cmd.SetGlobalBuffer(AdditionalShadowsConstantBuffer._AdditionalShadowParams_SSBO, shadowParamsBuffer); // per-shadow-slice data var shadowSliceMatricesBuffer = ShaderData.instance.GetAdditionalLightShadowSliceMatricesStructuredBuffer(m_AdditionalLightShadowSliceIndexTo_WorldShadowMatrix.Length); shadowSliceMatricesBuffer.SetData(m_AdditionalLightShadowSliceIndexTo_WorldShadowMatrix); - cmd.SetGlobalBuffer(m_AdditionalLightsWorldToShadow_SSBO, shadowSliceMatricesBuffer); + cmd.SetGlobalBuffer(AdditionalShadowsConstantBuffer._AdditionalLightsWorldToShadow_SSBO, shadowSliceMatricesBuffer); } else { @@ -842,26 +829,6 @@ void SetupAdditionalLightsShadowReceiverConstants(RasterCommandBuffer cmd, Vecto } } - private class PassData - { - internal UniversalLightData lightData; - internal UniversalShadowData shadowData; - internal Matrix4x4 viewMatrix; - internal bool stripShadowsOffVariants; - - internal AdditionalLightsShadowCasterPass pass; - - internal TextureHandle shadowmapTexture; - internal int shadowmapID; - internal bool useStructuredBuffer; - internal Vector2Int allocatedShadowAtlasSize; - - internal bool emptyShadowmap; - - internal RendererListHandle[] shadowRendererListsHdl = new RendererListHandle[ShaderOptions.k_MaxVisibleLightCountDesktop]; - internal RendererList[] shadowRendererLists = new RendererList[ShaderOptions.k_MaxVisibleLightCountDesktop]; - } - private void InitPassData(ref PassData passData, UniversalCameraData cameraData, UniversalLightData lightData, UniversalShadowData shadowData) { passData.pass = this; @@ -872,11 +839,11 @@ private void InitPassData(ref PassData passData, UniversalCameraData cameraData, passData.stripShadowsOffVariants = cameraData.renderer.stripShadowsOffVariants; passData.emptyShadowmap = m_CreateEmptyShadowmap; - passData.shadowmapID = m_AdditionalLightsShadowmapID; + passData.shadowmapID = AdditionalShadowsConstantBuffer._AdditionalLightsShadowmapID; passData.useStructuredBuffer = m_UseStructuredBuffer; } - void InitEmptyPassData(ref PassData passData, UniversalCameraData cameraData, UniversalLightData lightData, UniversalShadowData shadowData) + private void InitEmptyPassData(ref PassData passData, UniversalCameraData cameraData, UniversalLightData lightData, UniversalShadowData shadowData) { passData.pass = this; @@ -885,7 +852,7 @@ void InitEmptyPassData(ref PassData passData, UniversalCameraData cameraData, Un passData.stripShadowsOffVariants = cameraData.renderer.stripShadowsOffVariants; passData.emptyShadowmap = m_CreateEmptyShadowmap; - passData.shadowmapID = m_AdditionalLightsShadowmapID; + passData.shadowmapID = AdditionalShadowsConstantBuffer._AdditionalLightsShadowmapID; } private void InitRendererLists(ref CullingResults cullResults, ref PassData passData, ScriptableRenderContext context, RenderGraph renderGraph, bool useRenderGraph) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs index 1ff4cb64c77..0ad302b9652 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/MainLightShadowCasterPass.cs @@ -35,7 +35,7 @@ public class MainLightShadowCasterPass : ScriptableRenderPass private const int k_ShadowmapBufferBits = 16; private const string k_MainLightShadowMapTextureName = "_MainLightShadowmapTexture"; private const string k_EmptyMainLightShadowMapTextureName = "_EmptyMainLightShadowmapTexture"; - private static readonly Vector4 s_EmptyShadowParams = new (1, 0, 1, 0); + private static readonly Vector4 s_EmptyShadowParams = new (0f, 0f, 1f, 0f); private static readonly Vector4 s_EmptyShadowmapSize = new (k_EmptyShadowMapDimensions, 1f / k_EmptyShadowMapDimensions, k_EmptyShadowMapDimensions, k_EmptyShadowMapDimensions); // Classes @@ -54,6 +54,22 @@ private static class MainLightShadowConstantBuffer public static readonly int _MainLightShadowmapID = Shader.PropertyToID(k_MainLightShadowMapTextureName); } + private class PassData + { + internal UniversalRenderingData renderingData; + internal UniversalCameraData cameraData; + internal UniversalLightData lightData; + internal UniversalShadowData shadowData; + + internal MainLightShadowCasterPass pass; + + internal TextureHandle shadowmapTexture; + internal bool emptyShadowmap; + + internal RendererListHandle[] shadowRendererListsHandle = new RendererListHandle[k_MaxCascades]; + internal RendererList[] shadowRendererLists = new RendererList[k_MaxCascades]; + } + /// /// Creates a new MainLightShadowCasterPass instance. /// @@ -201,14 +217,7 @@ public override void Configure(CommandBuffer cmd, RenderTextureDescriptor camera m_EmptyShadowmapNeedsClear = true; if (!m_EmptyShadowmapNeedsClear) - { - // UUM-63146 - glClientWaitSync: Expected application to have kicked everything until job: 96089 (possibly by calling glFlush)" are thrown in the Android Player on some devices with PowerVR Rogue GE8320 - // Resetting of target would clean up the color attachment buffers and depth attachment buffers, which inturn is preventing the leak in the said platform. This is likely a symptomatic fix, but is solving the problem for now. - if (Application.platform == RuntimePlatform.Android && PlatformAutoDetect.isRunningOnPowerVRGPU) - ResetTarget(); - return; - } ConfigureTarget(m_EmptyMainLightShadowmapTexture); m_EmptyShadowmapNeedsClear = false; @@ -375,22 +384,6 @@ void SetupMainLightShadowReceiverConstants(RasterCommandBuffer cmd, ref VisibleL } } - private class PassData - { - internal UniversalRenderingData renderingData; - internal UniversalCameraData cameraData; - internal UniversalLightData lightData; - internal UniversalShadowData shadowData; - - internal MainLightShadowCasterPass pass; - - internal TextureHandle shadowmapTexture; - internal bool emptyShadowmap; - - internal RendererListHandle[] shadowRendererListsHandle = new RendererListHandle[k_MaxCascades]; - internal RendererList[] shadowRendererLists = new RendererList[k_MaxCascades]; - } - private void InitPassData( ref PassData passData, UniversalRenderingData renderingData, 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 c0469c81572..0d61eeb7bd9 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs @@ -463,7 +463,7 @@ void Render(CommandBuffer cmd, ref RenderingData renderingData) // disable useTemporalAA if another feature is disabled) then we need to put it in CameraData::IsTemporalAAEnabled() as opposed // to tweaking the value here. bool useTemporalAA = cameraData.IsTemporalAAEnabled(); - if (cameraData.antialiasing == AntialiasingMode.TemporalAntiAliasing && !useTemporalAA) + if (cameraData.IsTemporalAARequested() && !useTemporalAA) TemporalAA.ValidateAndWarn(cameraData); int amountOfPassesRemaining = (useStopNan ? 1 : 0) + (useSubPixeMorpAA ? 1 : 0) + (useDepthOfField ? 1 : 0) + (useLensFlare ? 1 : 0) + (useTemporalAA ? 1 : 0) + (useMotionBlur ? 1 : 0) + (usePaniniProjection ? 1 : 0); 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 6e083d54b17..48282b7dbf9 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs @@ -1996,12 +1996,15 @@ public void RenderPostProcessingRenderGraph(RenderGraph renderGraph, ContextCont // disable useTemporalAA if another feature is disabled) then we need to put it in CameraData::IsTemporalAAEnabled() as opposed // to tweaking the value here. bool useTemporalAA = cameraData.IsTemporalAAEnabled(); - if (cameraData.antialiasing == AntialiasingMode.TemporalAntiAliasing && !useTemporalAA) - TemporalAA.ValidateAndWarn(cameraData); - // STP is only supported when TAA is enabled and all of its runtime requirements are met. - // See the comments for IsSTPEnabled() for more information. - bool useSTP = useTemporalAA && cameraData.IsSTPEnabled(); + // STP is only enabled when TAA is enabled and all of its runtime requirements are met. + // Using IsSTPRequested() vs IsSTPEnabled() for perf reason here, as we already know TAA status + bool isSTPRequested = cameraData.IsSTPRequested(); + bool useSTP = useTemporalAA && isSTPRequested; + + // Warn users if TAA and STP are disabled despite being requested + if (!useTemporalAA && cameraData.IsTemporalAARequested()) + TemporalAA.ValidateAndWarn(cameraData, isSTPRequested); using (var builder = renderGraph.AddRasterRenderPass("Setup PostFX passes", out var passData, ProfilingSampler.Get(URPProfileId.RG_SetupPostFX))) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/TransparentSettingsPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/TransparentSettingsPass.cs index 85cfa3182e0..6a96fc30918 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/TransparentSettingsPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/TransparentSettingsPass.cs @@ -37,11 +37,11 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData } public static void ExecutePass(RasterCommandBuffer cmd, bool shouldReceiveShadows) - { + { // This pass is only used when transparent objects should not // receive shadows using the setting on the URP Renderer. MainLightShadowCasterPass.SetEmptyMainLightShadowParams(cmd); - AdditionalLightsShadowCasterPass.SetEmptyAdditionalLightShadowParams(cmd, AdditionalLightsShadowCasterPass.s_EmptyAdditionalLightIndexToShadowParams); + AdditionalLightsShadowCasterPass.SetEmptyAdditionalLightShadowParams(cmd, AdditionalLightsShadowCasterPass.s_EmptyAdditionalLightIndexToShadowParams); } } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineRuntimeXRResources.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineRuntimeXRResources.cs index 78deddd90b9..641135dbf9a 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineRuntimeXRResources.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RenderPipelineResources/UniversalRenderPipelineRuntimeXRResources.cs @@ -1,4 +1,3 @@ -#if ENABLE_VR && ENABLE_XR_MODULE using System; namespace UnityEngine.Rendering.Universal @@ -34,7 +33,7 @@ public Shader xrOcclusionMeshPS [SerializeField] [ResourcePath("Shaders/XR/XRMirrorView.shader")] - public Shader m_xrMirrorViewPS; + private Shader m_xrMirrorViewPS; /// /// XR Mirror View shader. @@ -47,7 +46,7 @@ public Shader xrMirrorViewPS [SerializeField] [ResourcePath("Shaders/XR/XRMotionVector.shader")] - public Shader m_xrMotionVector; + private Shader m_xrMotionVector; /// /// XR MotionVector shader. @@ -76,4 +75,3 @@ internal bool valid } } } -#endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs index b759431eb72..651504ed1dc 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs @@ -125,7 +125,17 @@ static Material errorMaterial /// Projection matrix to be set. /// Set this to true if you also need to set inverse camera matrices. public static void SetViewAndProjectionMatrices(CommandBuffer cmd, Matrix4x4 viewMatrix, Matrix4x4 projectionMatrix, bool setInverseMatrices) { SetViewAndProjectionMatrices(CommandBufferHelpers.GetRasterCommandBuffer(cmd), viewMatrix, projectionMatrix, setInverseMatrices); } - internal static void SetViewAndProjectionMatrices(RasterCommandBuffer cmd, Matrix4x4 viewMatrix, Matrix4x4 projectionMatrix, bool setInverseMatrices) + + /// + /// Set view and projection matrices. + /// This function will set UNITY_MATRIX_V, UNITY_MATRIX_P, UNITY_MATRIX_VP to given view and projection matrices. + /// If setInverseMatrices is set to true this function will also set UNITY_MATRIX_I_V and UNITY_MATRIX_I_VP. + /// + /// RasterCommandBuffer to submit data to GPU. + /// View matrix to be set. + /// Projection matrix to be set. + /// Set this to true if you also need to set inverse camera matrices. + public static void SetViewAndProjectionMatrices(RasterCommandBuffer cmd, Matrix4x4 viewMatrix, Matrix4x4 projectionMatrix, bool setInverseMatrices) { Matrix4x4 viewAndProjectionMatrix = projectionMatrix * viewMatrix; cmd.SetGlobalMatrix(ShaderPropertyId.viewMatrix, viewMatrix); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/TemporalAA.cs b/Packages/com.unity.render-pipelines.universal/Runtime/TemporalAA.cs index cdbfe3fc43a..b0da32158d6 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/TemporalAA.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/TemporalAA.cs @@ -337,47 +337,47 @@ internal static RenderTextureDescriptor TemporalAADescFromCameraDesc(ref RenderT static uint s_warnCounter = 0; - internal static string ValidateAndWarn(UniversalCameraData cameraData) + internal static string ValidateAndWarn(UniversalCameraData cameraData, bool isSTPRequested = false) { - string warning = null; + string reasonWarning = null; - if(warning == null && !cameraData.postProcessEnabled) - warning = "Disabling TAA because camera has post-processing disabled."; + if(reasonWarning == null && !cameraData.postProcessEnabled) + reasonWarning = "because camera has post-processing disabled."; if (cameraData.taaHistory == null) { - warning = "Disabling TAA due to invalid persistent data."; + reasonWarning = "due to invalid persistent data."; } - if (warning == null && cameraData.cameraTargetDescriptor.msaaSamples != 1) + if (reasonWarning == null && cameraData.cameraTargetDescriptor.msaaSamples != 1) { if (cameraData.xr != null && cameraData.xr.enabled) - warning = "Disabling TAA because MSAA is on. MSAA must be disabled globally for all cameras in XR mode."; + reasonWarning = "because MSAA is on. MSAA must be disabled globally for all cameras in XR mode."; else - warning = "Disabling TAA because MSAA is on. Turn MSAA off on the camera or current URP Asset to enable TAA."; + reasonWarning = "because MSAA is on. Turn MSAA off on the camera or current URP Asset."; } - if(warning == null && cameraData.camera.TryGetComponent(out var additionalCameraData)) + if(reasonWarning == null && cameraData.camera.TryGetComponent(out var additionalCameraData)) { if (additionalCameraData.renderType == CameraRenderType.Overlay || additionalCameraData.cameraStack.Count > 0) { - warning = "Disabling TAA because camera is stacked."; + reasonWarning = "because camera is stacked."; } } - if (warning == null && cameraData.camera.allowDynamicResolution) - warning = "Disabling TAA because camera has dynamic resolution enabled. You can use a constant render scale instead."; + if (reasonWarning == null && cameraData.camera.allowDynamicResolution) + reasonWarning = "because camera has dynamic resolution enabled. You can use a constant render scale instead."; - if(warning == null && !cameraData.renderer.SupportsMotionVectors()) - warning = "Disabling TAA because the renderer does not implement motion vectors. Motion vectors are required for TAA."; + if(reasonWarning == null && !cameraData.renderer.SupportsMotionVectors()) + reasonWarning = "because the renderer does not implement motion vectors. Motion vectors are required."; const int warningThrottleFrames = 60 * 1; // 60 FPS * 1 sec if (s_warnCounter % warningThrottleFrames == 0) - Debug.LogWarning(warning); + Debug.LogWarning("Disabling TAA " + (isSTPRequested ? "and STP " : "") + reasonWarning); s_warnCounter++; - return warning; + return reasonWarning; } internal static void ExecutePass(CommandBuffer cmd, Material taaMaterial, ref CameraData cameraData, RTHandle source, RTHandle destination, RenderTexture motionVectors) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs index 38e59686622..5feb085ed99 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs @@ -1426,12 +1426,12 @@ static void InitializeStackedCameraData(Camera baseCamera, UniversalAdditionalCa } else if ((cameraData.renderScale < 1.0f) || (!isScenePreviewOrReflectionCamera && ((cameraData.upscalingFilter == ImageUpscalingFilter.FSR) || (cameraData.upscalingFilter == ImageUpscalingFilter.STP)))) { - // When certain upscalers are enabled, we still consider 100% render scale an upscaling operation. (This behavior is only intended for game view cameras) + // When certain upscalers are requested, we still consider 100% render scale an upscaling operation. (This behavior is only intended for game view cameras) // This allows us to run the upscaling shader passes all the time since they improve visual quality even at 100% scale. cameraData.imageScalingMode = ImageScalingMode.Upscaling; - // When STP is enabled, we force temporal anti-aliasing on since it's a prerequisite. + // When STP is requested, we force temporal anti-aliasing on since it's a prerequisite. if (cameraData.upscalingFilter == ImageUpscalingFilter.STP) { cameraData.antialiasing = AntialiasingMode.TemporalAntiAliasing; @@ -1512,7 +1512,6 @@ static void InitializeAdditionalCameraData(Camera camera, UniversalAdditionalCam } cameraData.renderer = renderer; - cameraData.requiresDepthTexture |= isSceneViewCamera; cameraData.postProcessingRequiresDepthTexture = CheckPostProcessForDepth(cameraData); cameraData.resolveFinalTarget = resolveFinalTarget; @@ -1870,7 +1869,7 @@ private static void UpdateTemporalAATargets(UniversalCameraData cameraData) xrMultipassEnabled = cameraData.xr.enabled && !cameraData.xr.singlePassEnabled; #endif bool allocation; - if (cameraData.IsSTPEnabled()) + if (cameraData.IsSTPRequested()) { Debug.Assert(cameraData.stpHistory != null); @@ -1893,9 +1892,9 @@ private static void UpdateTemporalAATargets(UniversalCameraData cameraData) { cameraData.taaHistory.Reset(); // TAA GPUResources is explicitly released if the feature is turned off. We could refactor this to rely on the type request and the "gc" only. - // In the case where STP is enabled, but TAA gets disabled for various reasons, we should release the STP history resources - if (cameraData.IsSTPEnabled()) - cameraData.stpHistory.Reset(); + // In the case where STP is requested, but TAA gets disabled for various reasons so STP is disabled, we should release the STP history resources + if (cameraData.IsSTPRequested()) + cameraData.stpHistory?.Reset(); } } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 5723c41e879..9e6546536f8 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -136,6 +136,7 @@ protected internal override bool SupportsMotionVectors() RTHandle m_ColorFrontBuffer; internal RTHandle m_ActiveCameraDepthAttachment; internal RTHandle m_CameraDepthAttachment; + internal RTHandle m_CameraDepthAttachment_D3d_11; RTHandle m_TargetColorHandle; RTHandle m_TargetDepthHandle; internal RTHandle m_DepthTexture; @@ -441,6 +442,7 @@ internal override void ReleaseRenderTargets() m_AdditionalLightsShadowCasterPass?.Dispose(); m_CameraDepthAttachment?.Release(); + m_CameraDepthAttachment_D3d_11?.Release(); m_DepthTexture?.Release(); m_NormalsTexture?.Release(); m_DecalLayersTexture?.Release(); @@ -988,6 +990,9 @@ public override void Setup(ScriptableRenderContext context, ref RenderingData re // Assign camera targets (color and depth) ConfigureCameraTarget(m_ActiveCameraColorAttachment, m_ActiveCameraDepthAttachment); + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11) + cmd.CopyTexture(m_CameraDepthAttachment, m_CameraDepthAttachment_D3d_11); + bool hasPassesAfterPostProcessing = activeRenderPassQueue.Find(x => x.renderPassEvent == RenderPassEvent.AfterRenderingPostProcessing) != null; if (mainLightShadows) @@ -1820,7 +1825,14 @@ void CreateCameraRenderTarget(ScriptableRenderContext context, ref RenderTexture depthDescriptor.graphicsFormat = GraphicsFormat.None; depthDescriptor.depthStencilFormat = cameraDepthAttachmentFormat; RenderingUtils.ReAllocateHandleIfNeeded(ref m_CameraDepthAttachment, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment"); - cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment.nameID); + + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11) + { + RenderingUtils.ReAllocateHandleIfNeeded(ref m_CameraDepthAttachment_D3d_11, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment_Temp"); + cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment_D3d_11.nameID); + } + else + cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment.nameID); // update the descriptor to match the depth attachment descriptor.depthStencilFormat = depthDescriptor.depthStencilFormat; @@ -1889,7 +1901,7 @@ bool RequiresIntermediateColorTexture(UniversalCameraData cameraData, ref Render if (isOffscreenRender) return requiresBlitForOffscreenCamera; - return requiresBlitForOffscreenCamera || isSceneViewCamera || isScaledRender || cameraData.isHdrEnabled || + return requiresBlitForOffscreenCamera || isScaledRender || cameraData.isHdrEnabled || !isCompatibleBackbufferTextureDimension || isCapturing || cameraData.requireSrgbConversion || renderPassInputs.requiresColorTexture || renderPassInputs.requiresColorTextureCreated; } diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs index 7ba71d9f9ae..24e648c04b5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRendererRenderGraph.cs @@ -282,25 +282,21 @@ bool CameraHasPostProcessingWithDepth(UniversalCameraData cameraData) return ShouldApplyPostProcessing(cameraData.postProcessEnabled) && cameraData.postProcessingRequiresDepthTexture; } - void RequiresColorAndDepthAttachments(RenderGraph renderGraph, out bool createColorTexture, out bool createDepthTexture, UniversalCameraData cameraData, ref RenderPassInputSummary renderPassInputs) + bool RequiresIntermediateAttachments(UniversalCameraData cameraData, ref RenderPassInputSummary renderPassInputs) { - bool isPreviewCamera = cameraData.isPreviewCamera; bool requiresDepthPrepass = RequireDepthPrepass(cameraData, ref renderPassInputs); var requireColorTexture = HasActiveRenderFeatures() && m_IntermediateTextureMode == IntermediateTextureMode.Always; requireColorTexture |= HasPassesRequiringIntermediateTexture(); requireColorTexture |= Application.isEditor && m_Clustering; requireColorTexture |= RequiresIntermediateColorTexture(cameraData, ref renderPassInputs); - requireColorTexture &= !isPreviewCamera; var requireDepthTexture = RequireDepthTexture(cameraData, requiresDepthPrepass, ref renderPassInputs); useDepthPriming = IsDepthPrimingEnabled(cameraData); // Intermediate texture has different yflip state than backbuffer. In case we use intermediate texture, we must use both color and depth together. - bool intermediateRenderTexture = (requireColorTexture || requireDepthTexture); - createDepthTexture = intermediateRenderTexture; - createColorTexture = intermediateRenderTexture; + return (requireColorTexture || requireDepthTexture); } // Gather history render requests and manage camera history texture life-time. @@ -437,8 +433,7 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera // We configure this for the first camera of the stack and overlay camera will reuse create color/depth var // to pick the correct target, as if there is an intermediate texture, overlay cam should use them if (cameraData.renderType == CameraRenderType.Base) - RequiresColorAndDepthAttachments(renderGraph, out m_CreateColorAttachment, out m_CreateDepthAttachment, cameraData, ref renderPassInputs); - + m_RequiresIntermediateAttachments = RequiresIntermediateAttachments(cameraData, ref renderPassInputs); // The final output back buffer should be cleared by the graph on first use only if we have no final blit pass. // If there is a final blit, that blit will write the buffers so on first sight an extra clear should not be problem, @@ -446,7 +441,7 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera // with a Viewport Rect smaller than the full screen. So the existing backbuffer contents need to be preserved in this case. // Finally for non-base cameras the backbuffer should never be cleared. (Note that there might still be two base cameras // rendering to the same screen. See e.g. test foundation 014 that renders a minimap) - bool clearBackbufferOnFirstUse = (cameraData.renderType == CameraRenderType.Base) && !m_CreateColorAttachment; + bool clearBackbufferOnFirstUse = (cameraData.renderType == CameraRenderType.Base) && !m_RequiresIntermediateAttachments; // force the clear if we are rendering to an offscreen depth texture clearBackbufferOnFirstUse |= isCameraTargetOffscreenDepth; @@ -457,9 +452,9 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera // We cannot use directly !cameraData.rendersOverlayUI but this is similar logic bool isNativeUIOverlayRenderingAfterURP = !SupportedRenderingFeatures.active.rendersUIOverlay && cameraData.resolveToScreen; bool isNativeRenderingAfterURP = UnityEngine.Rendering.Watermark.IsVisible() || isNativeUIOverlayRenderingAfterURP; - // If MSAA > 1, no extra native rendering after SRP and we target the BB directly (!m_CreateColorAttachment) + // If MSAA > 1, no extra native rendering after SRP and we target the BB directly (!m_RequiresIntermediateAttachments) // then we can discard MSAA buffers and only resolve, otherwise we must store and resolve - bool noStoreOnlyResolveBBColor = !m_CreateColorAttachment && !isNativeRenderingAfterURP && (cameraData.cameraTargetDescriptor.msaaSamples > 1); + bool noStoreOnlyResolveBBColor = !m_RequiresIntermediateAttachments && !isNativeRenderingAfterURP && (cameraData.cameraTargetDescriptor.msaaSamples > 1); ImportResourceParams importBackbufferColorParams = new ImportResourceParams(); importBackbufferColorParams.clearOnFirstUse = clearBackbufferOnFirstUse; @@ -500,7 +495,7 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera { // Backbuffer is the final render target, we obtain its number of MSAA samples through Screen API // in some cases we disable multisampling for optimization purpose - int numSamples = AdjustAndGetScreenMSAASamples(renderGraph, m_CreateColorAttachment); + int numSamples = AdjustAndGetScreenMSAASamples(renderGraph, m_RequiresIntermediateAttachments); //BuiltinRenderTextureType.CameraTarget so this is either system render target or camera.targetTexture if non null //NOTE: Careful what you use here as many of the properties bake-in the camera rect so for example @@ -560,7 +555,7 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera #region Intermediate Camera Target - if (m_CreateColorAttachment && !isCameraTargetOffscreenDepth) + if (m_RequiresIntermediateAttachments && !isCameraTargetOffscreenDepth) { var cameraTargetDescriptor = cameraData.cameraTargetDescriptor; cameraTargetDescriptor.useMipMap = false; @@ -604,7 +599,7 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera bool depthTextureIsDepthFormat = RequireDepthPrepass(cameraData, ref renderPassInputs) && (renderingModeActual != RenderingMode.Deferred); - if (m_CreateDepthAttachment) + if (m_RequiresIntermediateAttachments) { var depthDescriptor = cameraData.cameraTargetDescriptor; depthDescriptor.useMipMap = false; @@ -627,6 +622,12 @@ void CreateRenderGraphCameraRenderTargets(RenderGraph renderGraph, bool isCamera RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraDepthHandle, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment"); importDepthParams.discardOnLastUse = lastCameraInTheStack; + #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; @@ -843,8 +844,7 @@ public override bool supportsGPUOcclusion } } - private static bool m_CreateColorAttachment; - private static bool m_CreateDepthAttachment; + private static bool m_RequiresIntermediateAttachments; private void OnOffscreenDepthTextureRendering(RenderGraph renderGraph, ScriptableRenderContext context, UniversalResourceData resourceData, UniversalCameraData cameraData) { @@ -1089,7 +1089,6 @@ private TextureCopySchedules CalculateTextureCopySchedules(UniversalCameraData c } bool requiresColorCopyPass = cameraData.requiresOpaqueTexture || renderPassInputs.requiresColorTexture; - requiresColorCopyPass &= !cameraData.isPreviewCamera; // Schedule a color copy pass if required ColorCopySchedule color = requiresColorCopyPass ? ColorCopySchedule.AfterSkybox @@ -1625,44 +1624,37 @@ private void OnAfterRendering(RenderGraph renderGraph) debugHandler.Render(renderGraph, cameraData, debugScreenTexture, overlayUITexture, debugHandlerColorTarget); } -#if UNITY_EDITOR - bool isGizmosEnabled = UnityEditor.Handles.ShouldRenderGizmos(); - - if (cameraData.isSceneViewCamera || cameraData.isPreviewCamera || (isGizmosEnabled && cameraData.resolveFinalTarget)) + if (cameraData.resolveFinalTarget) { - TextureHandle cameraDepthTexture = resourceData.cameraDepthTexture; - m_FinalDepthCopyPass.MssaSamples = 0; - m_FinalDepthCopyPass.CopyToBackbuffer = cameraData.isGameCamera; - m_FinalDepthCopyPass.Render(renderGraph, frameData, resourceData.activeDepthTexture, cameraDepthTexture, false, "Final Depth Copy"); - } +#if UNITY_EDITOR + // If we render to an intermediate depth attachment instead of the backbuffer, we need to copy the result to the backbuffer in cases where backbuffer + // depth data is required later in the frame. + bool backbufferDepthRequired = (cameraData.isSceneViewCamera || cameraData.isPreviewCamera || UnityEditor.Handles.ShouldRenderGizmos()); + if (m_RequiresIntermediateAttachments && backbufferDepthRequired) + { + m_FinalDepthCopyPass.MssaSamples = 0; + m_FinalDepthCopyPass.CopyToBackbuffer = cameraData.isGameCamera; + m_FinalDepthCopyPass.Render(renderGraph, frameData, resourceData.backBufferDepth, resourceData.cameraDepth, false, "Final Depth Copy"); + } #endif - if (cameraData.isSceneViewCamera) - DrawRenderGraphWireOverlay(renderGraph, frameData, resourceData.backBufferColor); + if (cameraData.isSceneViewCamera) + DrawRenderGraphWireOverlay(renderGraph, frameData, resourceData.backBufferColor); - if (drawGizmos) - DrawRenderGraphGizmos(renderGraph, frameData, resourceData.backBufferColor, resourceData.activeDepthTexture, GizmoSubset.PostImageEffects); + if (drawGizmos) + DrawRenderGraphGizmos(renderGraph, frameData, resourceData.backBufferColor, resourceData.activeDepthTexture, GizmoSubset.PostImageEffects); + } } bool RequireDepthPrepass(UniversalCameraData cameraData, ref RenderPassInputSummary renderPassInputs) { - bool applyPostProcessing = ShouldApplyPostProcessing(cameraData.postProcessEnabled); // If Camera's PostProcessing is enabled and if there any enabled PostProcessing requires depth texture as shader read resource (Motion Blur/DoF) bool cameraHasPostProcessingWithDepth = CameraHasPostProcessingWithDepth(cameraData); bool forcePrepass = (m_CopyDepthMode == CopyDepthMode.ForcePrepass); bool depthPrimingEnabled = IsDepthPrimingEnabled(cameraData); -#if UNITY_EDITOR - bool isGizmosEnabled = UnityEditor.Handles.ShouldRenderGizmos(); -#else - bool isGizmosEnabled = false; -#endif - bool requiresDepthTexture = cameraData.requiresDepthTexture || renderPassInputs.requiresDepthTexture || depthPrimingEnabled; bool requiresDepthPrepass = (requiresDepthTexture || cameraHasPostProcessingWithDepth) && (!CanCopyDepth(cameraData) || forcePrepass); - requiresDepthPrepass |= cameraData.isSceneViewCamera; - requiresDepthPrepass |= isGizmosEnabled; - requiresDepthPrepass |= cameraData.isPreviewCamera; requiresDepthPrepass |= renderPassInputs.requiresDepthPrepass; requiresDepthPrepass |= renderPassInputs.requiresNormalsTexture; // This must be checked explicitly because some features inject normal requirements later in the frame requiresDepthPrepass |= depthPrimingEnabled; @@ -1679,8 +1671,8 @@ bool RequireDepthTexture(UniversalCameraData cameraData, bool requiresDepthPrepa createDepthTexture |= !cameraData.resolveFinalTarget; // Deferred renderer always need to access depth buffer. createDepthTexture |= (renderingModeActual == RenderingMode.Deferred && !useRenderPassEnabled); - // Some render cases (e.g. Material previews) have shown we need to create a depth texture when we're forcing a prepass. - createDepthTexture |= depthPrimingEnabled || cameraData.isPreviewCamera; + // An intermediate depth target is required when depth priming is enabled because we can't copy out of backbuffer depth if it's needed later + createDepthTexture |= depthPrimingEnabled; // TODO: seems like with mrt depth is not taken from first target. Investigate if this is needed createDepthTexture |= m_RenderingLayerProvidesRenderObjectPass; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXLit.hlsl b/Packages/com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXLit.hlsl index 521110ec612..f92f1d60ec3 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXLit.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXLit.hlsl @@ -28,6 +28,8 @@ InputData VFXGetInputData(const VFX_VARYING_PS_INPUTS i, const PositionInputs po inputData.positionWS = posInputs.positionWS.xyz; inputData.normalWS = normalWS; inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(inputData.positionWS); + inputData.positionCS = i.VFX_VARYING_POSCS; + #if defined(VFX_MATERIAL_TYPE_SIX_WAY_SMOKE) && defined(VFX_VARYING_TANGENT) float signNormal = frontFace ? 1.0 : -1.0f; float3 bitangent = cross(i.VFX_VARYING_NORMAL.xyz, i.VFX_VARYING_TANGENT.xyz); diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl index 70fb482977f..30161d74bff 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl @@ -90,7 +90,7 @@ float4 _AdditionalShadowmapSize; // (xy: 1/width and 1/height, zw: width an // blocks bigger than 8kb while others have a 64kb max uniform block size. This number ensures size of buffer // AdditionalLightShadows stays reasonable. It also avoids shader compilation errors on SHADER_API_GLES30 // devices where max number of uniforms per shader GL_MAX_FRAGMENT_UNIFORM_VECTORS is low (224) -float4 _AdditionalShadowParams[MAX_VISIBLE_LIGHTS]; // Per-light data +float4 _AdditionalShadowParams[MAX_VISIBLE_LIGHTS]; // Per-light data: (x: shadowStrength, y: softShadows, z: light type (Spot: 0, Point: 1), w: perLightFirstShadowSliceIndex) float4x4 _AdditionalLightsWorldToShadow[MAX_VISIBLE_LIGHTS]; // Per-shadow-slice-data #endif #endif diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Accessing.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Accessing.md new file mode 100644 index 00000000000..6d601f38f9e --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Accessing.md @@ -0,0 +1,26 @@ +# Access Custom Render Texture shader properties + +If you want to create shaders, in Shader Graph, for use with Custom Render Textures, you need to understand how to access specific texture coordinates and other shader properties. + +## Accessing the texture coordinates + +Shader Graph provides access to local and global texture coordinates via the [UV Node](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/UV-Node.html): +- Channel 0 (localTexcoord): Provides the local texture coordinates. +- Channel 1 (globalTexcoord): Provides the global texture coordinates. + +To access these channels, add a UV node to your Shader Graph and select the appropriate channel. + +## Access the cubemap view direction + +For shaders that interact with Cubemaps, use the [View Direction](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/View-Direction-Node.html) node to retrieve the direction for the Cubemap sampling . Make sure that the space is set to **World Space** to get the correct direction vector. + +## Access the Update Zone Index + +You can access the update zone index via the [UV Node](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/UV-Node.html) as well. +- Channel 2 (PrimitiveID): Provides the Primitive ID. The primitive ID corresponds to the index of the update zone being rendered. + +## Additional resources +- [Custom Render Textures](https://docs.unity3d.com/Manual/class-CustomRenderTexture.html) +- [Custom Render Texture Nodes](Custom-Render-Texture-Nodes.md) +- [UV node](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/UV-Node.html) +- [View Direction node](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/View-Direction-Node.html) diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Example.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Example.md new file mode 100644 index 00000000000..993a03c5b3c --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Example.md @@ -0,0 +1,52 @@ +# Example Custom Render Texture with Shader Graph + +This example demonstrates how to set up a Shader Graph for Custom Render Texture shaders to create a self-healing deformation effect that could be used for snow, sand, etc. + +![](images/CustomRenderTexture-Animation.gif) + +For this effect, we need a Render Texture that contains the pixels we want to displace. This Render Texture is displayed at the top left corner of the preceding image. It was directly assigned to a camera that renders the objects in red above the UV plane. + +1. Create a **Custom Render Texture** Shader Graph as follows: + - Right-click in the Project window. + - Select **Create** > **Shader Graph** > **Custom Render Texture** and name your shader. + +2. Create a new **Custom Render Texture** as follows: + - Select **Create** > **Rendering** > **Custom Render Texture**. + - Configure the parameters to match the following image. + **Note**: The material in the **Material** field was created. + +![](images/CustomRenderTextureInspector.png) + +This Shader Graph reads the output of the Camera Render Texture, as well as the Self texture, then adds them and lerps the result so that it tends towards 0 over time. You should end up with something similar to the following: + +![](images/CustomRenderTextureShaderGraph.png) + +4. Finally you need to assign the **Custom Render Texture** to a material that can deform the geometry (tessellation or pixel displacement). + +## New ShaderGraph Nodes for Custom Render Textures + +Three new ShaderGraph nodes have been introduced to facilitate working with Custom Render Textures: + +1. [Custom Render Texture Self](Custom-Texture-Self) + - Outputs the double-buffered texture from the previous update. + - It provides three outputs for different types of textures: 2D, 3D, and Cube textures. + +2. [Custom Render Texture Size](Custom-Texture-Size) + - Outputs the width, height, and volume depth of the current Custom Render Texture. + - Use this node to determine the size of the texture being worked with. + +3. [Custom Render Texture Slice](Custom-Texture-Slice) + - Outputs the current slice for 2D Texture Arrays or the Cubemap face index being updated. + +## Known Limitations + +When working with Custom Render Texture shaders, be aware of the following limitations: + +* Rendering Order + - The Custom Render Texture update loop runs before any rendering operations. This means: + - You cannot access any render pipeline-specific information in the shader, such as depth, normal, or scene color. + - Despite this, you can rely on the content of the Custom Render Texture being ready for use in the scene when the camera renders. + +## Additional resources +- [Custom Render Textures](https://docs.unity3d.com/Manual/class-CustomRenderTexture.html) +- [Custom Render Texture Nodes](Custom-Render-Texture-Nodes.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Nodes.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Nodes.md new file mode 100644 index 00000000000..137819f9553 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Nodes.md @@ -0,0 +1,6 @@ +# Custom Render Texture Nodes + +|[Custom Render Texture Slice](Custom-Texture-Slice.md) | [Custom Render Texture Size](Custom-Texture-Size.md) | [Custom Render Texture Self](Custom-Texture-Self.md) | +|:---------:|:---------:|:---------:| +|![Image](images/CustomRenderTextureSliceIndex.png)| ![Image](images/CustomRenderTextureSize.png)| ![Image](images/CustomRenderTextureSelf.png)| +|Access the custom render texture slice index and cubemap face. | Access the custom render texture size. | Access the custom render texture from the previous update. | diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture.md new file mode 100644 index 00000000000..bbb02307260 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture.md @@ -0,0 +1,11 @@ +# Custom Render Textures + +With Custom Render Textures, you can use Shader Graph to create shaders that are compatible with Custom Render Texture Update and Initialization materials. The following topics describe how to access the shader properties and set up a Shader Graph for Custom Render Texture shaders. + +| **Topic** | **Description** | +| :------------------------------ | :------------------------------- | +| **[Access Custom Render Texture shader properties](Custom-Render-Texture-Accessing.md)** | Access specific texture coordinates and other shader properties. | +| **[Example Custom Render Texture with Shader Graph](Custom-Render-Texture-Example.md)** | Set up a Shader Graph for Custom Render Texture shaders to create a self-healing deformation effect that could be used for snow, sand, etc. | + +## Additional resources +[Custom Render Textures](https://docs.unity3d.com/Manual/class-CustomRenderTexture.html). diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture.md.meta b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture.md.meta new file mode 100644 index 00000000000..b48d1b25daa --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d9f940345f7b44c9a3fb7de04f59264c +timeCreated: 1721813605 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Self.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Self.md new file mode 100644 index 00000000000..1089b0016f3 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Self.md @@ -0,0 +1,23 @@ +# Custom Render Texture Self Node + +## Description + +Provides the texture that contains the result of the previous update of the **Custom Render Texture**. Use the output that corresponds to the type of **Custom Render Texture** used. + +For more information on Custom Render Textures, refer to the [Unity Manual](https://docs.unity3d.com/Manual/class-CustomRenderTexture.html). + +## Ports + +| Name | Direction | Type | Binding | Description | +|:------------------|:-------------|:----------|:---|:-----------------------------------------------------------------------------------| +| Self Texture 2D | Output | Texture2D | None | 2D Texture object that contains the update result of the previous **Custom Render Texture**. | +| Self Texture Cube | Output | Cubemap | None | Cubemap object that contains the update result of the previous **Custom Render Texture**. | +| Self Texture 3D | Output | Texture3D | None | 3D Texture object that contains the update result of the previous **Custom Render Texture**. | + +## Generated Code Example + +The following example code represents one possible outcome of this node. + +``` +UnityBuildTexture2DStructNoScale(_SelfTexture2D) +``` diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Self.md.meta b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Self.md.meta new file mode 100644 index 00000000000..80b73f7e2ca --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Self.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dc70aae0237140c39655012772dfaec0 +timeCreated: 1721813623 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Size.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Size.md new file mode 100644 index 00000000000..967862280f0 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Size.md @@ -0,0 +1,23 @@ +# Custom Render Texture Size Node + +## Description + +Provides the size of the current **Custom Render Texture**. + +For more information on Custom Render Textures, refer to the [Unity Manual](https://docs.unity3d.com/Manual/class-CustomRenderTexture.html). + +## Ports + +| Name | Direction | Type | Binding | Description | +|:---------------|:-------------|:----------|:---|:-------------------------------------------------------------------------------------------------------------| +| Texture Width | Output | Float | None | Width of the **Custom Render Texture**. | +| Texture Height | Output | Float | None | Height of the **Custom Render Texture**. | +| Texture Depth | Output | Float | None | Volume depth of the **Custom Render Texture**. This is valid only for 3D texture and 2D texture array types. | + +## Generated Code Example + +The following example code represents one possible outcome of this node. + +``` +_CustomRenderTextureWidth +``` \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Size.md.meta b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Size.md.meta new file mode 100644 index 00000000000..4b3e2bdf88f --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Size.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c08245aa849d4003859deb1cbe0e9dd3 +timeCreated: 1721813649 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Slice.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Slice.md new file mode 100644 index 00000000000..efb39dc3f2f --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Slice.md @@ -0,0 +1,22 @@ +# Custom Render Texture Slice Node + +## Description + +Provides the slice index or cubemap face of the current **Custom Render Texture**. When a **Custom Render Texture** is a Cubemap, 3D texture, or 2D texture array, Shader Graph issues multiple draw calls to update each slice or face separately. Use this node to get the slice index or cubemap face. + +For more information on Custom Render Textures, refer to the [Unity Manual](https://docs.unity3d.com/Manual/class-CustomRenderTexture.html). + +## Ports + +| Name | Direction | Type | Binding | Description | +|:--------------------|:-------------|:----------|:---|:------------------------------------------------------------------------------------------------------------------------------------------------| +| Texture Cube Face | Output | Float | None | The current face of the **Custom Render Texture** being updated. This value is an integer between 0 and 5 included. | +| Texture Depth Slice | Output | Float | None | The current slice index of the **Custom Render Texture** being updated. This value is an integer between 0 and the volume depth of the texture. | + +## Generated Code Example + +The following example code represents one possible outcome of this node. + +``` +_CustomRenderTextureCubeFace +``` \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Slice.md.meta b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Slice.md.meta new file mode 100644 index 00000000000..0f3cdceab35 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Texture-Slice.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 959569f6b11b4449b793d4930158b695 +timeCreated: 1721813672 \ No newline at end of file diff --git a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md index bc01d76ff63..e58c2e092ca 100644 --- a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md +++ b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md @@ -15,6 +15,9 @@ * [Precision Modes](Precision-Modes) * [Preview Mode Control](Preview-Mode-Control) * [Custom Function Node](Custom-Function-Node) + * [Custom Render Textures](Custom-Render-Texture) + * [Accessing](Custom-Render-Texture-Accessing) + * [Example](Custom-Render-Texture-Example) * [Shader Graph Preferences](Shader-Graph-Preferences) * [Shader Graph Project Settings](Shader-Graph-Project-Settings.md) * [Shader Graph Keyboard Shortcuts](Keyboard-shortcuts) @@ -81,6 +84,10 @@ * [Flip](Flip-Node) * [Split](Split-Node) * [Swizzle](Swizzle-Node) + * [Custom Render Texture Nodes](Custom-Render-Texture) + * [Self](Custom-Texture-Self) + * [Size](Custom-Texture-Size) + * [Slice](Custom-Texture-Slice) * [Input](Input-Nodes) * Basic * [Boolean](Boolean-Node) diff --git a/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTexture-Animation.gif b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTexture-Animation.gif new file mode 100644 index 00000000000..89b82aa1f1c Binary files /dev/null and b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTexture-Animation.gif differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureInspector.png b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureInspector.png new file mode 100644 index 00000000000..12ef1a0e482 Binary files /dev/null and b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureInspector.png differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSelf.png b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSelf.png new file mode 100644 index 00000000000..a6b29fd0385 Binary files /dev/null and b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSelf.png differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureShaderGraph.png b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureShaderGraph.png new file mode 100644 index 00000000000..ab98cffa71b Binary files /dev/null and b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureShaderGraph.png differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSize.png b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSize.png new file mode 100644 index 00000000000..25fae9fd23b Binary files /dev/null and b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSize.png differ diff --git a/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSliceIndex.png b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSliceIndex.png new file mode 100644 index 00000000000..93ad581ba79 Binary files /dev/null and b/Packages/com.unity.shadergraph/Documentation~/images/CustomRenderTextureSliceIndex.png differ diff --git a/Packages/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs b/Packages/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs index ec4c91fdc1c..3301eac790f 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs @@ -414,6 +414,7 @@ internal static void BuildContextBlocks(VFXContext context, VFXTaskCompiledData var blockDeclared = new HashSet(); var includesProcessed = new HashSet(); var defineProcessed = new HashSet(); + var customCodeProcessed = new HashSet(); int cpt = 0; foreach (var current in context.activeFlattenedChildrenWithImplicit) @@ -421,7 +422,10 @@ internal static void BuildContextBlocks(VFXContext context, VFXTaskCompiledData // Custom HLSL Blocks if (current is IHLSLCodeHolder hlslCodeHolder) { - blockFunction.Write(hlslCodeHolder.customCode); + if (customCodeProcessed.Add(hlslCodeHolder.customCode)) + { + blockFunction.Write(hlslCodeHolder.customCode); + } foreach (var includePath in hlslCodeHolder.includes) { if (includesProcessed.Add(includePath)) @@ -442,7 +446,6 @@ internal static void BuildContextBlocks(VFXContext context, VFXTaskCompiledData } // Custom HLSL Operators - var customCodeProcessed = new HashSet(); foreach (var hlslCodeHolder in taskData.hlslCodeHolders) { var customCode = hlslCodeHolder.customCode; diff --git a/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs b/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs index cd6cad2decd..f353d2f21c1 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs @@ -54,10 +54,15 @@ public override IEnumerable GetDescriptors() new[] { new KeyValuePair(nameof(SetAttribute.attribute), customAttribute.name) }), null); } + var selfPath = m_ContextController.model is VFXBlockSubgraphContext ? AssetDatabase.GetAssetPath(m_ContextController.model) : string.Empty; + foreach (var item in SubGraphCache.GetItems(typeof(VisualEffectSubgraphBlock))) { - if (((SubGraphCache.AdditionalBlockInfo)item.additionalInfos).compatibleType.HasFlag(m_ContextController.model.contextType) - && ((SubGraphCache.AdditionalBlockInfo)item.additionalInfos).compatibleData.HasFlag(m_ContextController.model.ownedType)) + if (!string.IsNullOrEmpty(selfPath) && selfPath == item.path) // don't include self + continue; + + var blockInfo = (SubGraphCache.AdditionalBlockInfo)item.additionalInfos; + if (m_ContextController.model.Accept(blockInfo.compatibleType, blockInfo.compatibleData)) { var variant = new SubgraphVariant( item.name, diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs index 3b8a60b5e95..d0fe3cdeb30 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs @@ -562,7 +562,7 @@ public void SetMemberValue(string memberPath, object value) } } - public static string MakeNameUnique(string name, HashSet allNames, bool allowSpace = true) + public static string MakeNameUnique(string name, HashSet allNames, bool allowSpace = true, List rejectedCandidateNames = null) { if (string.IsNullOrEmpty(name)) { @@ -575,7 +575,7 @@ public static string MakeNameUnique(string name, HashSet allNames, bool } string candidateMainPart = null; int cpt = 0; - while (allNames.Contains(candidateName)) + while (allNames.Contains(candidateName, StringComparer.OrdinalIgnoreCase)) { if (candidateMainPart == null) { @@ -601,6 +601,7 @@ public static string MakeNameUnique(string name, HashSet allNames, bool candidateName = allowSpace ? $"{candidateMainPart} {cpt}" : $"{candidateMainPart}_{cpt}"; + rejectedCandidateNames?.Add(candidateName); } return candidateName; diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs index 9f6b72a194f..1898c81bf7d 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs @@ -118,8 +118,9 @@ protected override void SelfChange() } m_HeaderIcon.image = GetIconForVFXType(controller.model.inputType); - m_HeaderIcon.visible = m_HeaderIcon.image != null; m_HeaderIcon.SendToBack(); // Actually move it as first child so it's before the title label + if (m_HeaderIcon.image == null) + m_HeaderIcon.AddToClassList("Empty"); var subTitle = controller.subtitle; m_Subtitle.text = controller.subtitle; @@ -457,8 +458,11 @@ private void OnDragUpdated(DragUpdatedEvent evt) if (references.Any() && (!controller.viewController.model.isSubgraph || !references.Any(t => t.GetResource().GetOrCreateGraph().subgraphDependencies.Contains(controller.viewController.model.subgraph) || t.GetResource() == controller.viewController.model))) { - var compatibleReferences = references - .Where(x => x != null && x.GetResource().GetOrCreateGraph().children.OfType().First().compatibleContextType.HasFlag(controller.model.contextType)); + var compatibleReferences = references.Where(x => + { + var subgraphBlock = x?.GetResource()?.GetOrCreateGraph()?.children.OfType().First(); + return subgraphBlock != null ? controller.model.Accept(subgraphBlock.compatibleContextType, subgraphBlock.ownedType) : false; + }); if (compatibleReferences.Any()) { @@ -529,8 +533,12 @@ void OnDragPerform(DragPerformEvent evt) foreach (var reference in references) { var graph = reference != null ? reference.GetResource().GetOrCreateGraph() : null; - if (graph != null && graph.children.OfType().First().compatibleContextType.HasFlag(controller.model.contextType)) + if (graph != null) { + var subgraphContext = graph.children.OfType().First(); + if (!controller.model.Accept(subgraphContext.compatibleContextType, subgraphContext.ownedType)) + continue; + DragAndDrop.AcceptDrag(); if (view.HasCustomAttributeConflicts(graph.attributesManager.GetCustomAttributes())) { diff --git a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs index cb07b17adea..f37fe2c98e5 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs @@ -463,6 +463,10 @@ private void GetPreferredWidths(ref float labelWidth, ref float controlWidth) { foreach (var port in GetPorts(true, false).OfType()) { + // Skip because it's not visible + if (!port.connected && !expanded) + continue; + float portLabelWidth = port.GetPreferredLabelWidth(); float portControlWidth = port.GetPreferredControlWidth(); @@ -515,7 +519,9 @@ public void GetWidths(out float labelWidth, out float controlWidth) var settingsLabelWidth = 0f; var inputsLabelWidth = 0f; controlWidth = 50f; - GetPreferredSettingsWidths(ref settingsLabelWidth, ref controlWidth); + // Settings are only visible when node is expanded + if (expanded) + GetPreferredSettingsWidths(ref settingsLabelWidth, ref controlWidth); GetPreferredWidths(ref inputsLabelWidth, ref controlWidth); labelWidth = Mathf.Max(settingsLabelWidth, inputsLabelWidth); if (labelWidth > 0) @@ -524,12 +530,9 @@ public void GetWidths(out float labelWidth, out float controlWidth) protected virtual void RefreshLayout() { - if (expanded) - { - GetWidths(out var labelWidth, out var controlWidth); - ApplySettingsWidths(labelWidth); - ApplyWidths(labelWidth, controlWidth); - } + GetWidths(out var labelWidth, out var controlWidth); + ApplySettingsWidths(labelWidth); + ApplyWidths(labelWidth, controlWidth); } } } diff --git a/Packages/com.unity.visualeffectgraph/Editor/Inspector/VFXBlockEditor.cs b/Packages/com.unity.visualeffectgraph/Editor/Inspector/VFXBlockEditor.cs index 8176c247d77..7ad14dc9390 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Inspector/VFXBlockEditor.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Inspector/VFXBlockEditor.cs @@ -64,11 +64,12 @@ public override void OnInspectorGUI() } } - if (!string.IsNullOrEmpty(block.source)) + var source = block.source; + if (!string.IsNullOrEmpty(source)) { EditorGUILayout.Space(); EditorGUILayout.LabelField("Computed Source Code", EditorStyles.boldLabel); - EditorGUILayout.TextArea(block.source); + EditorGUILayout.TextArea(source); } } } diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/CustomHLSL.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/CustomHLSL.cs index f897788e303..14bc382048b 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/CustomHLSL.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/CustomHLSL.cs @@ -5,7 +5,6 @@ using UnityEditor.VFX.UI; using UnityEngine; -using PropertyAttribute = UnityEngine.PropertyAttribute; namespace UnityEditor.VFX.Block { @@ -58,6 +57,9 @@ protected override IEnumerable ValidateImpl(IEnumerable fun [VFXInfo(category = "HLSL")] class CustomHLSL : VFXBlock, IHLSLCodeHolder { + public const string FunctionNameSuffix = "Block"; + public const string parameterPrefix = "_"; + const string defaultHlslCode = "void CustomHLSL(inout VFXAttributes attributes, in float3 offset, in float speedFactor)" + "\n" + "{" + "\n" + @@ -348,7 +350,7 @@ private void ParseCodeIfNeeded() private VFXPropertyWithValue CreateProperty(HLSLFunctionParameter parameter) { - var propertyAttributes = new List(); + var propertyAttributes = new List(); if (parameter.bufferUsage.valid) { propertyAttributes.Add(new GraphicsBufferUsageAttribute(parameter.bufferUsage)); @@ -360,8 +362,8 @@ private VFXPropertyWithValue CreateProperty(HLSLFunctionParameter parameter) } return propertyAttributes.Count > 0 - ? new VFXPropertyWithValue(new VFXProperty(parameter.type, parameter.name, propertyAttributes.ToArray())) - : new VFXPropertyWithValue(new VFXProperty(parameter.type, parameter.name)); + ? new VFXPropertyWithValue(new VFXProperty(parameter.type, $"{parameterPrefix}{parameter.name}", propertyAttributes.ToArray())) + : new VFXPropertyWithValue(new VFXProperty(parameter.type, $"{parameterPrefix}{parameter.name}")); } private string BuildSource() @@ -387,7 +389,7 @@ private string BuildSource() // Make the call to custom hlsl function var functionName = HasShaderFile() ? m_Function.name - : m_Function.GetNameWithHashCode(); + : m_Function.GetNameWithHashCode(FunctionNameSuffix); builder.Append($"{functionName}("); if (m_Properties.Count > 0) { @@ -421,7 +423,7 @@ private string BuildCustomCode() return string.Empty; } - return m_Function.GetTransformedHLSL(); + return m_Function.GetTransformedHLSL(FunctionNameSuffix); } public bool Equals(IHLSLCodeHolder other) diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/HLSLParser.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/HLSLParser.cs index fbb3c049618..fffb45e29f6 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/HLSLParser.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/HLSL/HLSLParser.cs @@ -322,12 +322,12 @@ public static IEnumerable Parse(IVFXAttributesManager attributesMa public string body { get; } public IReadOnlyCollection errorList { get; } - public string GetTransformedHLSL() + public string GetTransformedHLSL(string suffix) { var transformedBody = new StringBuilder(); var hlslType = HLSLParser.UnityHLSLType(returnType); - transformedBody.Append($"{hlslType} {GetNameWithHashCode()}("); + transformedBody.Append($"{hlslType} {GetNameWithHashCode(suffix)}("); transformedBody.AppendJoin(", ", inputs); transformedBody.AppendLine(")"); @@ -336,7 +336,7 @@ public string GetTransformedHLSL() return transformedBody.ToString(); } - public string GetNameWithHashCode() => $"{name}_{body.GetHashCode():X}"; + public string GetNameWithHashCode(string suffix) => $"{name}_{body.GetHashCode():X}_{suffix}"; private Dictionary GetDoc(string rawDoc) { diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXBlock.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXBlock.cs index 9b43899a9b5..e4e2c628181 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXBlock.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXBlock.cs @@ -49,20 +49,14 @@ public virtual bool isValid { get { - if (GetParent() == null) return true; // a block is invalid only if added to incompatible context. - if ((compatibleContexts & GetParent().contextType) != GetParent().contextType) - return false; - if (GetParent() is VFXBlockSubgraphContext subgraphContext) - return (subgraphContext.compatibleContextType & compatibleContexts) == subgraphContext.compatibleContextType; + if (GetParent() == null) + return true; - return true; + return GetParent().Accept(this); } } - public bool isActive - { - get { return enabled && isValid; } - } + public bool isActive => enabled && isValid; public abstract VFXContextType compatibleContexts { get; } public abstract VFXDataType compatibleData { get; } diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs index a5b33ded8ff..aaca79ffb8a 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs @@ -20,16 +20,7 @@ class VFXSubgraphBlock : VFXBlock VFXBlock[] m_SubBlocks; VFXGraph m_UsedSubgraph; - public VisualEffectSubgraphBlock subgraph - { - get - { - if (!isValid) - return null; - - return m_Subgraph; - } - } + public VisualEffectSubgraphBlock subgraph => m_Subgraph; public override void GetImportDependentAssets(HashSet dependencies) { @@ -49,6 +40,7 @@ public override void CheckGraphBeforeImport() { ResyncSlots(true); ResyncCustomAttributes(); + Invalidate(InvalidationCause.kUIChangedTransient); // if a subgraph block has changed, we need to update it's visual valid state } } @@ -233,7 +225,7 @@ public override bool isValid if (blockContext == null) return false; - return (blockContext.compatibleContextType & parent.contextType) == parent.contextType; + return base.isValid; } } diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXBlockSubgraphContext.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXBlockSubgraphContext.cs index d214cbc6e72..2a4a240dcde 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXBlockSubgraphContext.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXBlockSubgraphContext.cs @@ -40,7 +40,7 @@ protected override IEnumerable inputProperties [VFXSetting, SerializeField] ContextType m_SuitableContexts = ContextType.InitAndUpdateAndOutput; - public VFXContextType compatibleContextType + public override VFXContextType compatibleContextType { get { @@ -70,11 +70,11 @@ protected internal override void Invalidate(VFXModel model, InvalidationCause ca { model.RefreshErrors(); } - } - - public override bool Accept(VFXBlock block, int index = -1) - { - return ((block.compatibleContexts & compatibleContextType) == compatibleContextType); + if (model == this && cause == InvalidationCause.kSettingChanged) // Suitable context has changed, refresh valid blocks UI + { + foreach (var block in children) + block.Invalidate(InvalidationCause.kUIChangedTransient); + } } public override bool CanBeCompiled() diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs index 9fc919ce736..03d20c72708 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs @@ -134,6 +134,8 @@ public override void OnEnable() public virtual bool codeGeneratorCompute { get { return true; } } public virtual bool doesIncludeCommonCompute { get { return codeGeneratorCompute; } } public virtual VFXContextType contextType { get { return m_ContextType; } } + + public virtual VFXContextType compatibleContextType { get { return contextType; } } public virtual VFXDataType inputType { get { return m_InputType; } } public virtual VFXDataType outputType { get { return m_OutputType; } } public virtual VFXDataType ownedType { get { return contextType == VFXContextType.Output ? inputType : outputType; } } @@ -269,11 +271,8 @@ public override bool AcceptChild(VFXModel model, int index = -1) return Accept(block, index); } - public virtual bool Accept(VFXBlock block, int index = -1) - { - var testedType = contextType == VFXContextType.Output ? inputType : outputType; - return ((block.compatibleContexts & contextType) != 0) && ((block.compatibleData & testedType) != 0); - } + public bool Accept(VFXBlock block, int index = -1) => Accept(block.compatibleContexts, block.compatibleData); + public bool Accept(VFXContextType blockContexts, VFXDataType blockData) => (blockContexts & compatibleContextType) == compatibleContextType && (blockData & ownedType) != 0; public bool CanHaveBlocks() { diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/GetCustomAttribute.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/GetCustomAttribute.cs index 6e25bcb05e5..2b0e629c26a 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/GetCustomAttribute.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/GetCustomAttribute.cs @@ -34,6 +34,10 @@ public override void Sanitize(int version) { GetGraph().TryAddCustomAttribute(attribute, CustomAttributeUtility.GetValueType(AttributeType), string.Empty, false, out var vfxAttribute); var vfxAttributeParameter = ScriptableObject.CreateInstance(); + if (attribute != vfxAttribute.name) + { + Debug.Log($"[Sanitize] Get Custom Attribute {attribute} has been renamed into {vfxAttribute.name}"); + } vfxAttributeParameter.attribute = vfxAttribute.name; vfxAttributeParameter.location = location; vfxAttributeParameter.ResyncSlots(true); diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/SetCustomAttribute.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/SetCustomAttribute.cs index b5277812bee..a09702e8534 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/SetCustomAttribute.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Deprecated/SetCustomAttribute.cs @@ -99,6 +99,10 @@ public override void Sanitize(int version) { GetGraph().TryAddCustomAttribute(attribute, CustomAttributeUtility.GetValueType(AttributeType), string.Empty, false, out var vfxAttribute); var setAttribute = ScriptableObject.CreateInstance(); + if (attribute != vfxAttribute.name) + { + Debug.Log($"[Sanitize] Set Custom Attribute: {attribute} has been renamed into {vfxAttribute.name}"); + } setAttribute.attribute = vfxAttribute.name; setAttribute.Composition = Composition; setAttribute.Random = Random; diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/CustomHLSL.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/CustomHLSL.cs index 33a20b97b96..55dcae7becc 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/CustomHLSL.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/CustomHLSL.cs @@ -119,6 +119,8 @@ protected override IEnumerable ValidateImpl(IEnumerable fun [VFXInfo(category = "HLSL")] class CustomHLSL : VFXOperator, IHLSLCodeHolder { + public const string ReturnFunctionSuffix = "Return"; + const string defaultHlslCode = "float FloatFunction(in float value)" + "\n" + "{" + "\n" + @@ -315,6 +317,7 @@ protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpressi var currentIncludes = new List(includes).ToArray(); var expressions = new List(m_OutputProperties.Count); + for (int i = 0; i < m_InputParameters.Count; i++) { var parameter = m_InputParameters[i]; @@ -329,7 +332,7 @@ protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpressi var valueType = VFXExpression.GetVFXValueTypeFromType(m_Function?.returnType); if (valueType != VFXValueType.None) { - var hlslCode = BuildHLSLWrapperCode(m_InputParameters.Count, "Return", m_Function.rawReturnType, out var wrapperFunctionName); + var hlslCode = BuildHLSLWrapperCode(m_InputParameters.Count, ReturnFunctionSuffix, m_Function.rawReturnType, out var wrapperFunctionName); expressions.Add(new VFXExpressionHLSL(wrapperFunctionName, hlslCode, valueType, inputExpression, currentIncludes)); } @@ -470,13 +473,13 @@ private string BuildHLSLWrapperCode(int outputIndex, string returnedParameterNam if (m_Function != null) { var hasShaderFile = HasShaderFile(); - var functionName = hasShaderFile ? m_Function.name : m_Function.GetNameWithHashCode(); + var functionName = hasShaderFile ? m_Function.name : m_Function.GetNameWithHashCode(returnedParameterName); var hlslCode = new StringBuilder(); if (!hasShaderFile) - hlslCode.Append(m_Function.GetTransformedHLSL()); + hlslCode.Append(m_Function.GetTransformedHLSL(returnedParameterName)); - wrapperFunctionName = $"{functionName}_Wrapper_{returnedParameterName}"; + wrapperFunctionName = $"{functionName}_Wrapper"; hlslCode.Append($"{returnType} {wrapperFunctionName}("); var isFirst = true; diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/VFXAttributesManager.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/VFXAttributesManager.cs index 7e166535c7c..40364469192 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/VFXAttributesManager.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/VFXAttributesManager.cs @@ -403,17 +403,12 @@ public bool TryRegisterCustomAttribute(string name, CustomAttributeUtility.Signa { name = MakeValidName(name); - if (TryFind(name, out var existingAttribute)) + if (TryFindExistingAttributeOrCreate(name, CustomAttributeUtility.GetValueType(type), out newAttribute)) { - if (existingAttribute.type == CustomAttributeUtility.GetValueType(type)) - { - newAttribute = existingAttribute; - return false; - } - name = FindUniqueName(name); + return false; } - newAttribute = new VFXAttribute(name, CustomAttributeUtility.GetValueType(type), description); + newAttribute.description = description; m_CustomAttributes.Add(newAttribute); return true; } @@ -474,6 +469,31 @@ public string FindUniqueName(string name) } + private bool TryFindExistingAttributeOrCreate(string name, VFXValueType type, out VFXAttribute attribute) + { + if (TryFind(name, out attribute)) + { + if (attribute.type == type) + { + return true; + } + + var existingNames = new HashSet(GetAllNamesOrCombination(true, true, true, true)); + var rejectedCandidateNames = new List(); + name = VFXParameterController.MakeNameUnique(name, existingNames, false, rejectedCandidateNames); + foreach (var candidateName in rejectedCandidateNames) + { + if (TryFind(candidateName, out attribute) && attribute.type == type) + { + return true; + } + } + } + + attribute = new VFXAttribute(name, type, null); + return false; + } + private string MakeValidName(string name) { return CustomAttributeUtility.IsShaderCompilableName(name) diff --git a/Packages/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs b/Packages/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs index b820462d49e..6a8a7b6071c 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs +++ b/Packages/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs @@ -702,7 +702,7 @@ public VFXAttribute DuplicateCustomAttribute(string attributeName) { var newAttribute = m_AttributesManager.Duplicate(attributeName); var currentIndex = m_CustomAttributes.FindIndex(x => x.attributeName == attributeName); - var order = currentIndex >= 0 ? currentIndex + 1 : -1; + var order = currentIndex >= 0 ? currentIndex + 1 : m_CustomAttributes.Count; if (TryAddCustomAttribute(newAttribute.name, newAttribute.type, newAttribute.description, false, out var attribute)) { SetCustomAttributeOrder(attribute.name, order); diff --git a/Packages/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXContext.uss b/Packages/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXContext.uss index 4d131af5cda..d7818743101 100644 --- a/Packages/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXContext.uss +++ b/Packages/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXContext.uss @@ -166,6 +166,11 @@ VFXContextUI #title #icon margin-right: 6px; } +VFXContextUI #title #icon.Empty +{ + display: none; +} + VFXContextUI #header-space { position:absolute; diff --git a/Tests/SRPTests/Packages/com.unity.testing.brg/Scripts/RenderBRG.cs b/Tests/SRPTests/Packages/com.unity.testing.brg/Scripts/RenderBRG.cs index 2adddd2b5cf..9f538ddeb69 100644 --- a/Tests/SRPTests/Packages/com.unity.testing.brg/Scripts/RenderBRG.cs +++ b/Tests/SRPTests/Packages/com.unity.testing.brg/Scripts/RenderBRG.cs @@ -371,6 +371,7 @@ public void Execute() staticShadowCaster = false, allDepthSorted = false, }, + drawCommandsType = BatchDrawCommandType.Direct, }; outRange++; } @@ -506,6 +507,7 @@ private BatchCullingOutputDrawCommands OutputPickingDrawCommands(BatchCullingOut }; draws.drawRanges[0].drawCommandsBegin = 0; draws.drawRanges[0].drawCommandsCount = (uint)draws.drawCommandCount; + draws.drawRanges[0].drawCommandsType = BatchDrawCommandType.Direct; return draws; } diff --git a/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXCodeGenerationTest.cs b/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXCodeGenerationTest.cs index c5da04ec477..03f5c52ce66 100644 --- a/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXCodeGenerationTest.cs +++ b/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXCodeGenerationTest.cs @@ -192,34 +192,6 @@ public void Constant_Folding_With_ShaderKeyword([ValueSource("allCompilationMode vfx.GetOrCreateGraph().SetCompilationMode(VFXCompilationMode.Runtime); } - private IEnumerable CheckCompilation(VFXGraph vfxGraph) - { - var resource = vfxGraph.GetResource(); - EditorUtility.SetDirty(resource); - var path = AssetDatabase.GetAssetPath(vfxGraph); - AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate | ImportAssetOptions.ForceSynchronousImport); - - for (int i = 0; i < 4; ++i) - yield return null; - - while (ShaderUtil.anythingCompiling) - yield return null; - - var computeShaders = AssetDatabase.LoadAllAssetsAtPath(path).OfType().ToArray(); - Assert.AreEqual(3, computeShaders.Length); - - foreach (var computeShader in computeShaders) - { - var messages = ShaderUtil.GetComputeShaderMessages(computeShader); - foreach (var message in messages) - Assert.AreNotEqual(ShaderCompilerMessageSeverity.Error, message.severity, message.message); - - Assert.AreEqual(0, computeShader.FindKernel("CSMain")); - Assert.IsTrue(computeShader.IsSupported(0)); - } - yield return null; - } - [UnityTest] public IEnumerator Combinatory_Position_Shape() { @@ -248,7 +220,7 @@ public IEnumerator Combinatory_Position_Shape() initialize.AddChild(positionShape); } - foreach (var yield in CheckCompilation(vfxGraph)) + foreach (var yield in VFXTestCommon.CheckCompilation(vfxGraph)) { yield return yield; } @@ -292,7 +264,7 @@ public IEnumerator Combinatory_Collision_Shape() initialize.AddChild(collisionShape); } - foreach (var yield in CheckCompilation(vfxGraph)) + foreach (var yield in VFXTestCommon.CheckCompilation(vfxGraph)) { yield return yield; } diff --git a/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXTestCommon.cs b/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXTestCommon.cs index 48e4021e895..a089219e8e6 100644 --- a/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXTestCommon.cs +++ b/Tests/SRPTests/Packages/com.unity.testing.visualeffectgraph/Tests/Editor/VFXTestCommon.cs @@ -1,6 +1,6 @@ using System; +using System.Collections; using UnityEngine; -using UnityEditor; using NUnit.Framework; using UnityEngine.VFX; using UnityEditor.VFX.UI; @@ -11,6 +11,7 @@ using System.IO; using System.Runtime.CompilerServices; using System.Text.RegularExpressions; +using UnityEditor.Rendering; using UnityEditor.ShaderGraph.Internal; #if VFX_HAS_TIMELINE using UnityEngine.Playables; @@ -344,6 +345,34 @@ internal static void SetTextFieldValue(VFXSystemBorder sys, string value) SetFieldValue(sys, "m_TitleField", systemTextField); } + internal static IEnumerable CheckCompilation(VFXGraph vfxGraph) + { + var resource = vfxGraph.GetResource(); + EditorUtility.SetDirty(resource); + var path = AssetDatabase.GetAssetPath(vfxGraph); + AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate | ImportAssetOptions.ForceSynchronousImport); + + for (int i = 0; i < 4; ++i) + yield return null; + + while (ShaderUtil.anythingCompiling) + yield return null; + + var computeShaders = AssetDatabase.LoadAllAssetsAtPath(path).OfType().ToArray(); + Assert.AreEqual(3, computeShaders.Length); + + foreach (var computeShader in computeShaders) + { + var messages = ShaderUtil.GetComputeShaderMessages(computeShader); + foreach (var message in messages) + Assert.AreNotEqual(ShaderCompilerMessageSeverity.Error, message.severity, message.message); + + Assert.AreEqual(0, computeShader.FindKernel("CSMain")); + Assert.IsTrue(computeShader.IsSupported(0)); + } + yield return null; + } + internal static void CreateSystems(VFXView view, VFXViewController viewController, int count, int offset, string name = null) { VFXContextController GetContextController(VFXContext context) diff --git a/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SimpleExample/SimpleBRGExample.cs b/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SimpleExample/SimpleBRGExample.cs index 1a98f175446..ccd29d36650 100644 --- a/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SimpleExample/SimpleBRGExample.cs +++ b/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SimpleExample/SimpleBRGExample.cs @@ -261,6 +261,7 @@ public unsafe JobHandle OnPerformCulling( // to the default zero values, except the renderingLayerMask which we have to set to all ones // so the instances will be drawn regardless of mask settings when rendering. drawCommands->drawRanges[0].filterSettings = new BatchFilterSettings { renderingLayerMask = 0xffffffff, }; + drawCommands->drawRanges[0].drawCommandsType = BatchDrawCommandType.Direct; // Finally, write the actual visible instance indices to their array. In a more complicated // implementation, this output would depend on what we determined to be visible, but in this example diff --git a/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SortingPositionsSplit/SortingPositionsSplit.cs b/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SortingPositionsSplit/SortingPositionsSplit.cs index a086f9c755f..3f84a644488 100644 --- a/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SortingPositionsSplit/SortingPositionsSplit.cs +++ b/Tests/SRPTests/Projects/BatchRendererGroup_URP/Assets/SampleScenes/SortingPositionsSplit/SortingPositionsSplit.cs @@ -140,6 +140,7 @@ public unsafe JobHandle OnPerformCulling(BatchRendererGroup brg, BatchCullingCon drawCommands->drawRanges[0].drawCommandsBegin = 0; drawCommands->drawRanges[0].drawCommandsCount = 1; + drawCommands->drawRanges[0].drawCommandsType = BatchDrawCommandType.Direct; drawCommands->drawRanges[0].filterSettings = new BatchFilterSettings { renderingLayerMask = 0xffffffff, }; diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_Foundation/Assets/Test/TestFilters/TestCaseFilters.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_Foundation/Assets/Test/TestFilters/TestCaseFilters.asset index 417f6bf16b2..a4e90117ac5 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_Foundation/Assets/Test/TestFilters/TestCaseFilters.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_Foundation/Assets/Test/TestFilters/TestCaseFilters.asset @@ -1243,3 +1243,13 @@ MonoBehaviour: XrSdk: StereoModes: 0 Reason: No support in webgpu + - FilteredScene: {fileID: 0} + FilteredScenes: + - {fileID: 102900000, guid: bb5aa41014ad2014eb5b3dbd7d7e6463, type: 3} + ColorSpace: -1 + BuildPlatform: 9 + GraphicsDevice: 16 + Architecture: 2 + XrSdk: + StereoModes: 0 + Reason: UUM-85648 diff --git a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLBlockTest.cs b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLBlockTest.cs index fca9a5477d1..414ee1d8540 100644 --- a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLBlockTest.cs +++ b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLBlockTest.cs @@ -57,14 +57,14 @@ public void Check_CustomHLSL_Block_Generated_Code() var expectedSource = "VFXAttributes att = (VFXAttributes)0;\r\n" + "att.position = position;\r\n" + "att.velocity = velocity;\r\n" + - $"{function.GetNameWithHashCode()}(att, offset, speed);\r\n" + + $"{function.GetNameWithHashCode(CustomHLSL.FunctionNameSuffix)}(att, {CustomHLSL.parameterPrefix}offset, {CustomHLSL.parameterPrefix}speed);\r\n" + "position = att.position;\r\n" + "velocity = att.velocity;"; Assert.AreEqual(expectedSource, hlslBlock.source); Assert.IsEmpty(hlslBlock.includes); Assert.AreEqual(blockName, hlslBlock.name); - var expectedCustomCode = $"void {function.GetNameWithHashCode()}(inout VFXAttributes attributes, in float3 offset, in float speed)\r\n" + + var expectedCustomCode = $"void {function.GetNameWithHashCode(CustomHLSL.FunctionNameSuffix)}(inout VFXAttributes attributes, in float3 offset, in float speed)\r\n" + "{\n" + " attributes.position += offset;\n" + " attributes.velocity = float3(0, 0, speed);\n" + @@ -92,7 +92,7 @@ public void Check_CustomHLSL_Block_Use_Shader_File() var expectedSource = "VFXAttributes att = (VFXAttributes)0;\r\n" + "att.position = position;\r\n" + "att.velocity = velocity;\r\n" + - "TestFunction(att, offset, speed);\r\n" + + $"TestFunction(att, {CustomHLSL.parameterPrefix}offset, {CustomHLSL.parameterPrefix}speed);\r\n" + "position = att.position;\r\n" + "velocity = att.velocity;"; Assert.AreEqual(expectedSource, hlslBlock.source); @@ -532,7 +532,7 @@ public IEnumerator Check_CustomHLSL_Block_VFXAttributes_Without_Access_Modifier( //Check input slot contents Assert.AreEqual(1, hlslBlock.inputSlots.Count); - Assert.AreEqual("param", hlslBlock.inputSlots[0].name); + Assert.AreEqual($"{CustomHLSL.parameterPrefix}param", hlslBlock.inputSlots[0].name); Assert.AreEqual(VFXValueType.Float, hlslBlock.inputSlots[0].valueType); } @@ -619,14 +619,41 @@ public IEnumerator Check_CustomHLSL_Block_Compiles() var hlslBlock = ScriptableObject.CreateInstance(); hlslBlock.SetSettingValue("m_HLSLCode", hlslCode); + // Act + MakeSimpleGraphWithCustomHLSL(hlslBlock, out var view, out var graph); + + // Assert + foreach (var y in VFXTestCommon.CheckCompilation(graph)) + { + yield return y; + } + } + + [UnityTest] + public IEnumerator Check_CustomHLSL_Twice_Same_Block_Compiles() + { + // Arrange + var hlslCode = + "void TestFunction(inout VFXAttributes attributes, in float param)\n" + + "{\n" + + " attributes.position = float3(param, param, param);\n" + + "}"; + var hlslBlock = ScriptableObject.CreateInstance(); + hlslBlock.SetSettingValue("m_HLSLCode", hlslCode); MakeSimpleGraphWithCustomHLSL(hlslBlock, out var view, out var graph); // Act - AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graph)); - yield return null; + var copyHlslBlock = ScriptableObject.CreateInstance(); + copyHlslBlock.SetSettingValue("m_HLSLCode", hlslCode); + var targetContext = graph.children.OfType().Single(x => x.contextType == VFXContextType.Update); + targetContext.AddChild(copyHlslBlock); + view.graphView.OnSave(); // Assert - Assert.Pass("No exception should be raised"); + foreach (var y in VFXTestCommon.CheckCompilation(graph)) + { + yield return y; + } } [UnityTest] @@ -772,6 +799,29 @@ public IEnumerator Check_Diverging_Usage_Buffer([Values(true, false)] bool legal yield return null; } + + [UnityTest, Description("Cover UUM_83782")] + public IEnumerator Check_CustomHLSL_Block_Parameter_Same_Name_As_Attribute() + { + // Arrange + var hlslCode = + "void myDir(inout VFXAttributes attributes,in float3 direction)\n" + + "{\n" + + " attributes.direction = direction;\n" + + "}"; + var hlslBlock = ScriptableObject.CreateInstance(); + hlslBlock.SetSettingValue("m_HLSLCode", hlslCode); + + // Act + MakeSimpleGraphWithCustomHLSL(hlslBlock, out var view, out var graph); + + // Assert + foreach (var y in VFXTestCommon.CheckCompilation(graph)) + { + yield return y; + } + } + internal static ShaderInclude CreateShaderFile(string hlslCode, out string destinationPath) { destinationPath = Path.Combine(VFXTestCommon.tempBasePath, Guid.NewGuid() + ".hlsl"); diff --git a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLOperatorTest.cs b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLOperatorTest.cs index 5c7f799111e..0eb764f9297 100644 --- a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLOperatorTest.cs +++ b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/CustomHLSLOperatorTest.cs @@ -9,6 +9,7 @@ using System.Text.RegularExpressions; using NUnit.Framework; +using UnityEditor.VFX.Block; using UnityEditor.VFX.UI; using UnityEngine; using UnityEngine.TestTools; @@ -68,13 +69,13 @@ public void Check_CustomHLSL_Operator_Generated_Code() Assert.AreEqual(VFXValueType.Float3, hlslExpression.valueType); var function = CustomHLSLBlockTest.GetFunction(hlslOperator); - var expectedCode = $"float3 {function.GetNameWithHashCode()}(in float4x4 mat, in float3 vec)\r\n" + + var expectedCode = $"float3 {function.GetNameWithHashCode(CustomHLSL.ReturnFunctionSuffix)}(in float4x4 mat, in float3 vec)\r\n" + "{\n" + " return mat * vec;\n" + "}\r\n" + - $"float3 {function.GetNameWithHashCode()}_Wrapper_Return(float4x4 mat, float3 vec)\r\n" + + $"float3 {function.GetNameWithHashCode(CustomHLSL.ReturnFunctionSuffix)}_Wrapper(float4x4 mat, float3 vec)\r\n" + "{\r\n" + - "\tfloat3 var_2 = Transform_65810E99(mat, vec);\r\n" + + $"\tfloat3 var_2 = Transform_65810E99_{CustomHLSL.ReturnFunctionSuffix}(mat, vec);\r\n" + "\treturn var_2;\r\n" + "}\r\n"; Assert.AreEqual(expectedCode, hlslExpression.customCode); @@ -106,7 +107,7 @@ public void Check_CustomHLSL_Operator_Use_Shader_File() Assert.AreEqual(VFXExpressionOperation.None, hlslExpression.operation); Assert.AreEqual(VFXValueType.Float3, hlslExpression.valueType); - var expectedGeneratedCode = "float3 Transform_Wrapper_Return(float4x4 mat, float3 vec)\r\n" + + var expectedGeneratedCode = "float3 Transform_Wrapper(float4x4 mat, float3 vec)\r\n" + "{\r\n" + "\tfloat3 var_2 = \tTransform(mat, vec);\r\n" + "\treturn var_2;\r\n" + @@ -794,7 +795,7 @@ string Check_Multiple_Usage_Buffer_Get_Source(VisualEffectResource vfx) void Check_Multiple_Usage_Buffer_Sanity_Check(string source) { Assert.IsTrue(source.Contains("ByteAddressBuffer buffer_a;")); - Assert.IsTrue(source.Contains("StructuredBuffer buffer_b;")); + Assert.IsTrue(source.Contains("StructuredBuffer _buffer_b;")); Assert.IsTrue(Regex.IsMatch(source, "void mySamplingOfUAV_In_Block_.*\\(inout VFXAttributes attributes, in ByteAddressBuffer buffer\\)")); Assert.IsTrue(Regex.IsMatch(source, "void myOtherSamplingOfStructured_In_Block_.*\\(inout VFXAttributes attributes, in StructuredBuffer buffer\\)")); Assert.IsTrue(Regex.IsMatch(source, "float mySamplingOfUAV_In_Operator_.*\\(in ByteAddressBuffer buffer\\)")); @@ -812,7 +813,7 @@ void Check_Multiple_Usage_Buffer_Sanity_Check(string source) Assert.IsNotNull(sourceEdition); vfx.GetOrCreateGraph().SetCompilationMode(VFXCompilationMode.Runtime); - yield return null; + yield return null; var sourceRuntime = Check_Multiple_Usage_Buffer_Get_Source(vfx); Assert.IsNotNull(sourceRuntime); @@ -923,6 +924,35 @@ public IEnumerator Check_Diverging_Usage_Buffer([Values(true, false)] bool legal yield return null; } + [UnityTest, Description("Cover UUM-83676")] + public IEnumerator Check_CustomHLSL_Operator_Multiple_Out_Parameters() + { + // Arrange + var hlslCode = + "void Transform(out float first, out float second)" + "\n" + + "{" + "\n" + + " first = 1;" + "\n" + + " second = 2;" + "\n" + + "}"; + + var hlslOperator = ScriptableObject.CreateInstance(); + hlslOperator.SetSettingValue("m_HLSLCode", hlslCode); + + MakeSimpleGraphWithCustomHLSL(hlslOperator, out var view, out var graph); + var initializeContext = graph.children.OfType().Single(); + var setPositionBlock = initializeContext.children.Single(); + yield return null; + + setPositionBlock.inputSlots[0][0][0].Link(hlslOperator.outputSlots[0]); + setPositionBlock.inputSlots[0][0][1].Link(hlslOperator.outputSlots[1]); + view.graphView.controller.ApplyChanges(); + + foreach (var y in VFXTestCommon.CheckCompilation(graph)) + { + yield return y; + } + } + private VFXExpression[] CallBuildExpression(CustomHLSL hlslOperator, VFXExpression[] parentExpressions) { var methodInfo = hlslOperator.GetType().GetMethod("BuildExpression", BindingFlags.Instance | BindingFlags.NonPublic); diff --git a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/Repro_UUM_83849.vfx_ b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/Repro_UUM_83849.vfx_ new file mode 100644 index 00000000000..d4ff4a51881 --- /dev/null +++ b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/Repro_UUM_83849.vfx_ @@ -0,0 +1,3246 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &114023846229194376 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73a13919d81fb7444849bae8b5c812a2, type: 3} + m_Name: VFXBasicSpawner + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: + - {fileID: 8926484042661614566} + - {fileID: 8926484042661614569} + m_UIPosition: {x: 708, y: -253} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: [] + m_OutputSlots: [] + m_Label: Spawn + m_Data: {fileID: 8926484042661614555} + m_InputFlowSlot: + - link: [] + - link: [] + m_OutputFlowSlot: + - link: + - context: {fileID: 114946465509916290} + slotIndex: 0 + loopDuration: 0 + loopCount: 0 + delayBeforeLoop: 0 + delayAfterLoop: 0 +--- !u!114 &114307113894698210 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b605c022ee79394a8a776c0869b3f9a, type: 3} + m_Name: VFXSlot + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 114986932069951040} + - {fileID: 114963171269329408} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 114946465509916290} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.AABox, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"center":{"x":0.0,"y":0.0,"z":0.0},"size":{"x":2.0,"y":2.0,"z":2.0}}' + m_Space: 0 + m_Property: + name: bounds + m_serializedType: + m_SerializableType: UnityEditor.VFX.AABox, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114340500867371532 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d01270efd3285ea4a9d6c555cb0a8027, type: 3} + m_Name: VFXUI + m_EditorClassIdentifier: + groupInfos: [] + stickyNoteInfos: [] + categories: [] + uiBounds: + serializedVersion: 2 + x: 139 + y: -253 + width: 993 + height: 2164 +--- !u!114 &114350483966674976 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d4c867f6b72b714dbb5fd1780afe208, type: 3} + m_Name: Smoke1 + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 114023846229194376} + - {fileID: 114946465509916290} + - {fileID: 114780028408030698} + - {fileID: 8926484042661614560} + - {fileID: 8926484042661614594} + - {fileID: 8926484042661614596} + - {fileID: 8926484042661614637} + - {fileID: 8926484042661614642} + - {fileID: 8926484042661614672} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_UIInfos: {fileID: 114340500867371532} + m_ParameterInfo: [] + m_ImportDependencies: [] + m_GraphVersion: 12 + m_ResourceVersion: 1 + m_SubgraphDependencies: [] + m_CategoryPath: +--- !u!114 &114380859405582094 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: VFXSlotFloat + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114963171269329408} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114428730288789306 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d78581a96eae8bf4398c282eb0b098bd, type: 3} + m_Name: VFXDataParticle + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + title: + m_Owners: + - {fileID: 114946465509916290} + - {fileID: 114780028408030698} + - {fileID: 8926484042661614560} + dataType: 0 + capacity: 30 + stripCapacity: 16 + particlePerStripCount: 16 + needsComputeBounds: 0 + boundsMode: 1 + m_Space: 0 +--- !u!114 &114512514798047786 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: VFXSlotFloat + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114963171269329408} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114538391275492396 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: VFXSlotFloat + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114986932069951040} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114739294351936256 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: VFXSlotFloat + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114986932069951040} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114780028408030698 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2dc095764ededfa4bb32fa602511ea4b, type: 3} + m_Name: VFXBasicUpdate + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 708, y: 1076} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: [] + m_OutputSlots: [] + m_Label: + m_Data: {fileID: 114428730288789306} + m_InputFlowSlot: + - link: + - context: {fileID: 114946465509916290} + slotIndex: 0 + m_OutputFlowSlot: + - link: + - context: {fileID: 8926484042661614560} + slotIndex: 0 + integration: 0 + angularIntegration: 0 + ageParticles: 1 + reapParticles: 1 + skipZeroDeltaUpdate: 0 +--- !u!114 &114920711487922656 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: VFXSlotFloat + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114963171269329408} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114935892456706286 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: VFXSlotFloat + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114986932069951040} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114946465509916290 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9dfea48843f53fc438eabc12a3a30abc, type: 3} + m_Name: VFXBasicInitialize + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: + - {fileID: 8926484042661614553} + - {fileID: 8926484042661614558} + - {fileID: 8926484042661614605} + - {fileID: 8926484042661614632} + - {fileID: 8926484042661614661} + m_UIPosition: {x: 708, y: 355} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 114307113894698210} + m_OutputSlots: [] + m_Label: + m_Data: {fileID: 114428730288789306} + m_InputFlowSlot: + - link: + - context: {fileID: 114023846229194376} + slotIndex: 0 + m_OutputFlowSlot: + - link: + - context: {fileID: 114780028408030698} + slotIndex: 0 +--- !u!114 &114963171269329408 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: VFXSlotFloat3 + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114307113894698210} + m_Children: + - {fileID: 114512514798047786} + - {fileID: 114920711487922656} + - {fileID: 114380859405582094} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: size + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &114986932069951040 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: VFXSlotFloat3 + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114307113894698210} + m_Children: + - {fileID: 114739294351936256} + - {fileID: 114935892456706286} + - {fileID: 114538391275492396} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 114307113894698210} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: center + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!2058629511 &8926484042661614527 +VisualEffectResource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Smoke1 + m_Graph: {fileID: 114350483966674976} + m_Infos: + m_RendererSettings: + motionVectorGenerationMode: 0 + shadowCastingMode: 0 + receiveShadows: 0 + reflectionProbeUsage: 0 + lightProbeUsage: 0 + m_CullingFlags: 3 + m_UpdateMode: 0 + m_PreWarmDeltaTime: 0.05 + m_PreWarmStepCount: 0 + m_InitialEventName: OnPlay + m_InstancingMode: -1 + m_InstancingCapacity: 64 +--- !u!114 &8926484042661614553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114946465509916290} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614554} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614711} + attribute: size + Composition: 0 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614554} + m_MasterData: + m_Owner: {fileID: 8926484042661614553} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 1 + m_Space: 2147483647 + m_Property: + name: Size + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614555 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f68759077adc0b143b6e1c101e82065e, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + title: + m_Owners: + - {fileID: 114023846229194376} +--- !u!114 &8926484042661614558 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114946465509916290} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614559} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614712} + attribute: lifetime + Composition: 0 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614559 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 8926484042661614558} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 3 + m_Space: 2147483647 + m_Property: + name: Lifetime + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614560 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e837ba02e1cb47d4394b6c186d164156, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: + - {fileID: 8926484042661614719} + - {fileID: 8926484042661614577} + - {fileID: 8926484042661614589} + m_UIPosition: {x: 708, y: 1307} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614561} + - {fileID: 8926484042661614562} + - {fileID: 8926484042661614718} + m_OutputSlots: [] + m_Label: + m_Data: {fileID: 114428730288789306} + m_InputFlowSlot: + - link: + - context: {fileID: 114780028408030698} + slotIndex: 0 + m_OutputFlowSlot: + - link: [] + blendMode: 0 + cullMode: 3 + zWriteMode: 0 + zTestMode: 0 + useAlphaClipping: 0 + generateMotionVector: 0 + excludeFromTUAndAA: 0 + sortingPriority: 0 + m_SubOutputs: + - {fileID: 8926484042661614565} + colorMapping: 0 + uvMode: 0 + flipbookLayout: 0 + useSoftParticle: 0 + vfxSystemSortPriority: 0 + sort: 0 + sortMode: 0 + revertSorting: 0 + indirectDraw: 0 + computeCulling: 0 + frustumCulling: 0 + castShadows: 0 + useExposureWeight: 0 + needsOwnSort: 0 + shaderGraph: {fileID: 0} + materialSettings: + m_PropertyNames: + - _QueueOffset + - _QueueControl + m_PropertyValues: + - 0 + - 0 + MeshCount: 1 + lod: 0 +--- !u!114 &8926484042661614561 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b47b8679b468b7347a00cdd50589bc9f, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614561} + m_MasterData: + m_Owner: {fileID: 8926484042661614560} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Mesh, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"obj":{"fileID":10210,"guid":"0000000000000000e000000000000000","type":0}}' + m_Space: 2147483647 + m_Property: + name: mesh + m_serializedType: + m_SerializableType: UnityEngine.Mesh, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614562 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c52d920e7fff73b498050a6b3c4404ca, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614562} + m_MasterData: + m_Owner: {fileID: 8926484042661614560} + m_Value: + m_Type: + m_SerializableType: System.UInt32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 4294967295 + m_Space: 2147483647 + m_Property: + name: subMeshMask + m_serializedType: + m_SerializableType: System.UInt32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614565 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 081ffb0090424ba4cb05370a42ead6b9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + opaqueRenderQueue: 0 + transparentRenderQueue: 1 +--- !u!114 &8926484042661614566 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5e382412bb691334bb79457a6c127924, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114023846229194376} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614567} + - {fileID: 8926484042661614568} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614709} + repeat: 0 + spawnMode: 0 + delayMode: 0 +--- !u!114 &8926484042661614567 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614567} + m_MasterData: + m_Owner: {fileID: 8926484042661614566} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 1 + m_Space: 2147483647 + m_Property: + name: Count + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614568 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614568} + m_MasterData: + m_Owner: {fileID: 8926484042661614566} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0 + m_Space: 2147483647 + m_Property: + name: Delay + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614569 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5e382412bb691334bb79457a6c127924, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114023846229194376} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614570} + - {fileID: 8926484042661614571} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614710} + repeat: 1 + spawnMode: 0 + delayMode: 0 +--- !u!114 &8926484042661614570 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614570} + m_MasterData: + m_Owner: {fileID: 8926484042661614569} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 1 + m_Space: 2147483647 + m_Property: + name: Count + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614571 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614571} + m_MasterData: + m_Owner: {fileID: 8926484042661614569} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0.85 + m_Space: 2147483647 + m_Property: + name: Delay + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614577 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614560} + m_Children: [] + m_UIPosition: {x: 0, y: 2} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614578} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614716} + attribute: position + Composition: 1 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614578 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5265657162cc1a241bba03a3b0476d99, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614579} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614578} + m_MasterData: + m_Owner: {fileID: 8926484042661614577} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.Position, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"position":{"x":0.0,"y":0.05000000074505806,"z":0.0}}' + m_Space: 0 + m_Property: + name: Position + m_serializedType: + m_SerializableType: UnityEditor.VFX.Position, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614579 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614578} + m_Children: + - {fileID: 8926484042661614580} + - {fileID: 8926484042661614581} + - {fileID: 8926484042661614582} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614578} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: position + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614580 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614579} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614578} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614579} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614578} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614582 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614579} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614578} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614589 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614560} + m_Children: [] + m_UIPosition: {x: 0, y: 77} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614590} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614717} + attribute: scale + Composition: 2 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614590 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614591} + - {fileID: 8926484042661614592} + - {fileID: 8926484042661614593} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614590} + m_MasterData: + m_Owner: {fileID: 8926484042661614589} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":1.0,"y":1.0,"z":1.0}' + m_Space: 2147483647 + m_Property: + name: Scale + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614591 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614590} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614590} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: + - {fileID: 8926484042661614599} +--- !u!114 &8926484042661614592 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614590} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614590} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614593 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614590} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614590} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: + - {fileID: 8926484042661614599} +--- !u!114 &8926484042661614594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba941214d319b454f90d5480e85886f2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 139, y: 1751} + m_UICollapsed: 0 + m_UISuperCollapsed: 1 + m_InputSlots: [] + m_OutputSlots: + - {fileID: 8926484042661614595} +--- !u!114 &8926484042661614595 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614595} + m_MasterData: + m_Owner: {fileID: 8926484042661614594} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0 + m_Space: 2147483647 + m_Property: + name: t + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: + - {fileID: 8926484042661614598} +--- !u!114 &8926484042661614596 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f8bcc906a6d398c46b18826714448709, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 405, y: 1751} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614597} + - {fileID: 8926484042661614598} + m_OutputSlots: + - {fileID: 8926484042661614599} +--- !u!114 &8926484042661614597 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c117b74c5c58db542bffe25c78fe92db, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614597} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: UnityEngine.AnimationCurve, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"frames":[{"time":0.0,"value":0.0,"inTangent":4.913595676422119,"outTangent":4.913595676422119,"tangentMode":0,"leftTangentMode":0,"rightTangentMode":0,"broken":false},{"time":1.0,"value":2.0,"inTangent":0.0,"outTangent":0.0,"tangentMode":0,"leftTangentMode":0,"rightTangentMode":0,"broken":false}],"preWrapMode":8,"postWrapMode":8,"version":1}' + m_Space: 2147483647 + m_Property: + name: curve + m_serializedType: + m_SerializableType: UnityEngine.AnimationCurve, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614598 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614598} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0 + m_Space: 2147483647 + m_Property: + name: time + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: + - {fileID: 8926484042661614595} +--- !u!114 &8926484042661614599 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614599} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0 + m_Space: 2147483647 + m_Property: + name: s + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: + - {fileID: 8926484042661614591} + - {fileID: 8926484042661614593} +--- !u!114 &8926484042661614605 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114946465509916290} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614606} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614713} + attribute: scale + Composition: 0 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614606 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614607} + - {fileID: 8926484042661614608} + - {fileID: 8926484042661614609} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614606} + m_MasterData: + m_Owner: {fileID: 8926484042661614605} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":1.0,"y":0.4000000059604645,"z":1.0}' + m_Space: 2147483647 + m_Property: + name: Scale + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614607 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614606} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614606} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614608 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614606} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614606} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614609 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614606} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614606} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614632 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114946465509916290} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614633} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614714} + attribute: color + Composition: 0 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614633 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614634} + - {fileID: 8926484042661614635} + - {fileID: 8926484042661614636} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614633} + m_MasterData: + m_Owner: {fileID: 8926484042661614632} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":1.0,"y":1.0,"z":1.0}' + m_Space: 2147483647 + m_Property: + name: Color + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: + - {fileID: 8926484042661614647} +--- !u!114 &8926484042661614634 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614633} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614633} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614635 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614633} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614633} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614636 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614633} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614633} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614637 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c42128e17c583714a909b4997c80c916, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 284, y: 811} + m_UICollapsed: 0 + m_UISuperCollapsed: 1 + m_InputSlots: + - {fileID: 8926484042661614638} + - {fileID: 8926484042661614639} + - {fileID: 8926484042661614640} + m_OutputSlots: + - {fileID: 8926484042661614641} + seed: 0 + constant: 1 +--- !u!114 &8926484042661614638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614638} + m_MasterData: + m_Owner: {fileID: 8926484042661614637} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0 + m_Space: 2147483647 + m_Property: + name: min + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614639 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614639} + m_MasterData: + m_Owner: {fileID: 8926484042661614637} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 1 + m_Space: 2147483647 + m_Property: + name: max + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614640 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c52d920e7fff73b498050a6b3c4404ca, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614640} + m_MasterData: + m_Owner: {fileID: 8926484042661614637} + m_Value: + m_Type: + m_SerializableType: System.UInt32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 96 + m_Space: 2147483647 + m_Property: + name: seed + m_serializedType: + m_SerializableType: System.UInt32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614641 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614641} + m_MasterData: + m_Owner: {fileID: 8926484042661614637} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0 + m_Space: 2147483647 + m_Property: + name: r + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: + - {fileID: 8926484042661614644} +--- !u!114 &8926484042661614642 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 997b3d8a71b0cd441b68e9a8d00dc6c4, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 501, y: 811} + m_UICollapsed: 0 + m_UISuperCollapsed: 1 + m_InputSlots: + - {fileID: 8926484042661614643} + m_OutputSlots: + - {fileID: 8926484042661614647} +--- !u!114 &8926484042661614643 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614644} + - {fileID: 8926484042661614645} + - {fileID: 8926484042661614646} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614643} + m_MasterData: + m_Owner: {fileID: 8926484042661614642} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":1.0,"y":1.0,"z":1.0}' + m_Space: 2147483647 + m_Property: + name: HSV + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614644 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614643} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614643} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: + - {fileID: 8926484042661614641} +--- !u!114 &8926484042661614645 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614643} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614643} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614646 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614643} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614643} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614647 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c499060cea9bbb24b8d723eafa343303, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614648} + - {fileID: 8926484042661614649} + - {fileID: 8926484042661614650} + - {fileID: 8926484042661614651} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614647} + m_MasterData: + m_Owner: {fileID: 8926484042661614642} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":0.0,"y":0.0,"z":0.0,"w":0.0}' + m_Space: 2147483647 + m_Property: + name: RGB + m_serializedType: + m_SerializableType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 1 + m_LinkedSlots: + - {fileID: 8926484042661614633} +--- !u!114 &8926484042661614648 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614647} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614647} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: [] +--- !u!114 &8926484042661614649 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614647} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614647} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: [] +--- !u!114 &8926484042661614650 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614647} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614647} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: [] +--- !u!114 &8926484042661614651 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614647} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614647} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: w + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: [] +--- !u!114 &8926484042661614661 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c286b53e648ef840b8153892fdbe169, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114946465509916290} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614749} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614715} + attribute: Seed + Composition: 0 + Random: 0 + AttributeType: 1 +--- !u!114 &8926484042661614672 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 87cb5bd24541ed041b011b1ffa05dae5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 444, y: 1511} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: [] + m_OutputSlots: + - {fileID: 8926484042661614675} + attribute: Seed + location: 0 + AttributeType: 1 +--- !u!114 &8926484042661614675 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b2b751071c7fc14f9fa503163991826, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614676} + - {fileID: 8926484042661614677} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614675} + m_MasterData: + m_Owner: {fileID: 8926484042661614672} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: Seed + m_serializedType: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 1 + m_LinkedSlots: + - {fileID: 8926484042661614743} +--- !u!114 &8926484042661614676 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614675} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614675} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: [] +--- !u!114 &8926484042661614677 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614675} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614675} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 1 + m_LinkedSlots: [] +--- !u!114 &8926484042661614709 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614709} + m_MasterData: + m_Owner: {fileID: 8926484042661614566} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614710 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614710} + m_MasterData: + m_Owner: {fileID: 8926484042661614569} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614711 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614711} + m_MasterData: + m_Owner: {fileID: 8926484042661614553} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614712 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614712} + m_MasterData: + m_Owner: {fileID: 8926484042661614558} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614713 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614713} + m_MasterData: + m_Owner: {fileID: 8926484042661614605} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614714 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614714} + m_MasterData: + m_Owner: {fileID: 8926484042661614632} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614715 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614715} + m_MasterData: + m_Owner: {fileID: 8926484042661614661} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614716} + m_MasterData: + m_Owner: {fileID: 8926484042661614577} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614717 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614717} + m_MasterData: + m_Owner: {fileID: 8926484042661614589} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614718 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70a331b1d86cc8d4aa106ccbe0da5852, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614718} + m_MasterData: + m_Owner: {fileID: 8926484042661614560} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"obj":{"fileID":2800000,"guid":"276d9e395ae18fe40a9b4988549f2349","type":3}}' + m_Space: 2147483647 + m_Property: + name: mainTexture + m_serializedType: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614719 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614560} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614743} + - {fileID: 8926484042661614746} + m_OutputSlots: [] + m_Disabled: 0 + m_ActivationSlot: {fileID: 8926484042661614728} + attribute: scale + Composition: 1 + Source: 0 + Random: 2 + channels: 4 +--- !u!114 &8926484042661614728 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b4c11ff25089a324daf359f4b0629b33, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614728} + m_MasterData: + m_Owner: {fileID: 8926484042661614719} + m_Value: + m_Type: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: True + m_Space: 2147483647 + m_Property: + name: _vfx_enabled + m_serializedType: + m_SerializableType: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614743 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b2b751071c7fc14f9fa503163991826, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614744} + - {fileID: 8926484042661614745} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614743} + m_MasterData: + m_Owner: {fileID: 8926484042661614719} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":1.0,"y":1.0}' + m_Space: 2147483647 + m_Property: + name: A + m_serializedType: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: + - {fileID: 8926484042661614675} +--- !u!114 &8926484042661614744 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614743} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614743} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614745 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614743} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614743} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614746 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b2b751071c7fc14f9fa503163991826, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614747} + - {fileID: 8926484042661614748} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614746} + m_MasterData: + m_Owner: {fileID: 8926484042661614719} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":1.0,"y":1.0}' + m_Space: 2147483647 + m_Property: + name: B + m_serializedType: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614746} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614746} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614748 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614746} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614746} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614749 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b2b751071c7fc14f9fa503163991826, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614750} + - {fileID: 8926484042661614751} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614749} + m_MasterData: + m_Owner: {fileID: 8926484042661614661} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":-100.0,"y":-100.0}' + m_Space: 2147483647 + m_Property: + name: _Seed + m_serializedType: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614749} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614749} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614751 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614749} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614749} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] diff --git a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/Repro_UUM_83849.vfx_.meta b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/Repro_UUM_83849.vfx_.meta new file mode 100644 index 00000000000..0eb136300d4 --- /dev/null +++ b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/Repro_UUM_83849.vfx_.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e1f7a776e42f7ba40bc3e3911924c38c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXAttributeTests.cs b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXAttributeTests.cs index a588eb8dd34..2cb2f6bdc91 100644 --- a/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXAttributeTests.cs +++ b/Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXAttributeTests.cs @@ -222,6 +222,30 @@ public string GetCustomAttribute_Name_Validation(string name) return CheckCustomAttributeName(name); } + [Test, Description("Cover regression UUM_83849")] + public void Sanitize_Custom_Attribute_With_Same_Name_As_BuiltIn() + { + var kSourceAsset = "Assets/AllTests/Editor/Tests/Repro_UUM_83849.vfx_"; + var graph = VFXTestCommon.CopyTemporaryGraph(kSourceAsset); + Assert.IsNotNull(graph); + + var initialize = graph.GetGraph().children.OfType().Single(); + Assert.IsNotNull(initialize); + + Assert.AreEqual(5u, initialize.children.Count()); + Assert.AreEqual(5u, initialize.children.OfType().Count()); + var sizeExpected = (string)initialize.children.First().GetSetting("attribute").value; + var customExpected = (string)initialize.children.Last().GetSetting("attribute").value; + Assert.AreEqual(VFXAttribute.Size.name, sizeExpected); + Assert.AreEqual("Seed_1", customExpected); + + var customAttribute = graph.customAttributes.SingleOrDefault(o => o.attributeName == customExpected); + Assert.IsNotNull(customAttribute); + + var getAttributeOp = graph.GetGraph().children.OfType().Single(); + Assert.AreEqual("Seed_1", getAttributeOp.attribute); + } + private string CheckCustomAttributeName(string name) where T : VFXModel { var graph = VFXTestCommon.MakeTemporaryGraph();