From cc14a4f3f4a3f2b98f702904d34b1b46553b8306 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Tue, 4 Mar 2025 13:05:02 +0800 Subject: [PATCH] stash --- Runtime/Gizmos/DebugX.base.cs | 84 ++++++++++++------ Runtime/Gizmos/DebugX.lines.cs | 6 +- Runtime/Gizmos/DebugX.primitives.cs | 35 +++++++- Runtime/Materials/Line.mat | 30 +++++++ Runtime/Materials/Line.mat.meta | 8 ++ .../DCFApixels.DebugX/MaterialsList.prefab | 87 +++++++++++++++++++ Runtime/Shaders/HandlesLine.shader | 73 ++++++++++++++++ Runtime/Shaders/HandlesLine.shader.meta | 9 ++ Runtime/Utils/DebugXAssets.cs | 1 + Runtime/Utils/StaticData.cs | 31 +++++-- 10 files changed, 324 insertions(+), 40 deletions(-) create mode 100644 Runtime/Materials/Line.mat create mode 100644 Runtime/Materials/Line.mat.meta create mode 100644 Runtime/Shaders/HandlesLine.shader create mode 100644 Runtime/Shaders/HandlesLine.shader.meta diff --git a/Runtime/Gizmos/DebugX.base.cs b/Runtime/Gizmos/DebugX.base.cs index de0acd6..481e80f 100644 --- a/Runtime/Gizmos/DebugX.base.cs +++ b/Runtime/Gizmos/DebugX.base.cs @@ -1,6 +1,7 @@ //#undef DEBUG using DCFApixels.DebugXCore; using DCFApixels.DebugXCore.Internal; +using System.Runtime.InteropServices; using Unity.Collections.LowLevel.Unsafe; using Unity.Jobs; using UnityEngine; @@ -190,7 +191,7 @@ namespace DCFApixels [IN(LINE)] public DrawHandler Line(Vector3 start, Vector3 end) { - return Gizmo(new WireLineGizmo(start, end)); + return Gizmo(new WireLineGizmo(start, end)); } private readonly struct WireLineGizmo : IGizmo> where TMat : struct, IStaticMaterial @@ -315,7 +316,7 @@ namespace DCFApixels } public void Render(CommandBuffer cb) { - Material material = _material.GetMaterial(); + Material material = _material.GetMaterial_SupportCumputeShaders(); var items = new GizmosList(_gizmos.Array, _prepareCount).As().Items; _materialPropertyBlock.Clear(); _jobHandle.Complete(); @@ -414,7 +415,7 @@ namespace DCFApixels } protected void Render(CommandBuffer cb) { - Material material = _material.GetMaterial(); + Material material = _material.GetMaterial_SupportCumputeShaders(); Mesh mesh = _mesh.GetMesh(); _materialPropertyBlock.Clear(); _jobHandle.Complete(); @@ -443,14 +444,22 @@ namespace DCFApixels public readonly Vector3 Start; public readonly Vector3 End; } + private readonly struct DrawData + { + public readonly Matrix4x4 Matrix; + public readonly Color Color; + public DrawData(Matrix4x4 matrix, Color color) + { + Matrix = matrix; + Color = color; + } + } private struct PrepareJob : IJobParallelFor { [NativeDisableUnsafePtrRestriction] public Gizmo* Items; [NativeDisableUnsafePtrRestriction] - public Matrix4x4* ResultMatrices; - [NativeDisableUnsafePtrRestriction] - public Vector4* ResultColors; + public DrawData* ResultData; public void Execute(int index) { ref readonly var item = ref Items[index]; @@ -458,18 +467,19 @@ namespace DCFApixels Vector3 halfDiff = (item.Value.End - item.Value.Start) * 0.5f; Vector3 position = item.Value.Start + halfDiff; - ResultMatrices[index] = Matrix4x4.TRS(position, Quaternion.identity, halfDiff); - ResultColors[index] = item.Color; + ResultData[index] = new DrawData(Matrix4x4.TRS(position, Quaternion.identity, halfDiff), item.Color); } } private readonly IStaticMesh _mesh = default(WireLineMesh); private readonly IStaticMaterial _material; private readonly MaterialPropertyBlock _materialPropertyBlock; + private readonly uint[] _args = new uint[5] { 0, 0, 0, 0, 0 }; + private readonly GraphicsBuffer _argsBuffer; + private GraphicsBuffer _graphicsBuffer; private int _buffersLength = 0; - private PinnedArray _matrices; - private PinnedArray _colors; + private PinnedArray _drawDatas; private PinnedArray> _gizmos; private JobHandle _jobHandle; @@ -480,8 +490,9 @@ namespace DCFApixels _material = material; _materialPropertyBlock = new MaterialPropertyBlock(); - _matrices = PinnedArray.Pin(DummyArray.Get()); - _colors = PinnedArray.Pin(DummyArray.Get()); + _drawDatas = PinnedArray.Pin(DummyArray.Get()); + + _argsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.IndirectArguments, 1, _args.Length * sizeof(uint)); } public virtual int ExecuteOrder => _material.GetExecuteOrder(); public virtual bool IsStaticRender => true; @@ -494,13 +505,12 @@ namespace DCFApixels if (_buffersLength < count) { - if (_matrices.Array != null) + if (_drawDatas.Array != null) { - _matrices.Dispose(); - _colors.Dispose(); + _drawDatas.Dispose(); } - _matrices = PinnedArray.Pin(new Matrix4x4[DebugXUtility.NextPow2(count)]); - _colors = PinnedArray.Pin(new Vector4[DebugXUtility.NextPow2(count)]); + _drawDatas = PinnedArray.Pin(new DrawData[DebugXUtility.NextPow2(count)]); + AllocateGraphicsBuffer(DebugXUtility.NextPow2(count)); _buffersLength = count; } if (ReferenceEquals(_gizmos.Array, items) == false) @@ -515,32 +525,56 @@ namespace DCFApixels var job = new PrepareJob { Items = _gizmos.Ptr, - ResultMatrices = _matrices.Ptr, - ResultColors = _colors.Ptr, + ResultData = _drawDatas.Ptr, }; - _jobHandle = job.Schedule(count, 16); + _jobHandle = job.Schedule(count, 64); } + + + private readonly static int _BufferPropertyID = Shader.PropertyToID("_DataBuffer"); public void Render(CommandBuffer cb) { - Material material = _material.GetMaterial(); Mesh mesh = _mesh.GetMesh(); _materialPropertyBlock.Clear(); _jobHandle.Complete(); if (IsSupportsComputeShaders) { - _materialPropertyBlock.SetVectorArray(ColorPropertyID, _colors.Array); - cb.DrawMeshInstanced(mesh, 0, material, -1, _matrices.Array, _prepareCount, _materialPropertyBlock); + Material material = _material.GetMaterial_SupportCumputeShaders(); + //_materialPropertyBlock.SetVectorArray(ColorPropertyID, _colors.Array); + //cb.DrawMeshInstanced(mesh, 0, material, -1, _matrices.Array, _prepareCount, _materialPropertyBlock); + + //uint[] args = new uint[5] { mesh.GetIndexCount(0), (uint)_prepareCount, 0, 0, 0 }; + //_argsBuffer.SetData(args); + + _graphicsBuffer.SetData(_drawDatas.Array); + _materialPropertyBlock.SetBuffer(_BufferPropertyID, _graphicsBuffer); + + //cb.DrawMeshInstancedIndirect(mesh, 0, material, -1, _argsBuffer, _prepareCount, _materialPropertyBlock); + // _prepareCount, _materialPropertyBlock + //cb.DrawMeshInstancedIndirect(mesh, 0, material, new Bounds(Vector3.zero, new Vector3(100.0f, 100.0f, 100.0f)), _argsBuffer); + + + cb.DrawMeshInstancedProcedural(mesh, 0, material, -1, _prepareCount, _materialPropertyBlock); } else { + Material material = _material.GetMaterial_Default(); for (int i = 0; i < _prepareCount; i++) { - _materialPropertyBlock.SetColor(ColorPropertyID, _colors.Ptr[i]); - cb.DrawMesh(mesh, _matrices.Ptr[i], material, 0, -1, _materialPropertyBlock); + _materialPropertyBlock.SetColor(ColorPropertyID, _drawDatas.Ptr[i].Color); + cb.DrawMesh(mesh, _drawDatas.Ptr[i].Matrix, material, 0, -1, _materialPropertyBlock); } } } + + + private void AllocateGraphicsBuffer(int capacity) + { + _graphicsBuffer?.Dispose(); + _graphicsBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured, capacity, Marshal.SizeOf()); + + } } #endregion } diff --git a/Runtime/Gizmos/DebugX.lines.cs b/Runtime/Gizmos/DebugX.lines.cs index 6c8688a..f287eb7 100644 --- a/Runtime/Gizmos/DebugX.lines.cs +++ b/Runtime/Gizmos/DebugX.lines.cs @@ -202,7 +202,7 @@ namespace DCFApixels public void Render(Camera camera, GizmosList list, CommandBuffer cb) { if (camera == null) { return; } - default(UnlitOverwriteMat).GetMaterial().SetPass(0); + default(UnlitOverwriteMat).GetMaterial_SupportCumputeShaders().SetPass(0); GL.Begin(GL.QUADS); Vector3 cameraPosition = camera.transform.position; foreach (ref readonly var item in list) @@ -256,7 +256,7 @@ namespace DCFApixels public void Render(Camera camera, GizmosList list, CommandBuffer cb) { if (camera == null) { return; } - default(UnlitOverwriteMat).GetMaterial().SetPass(0); + default(UnlitOverwriteMat).GetMaterial_SupportCumputeShaders().SetPass(0); GL.Begin(GL.LINES); var cameraPosition = camera.transform.position; foreach (ref readonly var item in list) @@ -318,7 +318,7 @@ namespace DCFApixels { if (camera == null) { return; } GL.PushMatrix(); - default(UnlitOverwriteMat).GetMaterial().SetPass(0); + default(UnlitOverwriteMat).GetMaterial_SupportCumputeShaders().SetPass(0); GL.Begin(GL.LINES); var cameraPosition = camera.transform.position; foreach (ref readonly var item in list) diff --git a/Runtime/Gizmos/DebugX.primitives.cs b/Runtime/Gizmos/DebugX.primitives.cs index ce83a8c..ae03eb9 100644 --- a/Runtime/Gizmos/DebugX.primitives.cs +++ b/Runtime/Gizmos/DebugX.primitives.cs @@ -392,8 +392,35 @@ namespace DCFApixels [IN(LINE)] public unsafe DrawHandler CubeGrid(Vector3 position, Quaternion rotation, Vector3 size, Vector3Int cells) { - Vector3 halfSize = size / 2f; + //float m, add; + //int iMax; + // + //iMax = (cells.x + 1) / 2; + //m = size.x / iMax; + //add = (cells.x & 1) == 0 ? m * 0.5f : 0; + //for (int i = 0; i < iMax; i++) + //{ + // WireCube(position, rotation, new Vector3(add + i * m, size.y, size.z)); + //} + // + //iMax = (cells.y + 1) / 2; + //m = size.y / iMax; + //add = (cells.y & 1) == 0 ? 0 : m * 0.5f; + //for (int i = 0; i < iMax; i++) + //{ + // WireCube(position, rotation, new Vector3(size.x, add + i * m, size.z)); + //} + // + //iMax = (cells.z + 1) / 2; + //m = size.z / iMax; + //add = (cells.z & 1) == 0 ? 0 : m * 0.5f; + //for (int i = 0; i < iMax; i++) + //{ + // WireCube(position, rotation, new Vector3(size.x, size.y, add + i * m)); + //} + Vector3 halfSize = size / 2f; + Vector3* vertices = stackalloc Vector3[] { new Vector3(-halfSize.x, -halfSize.y, -halfSize.z), // 0 @@ -405,12 +432,12 @@ namespace DCFApixels new Vector3(halfSize.x, halfSize.y, halfSize.z), // 6 new Vector3(-halfSize.x, halfSize.y, halfSize.z), // 7 }; - + for (int i = 0; i < 8; i++) { vertices[i] = rotation * vertices[i] + position; } - + Vector3 up = rotation * Vector3.up * (size.y / cells.y); for (int i = 0; i <= cells.y; i++) { @@ -438,7 +465,7 @@ namespace DCFApixels Line(vertices[1] + pos, vertices[0] + pos); Line(vertices[0] + pos, vertices[4] + pos); } - + return this; } #endregion diff --git a/Runtime/Materials/Line.mat b/Runtime/Materials/Line.mat new file mode 100644 index 0000000..cd7779d --- /dev/null +++ b/Runtime/Materials/Line.mat @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Line + m_Shader: {fileID: 4800000, guid: 4dc765b931552b54b957905b156bae66, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Runtime/Materials/Line.mat.meta b/Runtime/Materials/Line.mat.meta new file mode 100644 index 0000000..58d6381 --- /dev/null +++ b/Runtime/Materials/Line.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fce881fda18d0a44fb62c8375d3e2fd4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab b/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab index 45af61d..963b410 100644 --- a/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab +++ b/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab @@ -172,6 +172,92 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &817216530089604692 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2185866943208229465} + - component: {fileID: 7306071439557822573} + - component: {fileID: 7642098115862499429} + m_Layer: 0 + m_Name: Line + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2185866943208229465 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 817216530089604692} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2844384060761577604} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7306071439557822573 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 817216530089604692} + m_Mesh: {fileID: 4300000, guid: 873de0939b7f76947a258a8897199a8e, type: 2} +--- !u!23 &7642098115862499429 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 817216530089604692} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: fce881fda18d0a44fb62c8375d3e2fd4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!1 &1299980064020930364 GameObject: m_ObjectHideFlags: 0 @@ -380,6 +466,7 @@ Transform: - {fileID: 5119875421667202613} - {fileID: 1046323005297189095} - {fileID: 7483746332942052062} + - {fileID: 2185866943208229465} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6318046265503597909 diff --git a/Runtime/Shaders/HandlesLine.shader b/Runtime/Shaders/HandlesLine.shader new file mode 100644 index 0000000..26d513b --- /dev/null +++ b/Runtime/Shaders/HandlesLine.shader @@ -0,0 +1,73 @@ +Shader "DCFApixels/DebugX/Handles Line" +{ + SubShader + { + Tags { "Queue"="Transparent" "RenderType"="Transparent" "IgnoreProjector"="True" "ForceNoShadowCasting"="True" } + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + Fog { Mode Off } + Lighting Off + Offset -1, -1 + + ZTest On + + CGINCLUDE + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_instancing + #include "UnityCG.cginc" + + struct InstanceData + { + float4x4 m; + float4 color; + }; + + struct appdata_t + { + float4 vertex : POSITION; + }; + + struct v2f + { + float4 vertex : SV_POSITION; + half4 color : COLOR; + }; + + StructuredBuffer _DataBuffer; + float4 _DebugX_GlobalColor; + + v2f vert (appdata_t v, uint instanceID : SV_InstanceID) + { + v2f o; + InstanceData data = _DataBuffer[instanceID]; + + float4 pos = mul(data.m, v.vertex); + o.vertex = UnityObjectToClipPos(pos); + o.color = data.color * _DebugX_GlobalColor; + return o; + } + ENDCG + + Pass + { + ZTest LEqual + CGPROGRAM + half4 frag (v2f i) : SV_Target + { + return i.color; + } + ENDCG + } + Pass + { + ZTest Greater + CGPROGRAM + half4 frag (v2f i) : SV_Target + { + return i.color * half4(1, 1, 1, 0.1); + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Runtime/Shaders/HandlesLine.shader.meta b/Runtime/Shaders/HandlesLine.shader.meta new file mode 100644 index 0000000..ed01277 --- /dev/null +++ b/Runtime/Shaders/HandlesLine.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4dc765b931552b54b957905b156bae66 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Utils/DebugXAssets.cs b/Runtime/Utils/DebugXAssets.cs index 4dd0e53..ac4f46e 100644 --- a/Runtime/Utils/DebugXAssets.cs +++ b/Runtime/Utils/DebugXAssets.cs @@ -44,6 +44,7 @@ namespace DCFApixels.DebugXCore { public readonly Material Lit; public readonly Material Unlit; + public readonly Material Line; public readonly Material UnlitOverwrite; public readonly Material Billboard; public readonly Material Dot; diff --git a/Runtime/Utils/StaticData.cs b/Runtime/Utils/StaticData.cs index cf6304f..3f5a108 100644 --- a/Runtime/Utils/StaticData.cs +++ b/Runtime/Utils/StaticData.cs @@ -5,11 +5,13 @@ namespace DCFApixels.DebugXCore public interface IStaticMaterial : IStaticData { int GetExecuteOrder(); - Material GetMaterial(); + Material GetMaterial_SupportCumputeShaders(); + Material GetMaterial_Default(); } public interface IStaticMesh : IStaticData { Mesh GetMesh(); + // int GetBufferWarmupSize(); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -17,37 +19,50 @@ namespace DCFApixels.DebugXCore public readonly struct LitMat : IStaticMaterial { public int GetExecuteOrder() => 0; - public Material GetMaterial() => DebugXAssets.Materials.Lit; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.Lit; + public Material GetMaterial_Default() => DebugXAssets.Materials.Lit; } public readonly struct UnlitMat : IStaticMaterial { public int GetExecuteOrder() => 100_000; - public Material GetMaterial() => DebugXAssets.Materials.Unlit; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.Unlit; + public Material GetMaterial_Default() => DebugXAssets.Materials.Unlit; + } + public readonly struct LineMat : IStaticMaterial + { + public int GetExecuteOrder() => 100_000; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.Line; + public Material GetMaterial_Default() => DebugXAssets.Materials.Unlit; } public readonly struct BillboardMat : IStaticMaterial { public int GetExecuteOrder() => 200_000; - public Material GetMaterial() => DebugXAssets.Materials.Billboard; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.Billboard; + public Material GetMaterial_Default() => DebugXAssets.Materials.Billboard; } public readonly struct DotMat : IStaticMaterial { public int GetExecuteOrder() => 300_000; - public Material GetMaterial() => DebugXAssets.Materials.Dot; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.Dot; + public Material GetMaterial_Default() => DebugXAssets.Materials.Dot; } public readonly struct GeometryUnlitMat : IStaticMaterial { public int GetExecuteOrder() => 1_000_000; - public Material GetMaterial() => DebugXAssets.Materials.Unlit; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.Unlit; + public Material GetMaterial_Default() => DebugXAssets.Materials.Unlit; } public readonly struct UnlitOverwriteMat : IStaticMaterial { public int GetExecuteOrder() => 1_000_000; - public Material GetMaterial() => DebugXAssets.Materials.UnlitOverwrite; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.UnlitOverwrite; + public Material GetMaterial_Default() => DebugXAssets.Materials.UnlitOverwrite; } public readonly struct WireMat : IStaticMaterial { public int GetExecuteOrder() => 1_000_000; - public Material GetMaterial() => DebugXAssets.Materials.Wire; + public Material GetMaterial_SupportCumputeShaders() => DebugXAssets.Materials.Wire; + public Material GetMaterial_Default() => DebugXAssets.Materials.Wire; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////