diff --git a/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs b/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs index 0c1a64577dc..e8b09004d03 100644 --- a/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs +++ b/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs @@ -992,17 +992,22 @@ static IEnumerable ConvertDataToSystemIndex(IEnumerable input, yield return index; } + private void CleanRuntimeData() + { + if (m_Graph.visualEffectResource != null) + m_Graph.visualEffectResource.ClearRuntimeData(); + + m_ExpressionGraph = new VFXExpressionGraph(); + m_ExpressionValues = new VFXExpressionValueContainerDesc[] {}; + } + public void Compile(VFXCompilationMode compilationMode, bool forceShaderValidation) { - // Prevent doing anything ( and especially showing progress) in an empty graph. - if (m_Graph.children.Count() < 1) + // Early out in case: (Not even displaying the popup) + if (m_Graph.children.Count() < 1 || // Graph is empty + VFXLibrary.currentSRPBinder == null) // One of supported SRPs is not current SRP { - // Cleaning - if (m_Graph.visualEffectResource != null) - m_Graph.visualEffectResource.ClearRuntimeData(); - - m_ExpressionGraph = new VFXExpressionGraph(); - m_ExpressionValues = new VFXExpressionValueContainerDesc[] {}; + CleanRuntimeData(); return; } @@ -1213,12 +1218,7 @@ public void Compile(VFXCompilationMode compilationMode, bool forceShaderValidati Debug.LogError(string.Format("{2} : Exception while compiling expression graph: {0}: {1}", e, e.StackTrace, (asset != null) ? asset.name : "(Null Asset)"), asset); - // Cleaning - if (m_Graph.visualEffectResource != null) - m_Graph.visualEffectResource.ClearRuntimeData(); - - m_ExpressionGraph = new VFXExpressionGraph(); - m_ExpressionValues = new VFXExpressionValueContainerDesc[] {}; + CleanRuntimeData(); } finally { diff --git a/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs b/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs index 4103f2591e4..bb729c5a9c5 100644 --- a/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs +++ b/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs @@ -7,6 +7,7 @@ using UnityEngine; using UnityEngine.Rendering; using Object = System.Object; +using System.Reflection; namespace UnityEditor.VFX { @@ -176,14 +177,6 @@ public virtual VFXAbstractRenderedOutput.BlendMode GetBlendModeFromMaterial(VFXM public virtual bool IsGraphDataValid(GraphData graph) => false; } - // This is the default binder used if no SRP is used in the project - class VFXLegacyBinder : VFXSRPBinder - { - public override string templatePath { get { return "Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy"; } } - public override string SRPAssetTypeStr { get { return "None"; } } - public override Type SRPOutputDataType { get { return null; } } - } - static class VFXLibrary { public static IEnumerable> GetContexts() { LoadIfNeeded(); return VFXViewPreference.displayExperimentalOperator ? m_ContextDescs : m_ContextDescs.Where(o => !o.info.experimental); } @@ -475,21 +468,67 @@ private static void LoadSRPBindersIfNeeded() } } + private static bool unsupportedSRPWarningIssued = false; + + private static void LogUnsupportedSRP(VFXSRPBinder binder, bool forceLog) + { + if (binder == null && (forceLog || !unsupportedSRPWarningIssued)) + { + Debug.LogWarning("The Visual Effect Graph is supported in the High Definition Render Pipeline (HDRP) and the Universal Render Pipeline (URP). Please assign your chosen Render Pipeline Asset in the Graphics Settings to use it."); + unsupportedSRPWarningIssued = true; + } + } + + public static void LogUnsupportedSRP(bool forceLog = true) + { + bool logIssued = unsupportedSRPWarningIssued; + var binder = currentSRPBinder; + + if (logIssued || !unsupportedSRPWarningIssued) // Don't reissue warning if inner currentSRPBinder call has already logged it + LogUnsupportedSRP(binder, forceLog); + } + public static VFXSRPBinder currentSRPBinder { get { LoadSRPBindersIfNeeded(); + VFXSRPBinder binder = null; - srpBinders.TryGetValue(GraphicsSettings.currentRenderPipeline == null ? "None" : GraphicsSettings.currentRenderPipeline.GetType().Name, out binder); + var currentSRP = QualitySettings.renderPipeline ?? GraphicsSettings.currentRenderPipeline; + if (currentSRP != null) + srpBinders.TryGetValue(currentSRP.GetType().Name, out binder); - if (binder == null) - throw new NullReferenceException("The SRP was not registered in VFX: " + GraphicsSettings.currentRenderPipeline.GetType()); + LogUnsupportedSRP(binder, false); return binder; } } + [InitializeOnLoadMethod] + private static void RegisterSRPChangeCallback() + { + EventInfo onRPChanged = typeof(RenderPipelineManager).GetEvent("activeRenderPipelineTypeChanged", BindingFlags.NonPublic | BindingFlags.Static); + if (onRPChanged != null) + { + MethodInfo addHandler = onRPChanged.GetAddMethod(nonPublic: true); + addHandler.Invoke(null, new Action[] { SRPChanged }); + } + + // Once activeRenderPipelineTypeChanged is public don't use reflection anymore + //RenderPipelineManager.activeRenderPipelineTypeChanged += OnSRPChanged; + } + + public delegate void OnSRPChangedEvent(); + public static event OnSRPChangedEvent OnSRPChanged; + + private static void SRPChanged() + { + unsupportedSRPWarningIssued = false; + OnSRPChanged?.Invoke(); + VFXAssetManager.Build(); + } + private static LibrarySentinel m_Sentinel = null; private static volatile List> m_ContextDescs; diff --git a/com.unity.visualeffectgraph/Editor/Data/VFXDataMesh.cs b/com.unity.visualeffectgraph/Editor/Data/VFXDataMesh.cs index 1ef953e1041..861abc675c7 100644 --- a/com.unity.visualeffectgraph/Editor/Data/VFXDataMesh.cs +++ b/com.unity.visualeffectgraph/Editor/Data/VFXDataMesh.cs @@ -46,6 +46,8 @@ public override void OnEnable() { base.OnEnable(); + VFXLibrary.OnSRPChanged += OnSRPChanged; + if (object.ReferenceEquals(shader, null)) shader = VFXResources.defaultResources.shader; if (m_Shader != null) @@ -58,6 +60,17 @@ public override void OnEnable() } } + public virtual void OnDisable() + { + VFXLibrary.OnSRPChanged -= OnSRPChanged; + DestroyCachedMaterial(); + } + + private void OnSRPChanged() + { + DestroyCachedMaterial(); + } + public void RefreshShader() { DestroyCachedMaterial(); @@ -70,11 +83,6 @@ private void DestroyCachedMaterial() m_CachedMaterial = null; } - public void OnDisable() - { - DestroyCachedMaterial(); - } - public override void CopySettings(T dst) { VFXDataMesh other = dst as VFXDataMesh; @@ -98,7 +106,8 @@ public Material GetOrCreateMaterial() { m_CachedMaterial = new Material(shader); m_CachedMaterial.hideFlags = HideFlags.HideAndDontSave; - VFXLibrary.currentSRPBinder.SetupMaterial(m_CachedMaterial); + + VFXLibrary.currentSRPBinder?.SetupMaterial(m_CachedMaterial); } return m_CachedMaterial; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs index 064abca3f3c..67dd4546f5d 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs @@ -46,6 +46,8 @@ protected void SetupFramingShortcutHandler(VFXView view) [MenuItem("Window/Visual Effects/Visual Effect Graph", false, 3011)] public static void ShowWindow() { + VFXLibrary.LogUnsupportedSRP(); + GetWindow(); } @@ -55,6 +57,8 @@ public VFXView graphView } public void LoadAsset(VisualEffectAsset asset, VisualEffect effectToAttach) { + VFXLibrary.LogUnsupportedSRP(); + string assetPath = AssetDatabase.GetAssetPath(asset); VisualEffectResource resource = VisualEffectResource.GetResourceAtPath(assetPath); diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs index 7d91fb73b6e..e27c0f95b2f 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs @@ -1420,6 +1420,8 @@ void OnResyncMaterial() void OnCompile() { + VFXLibrary.LogUnsupportedSRP(); + if (controller.model.isSubgraph) controller.graph.RecompileIfNeeded(false, false); else diff --git a/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs b/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs index 835b751b15a..721f7a686c0 100644 --- a/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs @@ -53,7 +53,7 @@ public override void OnInspectorGUI() GUI.enabled = AssetDatabase.IsOpenForEdit(target, StatusQueryOptions.UseCachedIfPossible); - EditorGUILayout.LabelField("Current Scriptable Render Pipeline: " + VFXLibrary.currentSRPBinder.SRPAssetTypeStr); + EditorGUILayout.LabelField("Current Scriptable Render Pipeline: " + VFXLibrary.currentSRPBinder?.SRPAssetTypeStr); foreach (var property in m_TimeProperties) { diff --git a/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs b/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs index 2a11a300083..74b2046b5fc 100644 --- a/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs @@ -1333,7 +1333,7 @@ public void OnInspectorGUI() if (m_RenderingLayerMask != null) { string[] layerNames = null; - var srpAsset = GraphicsSettings.currentRenderPipeline; + var srpAsset = QualitySettings.renderPipeline ?? GraphicsSettings.currentRenderPipeline; if (srpAsset != null) layerNames = srpAsset.renderingLayerMaskNames; diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs index b19597a2772..bd783fa2a86 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs @@ -80,7 +80,7 @@ public VFXSRPSubOutput subOutput get { if (m_CurrentSubOutput == null) - GetOrCreateSubOutput(); + m_CurrentSubOutput = GetOrCreateSubOutput(); return m_CurrentSubOutput; } } @@ -117,10 +117,21 @@ private VFXSRPSubOutput GetOrCreateSubOutput() public override void OnEnable() { + VFXLibrary.OnSRPChanged += OnSRPChanged; InitSubOutputs(m_SubOutputs, false); base.OnEnable(); } + public virtual void OnDisable() + { + VFXLibrary.OnSRPChanged -= OnSRPChanged; + } + + private void OnSRPChanged() + { + m_CurrentSubOutput = null; + } + public List GetSubOutputs() { return m_SubOutputs; diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs index b9d86d9a27f..0acb2e9bbce 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs @@ -128,9 +128,9 @@ static void CheckCompilationVersion() } } } - class VFXCacheManager : EditorWindow + class VFXAssetManager : EditorWindow { - private static List GetAllVisualEffectObjects() + public static List GetAllVisualEffectObjects() { var vfxObjects = new List(); var vfxObjectsGuid = AssetDatabase.FindAssets("t:VisualEffectObject"); @@ -146,8 +146,7 @@ private static List GetAllVisualEffectObjects() return vfxObjects; } - [MenuItem("Edit/VFX/Rebuild And Save All VFX Graphs", priority = 320)] - public static void Build() + public static void Build(bool forceDirty = false) { var vfxObjects = GetAllVisualEffectObjects(); @@ -161,11 +160,18 @@ public static void Build() { VFXGraph graph = resource.GetOrCreateGraph(); AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graph)); - EditorUtility.SetDirty(resource); + if (forceDirty) + EditorUtility.SetDirty(resource); } } VFXExpression.ClearCache(); + } + + [MenuItem("Edit/VFX/Rebuild And Save All VFX Graphs", priority = 320)] + public static void BuildAndSave() + { + Build(true); AssetDatabase.SaveAssets(); } } @@ -283,6 +289,18 @@ class VFXGraph : VFXModel public override void OnEnable() { base.OnEnable(); + VFXLibrary.OnSRPChanged += OnSRPChanged; + m_ExpressionGraphDirty = true; + } + + public virtual void OnDisable() + { + VFXLibrary.OnSRPChanged -= OnSRPChanged; + } + + private void OnSRPChanged() + { + m_GraphSanitized = false; m_ExpressionGraphDirty = true; } diff --git a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs index f515dd17943..985f64dd83c 100644 --- a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs +++ b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs @@ -168,7 +168,7 @@ public BlendMode GetMaterialBlendMode() var blendMode = BlendMode.Opaque; var shaderGraph = GetOrRefreshShaderGraphObject(); - if (shaderGraph != null && shaderGraph.generatesWithShaderGraph) + if (shaderGraph != null && shaderGraph.generatesWithShaderGraph && VFXLibrary.currentSRPBinder != null) { // VFX Blend Mode state configures important systems like sorting and indirect buffer. // In the case of SG Generation path, we need to know the blend mode state of the SRP @@ -303,7 +303,7 @@ protected string shaderName { var shaderGraph = GetOrRefreshShaderGraphObject(); - if (shaderGraph == null || !shaderGraph.generatesWithShaderGraph) + if (shaderGraph == null || !shaderGraph.generatesWithShaderGraph || VFXLibrary.currentSRPBinder == null) return string.Empty; return VFXLibrary.currentSRPBinder.GetShaderName(shaderGraph); diff --git a/com.unity.visualeffectgraph/Editor/Utils/VFXDebugWindow.cs b/com.unity.visualeffectgraph/Editor/Utils/VFXDebugWindow.cs index 9971eb7c8f2..d7e89f11e08 100644 --- a/com.unity.visualeffectgraph/Editor/Utils/VFXDebugWindow.cs +++ b/com.unity.visualeffectgraph/Editor/Utils/VFXDebugWindow.cs @@ -23,7 +23,7 @@ private void OnGUI() VFXCacheManager.Clear();*/ if (GUILayout.Button("Recompile All")) - VFXCacheManager.Build(); + VFXAssetManager.Build(); } EditorGUILayout.Space(); /* diff --git a/com.unity.visualeffectgraph/Editor/VFXAssetEditorUtility.cs b/com.unity.visualeffectgraph/Editor/VFXAssetEditorUtility.cs index 9592bd25738..5d647e09378 100644 --- a/com.unity.visualeffectgraph/Editor/VFXAssetEditorUtility.cs +++ b/com.unity.visualeffectgraph/Editor/VFXAssetEditorUtility.cs @@ -108,6 +108,8 @@ public static T CreateNew(string path) where T : UnityObject [MenuItem("Assets/Create/Visual Effects/Visual Effect Graph", false, 306)] public static void CreateVisualEffectAsset() { + VFXLibrary.LogUnsupportedSRP(); + string templateString = ""; try { diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy.meta deleted file mode 100644 index 70a0d313e1b..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 91fe1b60e2a001347892e658aba3d6e8 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates.meta deleted file mode 100644 index edfa1247847..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 05f553c0953df6444b546884077d6df3 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleBasicCube.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleBasicCube.template deleted file mode 100644 index c5b41f1f2de..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleBasicCube.template +++ /dev/null @@ -1,10 +0,0 @@ -{ - SubShader - { - Cull Back - - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticleHexahedron/PassBasicForward.template")} - ${VFXInclude("Shaders/ParticleHexahedron/PassShadowCaster.template"),USE_CAST_SHADOWS_PASS} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleBasicCube.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleBasicCube.template.meta deleted file mode 100644 index c1d478e9561..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleBasicCube.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: fea0c8844b91ec7469c6d20582b5aed8 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleCube.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleCube.template deleted file mode 100644 index aee598fb11f..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleCube.template +++ /dev/null @@ -1,10 +0,0 @@ -{ - SubShader - { - Cull Back - - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticleHexahedron/PassForward.template")} - ${VFXInclude("Shaders/ParticleHexahedron/PassShadowCaster.template"),USE_CAST_SHADOWS_PASS} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleCube.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleCube.template.meta deleted file mode 100644 index 5ee986e5ce7..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleCube.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 268e13180bceb574198fc52de11e198b -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleDecal.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleDecal.template deleted file mode 100644 index 6ed717a40cb..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleDecal.template +++ /dev/null @@ -1,9 +0,0 @@ -{ - SubShader - { - Cull Back - - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticleDecals/PassForward.template")} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleDecal.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleDecal.template.meta deleted file mode 100644 index 9d5d8e5118d..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleDecal.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 492e24e6541cb77479f4b33875b2391a -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesHW.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesHW.template deleted file mode 100644 index 8d7985d8303..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesHW.template +++ /dev/null @@ -1,8 +0,0 @@ -{ - SubShader - { - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticleLines/PassForward.template")} - ${VFXInclude("Shaders/ParticleLines/PassShadowCaster.template"),USE_CAST_SHADOWS_PASS} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesHW.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesHW.template.meta deleted file mode 100644 index f2c6cf6f81f..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesHW.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 439db59106e9dc948aaf20f86bb03e88 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesSW.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesSW.template deleted file mode 100644 index d78e291d016..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesSW.template +++ /dev/null @@ -1,8 +0,0 @@ -{ - SubShader - { - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticleLinesSW/PassForward.template")} - ${VFXInclude("Shaders/ParticleLinesSW/PassShadowCaster.template"),USE_CAST_SHADOWS_PASS} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesSW.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesSW.template.meta deleted file mode 100644 index 5c7467ede0f..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleLinesSW.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c0f42375f75f4034c80e18307a87bd00 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleMeshes.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleMeshes.template deleted file mode 100644 index be729361eec..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleMeshes.template +++ /dev/null @@ -1,10 +0,0 @@ -{ - SubShader - { - Cull Off - - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticleMeshes/PassForward.template")} - ${VFXInclude("Shaders/ParticleMeshes/PassShadowCaster.template"),USE_CAST_SHADOWS_PASS} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleMeshes.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleMeshes.template.meta deleted file mode 100644 index 40bd973fc38..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticleMeshes.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 53796f02bccb5884295a9ce200bb4868 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePlanarPrimitive.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePlanarPrimitive.template deleted file mode 100644 index b6ac68145a8..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePlanarPrimitive.template +++ /dev/null @@ -1,10 +0,0 @@ -{ - SubShader - { - Cull Off - - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticlePlanarPrimitives/PassForward.template")} - ${VFXInclude("Shaders/ParticlePlanarPrimitives/PassShadowCaster.template"),USE_CAST_SHADOWS_PASS} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePlanarPrimitive.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePlanarPrimitive.template.meta deleted file mode 100644 index f182b8c5529..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePlanarPrimitive.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8381a04dc80bca046be0e29c24fee6a0 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePoints.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePoints.template deleted file mode 100644 index 5d04624783b..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePoints.template +++ /dev/null @@ -1,9 +0,0 @@ -{ - SubShader - { - ${VFXInclude("Shaders/VFXParticleHeader.template")} - ${VFXInclude("Shaders/ParticlePoints/PassDepth.template"),USE_OPAQUE_PARTICLE} - ${VFXInclude("Shaders/ParticlePoints/PassForward.template")} - ${VFXInclude("Shaders/ParticlePoints/PassShadowCaster.template"),USE_CAST_SHADOWS_PASS} - } -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePoints.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePoints.template.meta deleted file mode 100644 index de8c6a52219..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/Templates/VFXParticlePoints.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 62d56101d2886694b916a93472f46254 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl deleted file mode 100644 index bc63721f4f3..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl +++ /dev/null @@ -1,141 +0,0 @@ -#include "UnityCG.cginc" - -Texture2D _CameraDepthTexture; - -//Additionnal empty wrapper (equivalent to expected functions in com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl) -float3 GetAbsolutePositionWS(float3 positionRWS) -{ - return positionRWS; -} -float3 GetCameraRelativePositionWS(float3 positionWS) -{ - return positionWS; -} - -void VFXTransformPSInputs(inout VFX_VARYING_PS_INPUTS input) {} - -void VFXEncodeMotionVector(float2 velocity, out float4 outBuffer) -{ - outBuffer = (float4)0.0f; //TODO -} - -float4 VFXTransformPositionWorldToClip(float3 posWS) -{ - return UnityWorldToClipPos(posWS); -} - -float4 VFXTransformFinalColor(float4 color) -{ - return color; -} - -float4 VFXTransformPositionWorldToNonJitteredClip(float3 posWS) -{ - return VFXTransformPositionWorldToClip(posWS); //TODO -} - -float4 VFXTransformPositionWorldToPreviousClip(float3 posWS) -{ - return VFXTransformPositionWorldToClip(posWS); //TODO -} - -float4 VFXTransformPositionObjectToClip(float3 posOS) -{ - return UnityObjectToClipPos(posOS); -} - -float4 VFXTransformPositionObjectToNonJitteredClip(float3 posOS) -{ - return VFXTransformPositionObjectToClip(posOS); //TODO -} - -float4 VFXTransformPositionObjectToPreviousClip(float3 posOS) -{ - return VFXTransformPositionObjectToClip(posOS); //TODO -} - -float3 VFXTransformPositionWorldToView(float3 posWS) -{ - return mul(UNITY_MATRIX_V, float4(posWS, 1.0f)).xyz; -} - -float3 VFXTransformPositionWorldToCameraRelative(float3 posWS) -{ -#if (VFX_WORLD_SPACE || SHADEROPTIONS_CAMERA_RELATIVE_RENDERING == 0) - return posWS - _WorldSpaceCameraPos.xyz; -#else - return posWS; -#endif -} - -float4x4 VFXGetObjectToWorldMatrix() -{ - return unity_ObjectToWorld; -} - -float4x4 VFXGetWorldToObjectMatrix() -{ - return unity_WorldToObject; -} - -float3x3 VFXGetWorldToViewRotMatrix() -{ - return (float3x3)UNITY_MATRIX_V; -} - -float3 VFXGetViewWorldPosition() -{ - // Not using _WorldSpaceCameraPos as it's not what expected for the shadow pass - // (It remains primary camera position not view position) - return UNITY_MATRIX_I_V._m03_m13_m23; -} - -float4x4 VFXGetViewToWorldMatrix() -{ - return UNITY_MATRIX_I_V; -} - -float VFXSampleDepth(float4 posSS) -{ - return _CameraDepthTexture.Load(int3(posSS.xy, 0)).r; -} - -float VFXLinearEyeDepth(float depth) -{ - return LinearEyeDepth(depth); -} - -float4 VFXApplyShadowBias(float4 posCS) -{ - return UnityApplyLinearShadowBias(posCS); -} - -void VFXApplyShadowBias(inout float4 posCS, inout float3 posWS, float3 normalWS) -{ - posCS = UnityApplyLinearShadowBias(posCS); -} - -void VFXApplyShadowBias(inout float4 posCS, inout float3 posWS) -{ - posCS = UnityApplyLinearShadowBias(posCS); -} - -float4 VFXApplyFog(float4 color,float4 posSS,float3 posWS) -{ - return color; // TODO -} - -float4 VFXApplyPreExposure(float4 color, float exposureWeight) -{ - return color; -} - -float4 VFXApplyPreExposure(float4 color, VFX_VARYING_PS_INPUTS input) -{ - return color; -} - -float3 VFXGetCameraWorldDirection() -{ - return unity_CameraToWorld._m02_m12_m22; -} diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl.meta deleted file mode 100644 index 5526231ecd9..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d2131730d2c143a4ba6e429a08f50ae8 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXDefines.hlsl b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXDefines.hlsl deleted file mode 100644 index 6d3674ee9da..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXDefines.hlsl +++ /dev/null @@ -1,3 +0,0 @@ -#include "HLSLSupport.cginc" - -#define UNITY_VERTEX_OUTPUT_STEREO // So that templates compile diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXDefines.hlsl.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXDefines.hlsl.meta deleted file mode 100644 index 4af3d8aac9a..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXDefines.hlsl.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1471639f3a2608646ab3b39c2ce36ea1 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXPasses.template b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXPasses.template deleted file mode 100644 index ed070d6dc73..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXPasses.template +++ /dev/null @@ -1,3 +0,0 @@ -${VFXBegin:VFXPassForward}"ForwardBase"${VFXEnd} -${VFXBegin:VFXPassShadow}"ShadowCaster"${VFXEnd} -${VFXBegin:VFXPassVelocity}"MotionVectors"${VFXEnd} \ No newline at end of file diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXPasses.template.meta b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXPasses.template.meta deleted file mode 100644 index 1359ef316b0..00000000000 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXPasses.template.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f82f2cf1ef0aab74999471137de4cffa -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: