From d9da953f997470f00cff2df5dbfcaf585962dbab Mon Sep 17 00:00:00 2001 From: Kay Chang Date: Mon, 15 Apr 2024 23:02:14 -0400 Subject: [PATCH] Shader code optimisation (7% faster), manual loop unrolling (15% faster). --- .../Runtime/Effects/DepthOfField.cs | 2 + .../PostProcessing/Runtime/Utils/ShaderIDs.cs | 2 + .../Shaders/Builtins/DepthOfField.hlsl | 157 +++++++-- .../Shaders/Builtins/DiskKernels.hlsl | 311 +++++++++--------- 4 files changed, 282 insertions(+), 190 deletions(-) diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs index 32a118e0438..93d5f0d19c1 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs @@ -217,6 +217,8 @@ public override void Render(PostProcessRenderContext context) sheet.properties.SetVector(ShaderIDs.CoCKernelLimitsA, cocKernelLimitsA); sheet.properties.SetVector(ShaderIDs.CoCKernelLimitsB, cocKernelLimitsB); sheet.properties.SetVector(ShaderIDs.MaxCoCTexUvScale, new Vector4(paddedWidth / (float)context.width, paddedHeight / (float)context.height, context.width / (float)paddedWidth, context.height / (float)paddedHeight)); + sheet.properties.SetVector(ShaderIDs.KernelScale, new Vector4(maxCoC * (12f / 8f) / aspect, maxCoC * (12f / 8f), maxCoC * (12f / 8f), 0f)); // (kc) hardcoded for 4 rings + sheet.properties.SetVector(ShaderIDs.MarginFactors, new Vector4(2f / (context.height >> 1), (context.height >> 1) / 2f, 0f, 0f)); sheet.properties.SetFloat(ShaderIDs.MaxCoC, maxCoC); sheet.properties.SetVector(ShaderIDs.CoCScreen, new Vector4(context.width, context.height, 1f / context.width, 1f / context.height)); sheet.properties.SetFloat(ShaderIDs.CoCTileXCount, paddedWidth >> maxCoCMipLevel); diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs b/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs index 0a91a1c6b95..37a3486f248 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs @@ -84,6 +84,8 @@ static class ShaderIDs internal static readonly int CoCTileYCount = Shader.PropertyToID("_CoCTileYCount"); internal static readonly int CoCTilePixelWidth = Shader.PropertyToID("_CoCTilePixelWidth"); internal static readonly int CoCTilePixelHeight = Shader.PropertyToID("_CoCTilePixelHeight"); + internal static readonly int KernelScale = Shader.PropertyToID("_KernelScale"); + internal static readonly int MarginFactors = Shader.PropertyToID("_MarginFactors"); internal static readonly int MaxCoC = Shader.PropertyToID("_MaxCoC"); internal static readonly int RcpMaxCoC = Shader.PropertyToID("_RcpMaxCoC"); internal static readonly int RcpAspect = Shader.PropertyToID("_RcpAspect"); diff --git a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DepthOfField.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DepthOfField.hlsl index 2d75e7cedd5..0b5c6a85241 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DepthOfField.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DepthOfField.hlsl @@ -29,6 +29,8 @@ float _CoCTileXCount; float _CoCTileYCount; float _CoCTilePixelWidth; float _CoCTilePixelHeight; +half3 _KernelScale; +half2 _MarginFactors; float _MaxCoC; float _RcpMaxCoC; float _RcpAspect; @@ -231,12 +233,35 @@ half4 FragExtendCoC(VaryingsDefault i) : SV_Target return half4(maxCoC, 0.0, 0.0, 0.0); } +void AccumSample(int si, half4 samp0, float2 texcoord, inout half4 bgAcc, inout half4 fgAcc) +{ + half2 disp = kDiskAllKernels[si].xy * _KernelScale.xy; + half dist = kDiskAllKernels[si].z * _KernelScale.z; + half2 duv = disp; + + half4 samp = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(texcoord + duv)); + + // BG: Compare CoC of the current sample and the center sample + // and select smaller one. + half bgCoC = max(min(samp0.a, samp.a), 0.0); + + // Compare the CoC to the sample distance. + // Add a small margin to smooth out. + half bgWeight = saturate((bgCoC - dist + _MarginFactors.x) * _MarginFactors.y); + half fgWeight = saturate((-samp.a - dist + _MarginFactors.x) * _MarginFactors.y); + + // Cut influence from focused areas because they're darkened by CoC + // premultiplying. This is only needed for near field. + fgWeight *= step(_MainTex_TexelSize.y, -samp.a); + + // Accumulation + bgAcc += half4(samp.rgb, 1.0) * bgWeight; + fgAcc += half4(samp.rgb, 1.0) * fgWeight; +} // Bokeh filter with disk-shaped kernels half4 FragBlur(VaryingsDefault i) : SV_Target { - const half margin = _MainTex_TexelSize.y * 2; - half4 samp0 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo); half4 bgAcc = 0.0; // Background: far field bokeh @@ -244,21 +269,25 @@ half4 FragBlur(VaryingsDefault i) : SV_Target #if defined(KERNEL_UNIFIED) int sampleCount = kDiskAllKernelSizes[KERNEL_UNIFIED]; + half rcpSampleCount = kDiskAllKernelRcpSizes[KERNEL_UNIFIED]; #else int sampleCount = kSampleCount; + half rcpSampleCount = 1.0 / kSampleCount; #endif - UNITY_LOOP + UNITY_FLATTEN for (int si = 0; si < sampleCount; si++) { #if defined(KERNEL_UNIFIED) - float2 disp = kDiskAllKernels[si] * (_MaxCoC * (12.0 / 8.0)); + half2 disp = kDiskAllKernels[si].xy * _KernelScale.xy; + half dist = kDiskAllKernels[si].z * _KernelScale.z; + half2 duv = disp; #else - float2 disp = kDiskKernel[si] * _MaxCoC; + half2 disp = kDiskKernel[si] * _MaxCoC; + half dist = length(disp); + half2 duv = half2(disp.x * _RcpAspect, disp.y); #endif - float dist = length(disp); - float2 duv = float2(disp.x * _RcpAspect, disp.y); half4 samp = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord + duv)); // BG: Compare CoC of the current sample and the center sample @@ -267,8 +296,8 @@ half4 FragBlur(VaryingsDefault i) : SV_Target // Compare the CoC to the sample distance. // Add a small margin to smooth out. - half bgWeight = saturate((bgCoC - dist + margin) / margin); - half fgWeight = saturate((-samp.a - dist + margin) / margin); + half bgWeight = saturate((bgCoC - dist + _MarginFactors.x) * _MarginFactors.y); + half fgWeight = saturate((-samp.a - dist + _MarginFactors.x) * _MarginFactors.y); // Cut influence from focused areas because they're darkened by CoC // premultiplying. This is only needed for near field. @@ -288,7 +317,7 @@ half4 FragBlur(VaryingsDefault i) : SV_Target bgAcc.a = smoothstep(_MainTex_TexelSize.y, _MainTex_TexelSize.y * 2.0, samp0.a); // FG: Normalize the total of the weights. - fgAcc.a *= PI / sampleCount; + fgAcc.a *= PI * rcpSampleCount; // Alpha premultiplying half alpha = saturate(fgAcc.a); @@ -318,37 +347,95 @@ half4 FragBlurDynamic(VaryingsDefault i) : SV_Target else sampleCount = kDiskAllKernelSizes[4]; - const half margin = _MainTex_TexelSize.y * 2; - half4 bgAcc = 0.0; // Background: far field bokeh half4 fgAcc = 0.0; // Foreground: near field bokeh - UNITY_LOOP - for (int si = 0; si < sampleCount; si++) - { - float2 disp = kDiskAllKernels[si] * (_MaxCoC * (12.0 / 8.0)); - - float dist = length(disp); - - float2 duv = float2(disp.x * _RcpAspect, disp.y); - half4 samp = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord + duv)); - - // BG: Compare CoC of the current sample and the center sample - // and select smaller one. - half bgCoC = max(min(samp0.a, samp.a), 0.0); + AccumSample(0, samp0, i.texcoord, bgAcc, fgAcc); - // Compare the CoC to the sample distance. - // Add a small margin to smooth out. - half bgWeight = saturate((bgCoC - dist + margin) / margin); - half fgWeight = saturate((-samp.a - dist + margin) / margin); + UNITY_BRANCH if (sampleCount >= 8) + { + AccumSample( 1, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample( 2, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample( 3, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample( 4, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample( 5, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample( 6, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample( 7, samp0, i.texcoord, bgAcc, fgAcc); + } + UNITY_BRANCH if (sampleCount >= 22) + { + AccumSample( 8, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample( 9, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(10, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(11, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(12, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(13, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(14, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(15, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(16, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(17, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(18, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(19, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(20, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(21, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(22, samp0, i.texcoord, bgAcc, fgAcc); + } - // Cut influence from focused areas because they're darkened by CoC - // premultiplying. This is only needed for near field. - fgWeight *= step(_MainTex_TexelSize.y, -samp.a); + UNITY_BRANCH if (sampleCount >= 43) + { + AccumSample(23, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(24, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(25, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(26, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(27, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(28, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(29, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(30, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(31, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(32, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(33, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(34, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(35, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(36, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(37, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(38, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(39, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(40, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(41, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(42, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(43, samp0, i.texcoord, bgAcc, fgAcc); + } - // Accumulation - bgAcc += half4(samp.rgb, 1.0) * bgWeight; - fgAcc += half4(samp.rgb, 1.0) * fgWeight; + UNITY_BRANCH if (sampleCount >= 71) + { + AccumSample(44, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(45, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(46, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(47, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(48, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(49, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(50, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(51, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(52, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(53, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(54, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(55, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(56, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(57, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(58, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(59, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(60, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(61, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(62, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(63, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(64, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(65, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(66, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(67, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(68, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(69, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(70, samp0, i.texcoord, bgAcc, fgAcc); + AccumSample(71, samp0, i.texcoord, bgAcc, fgAcc); } // Get the weighted average. diff --git a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DiskKernels.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DiskKernels.hlsl index 37f6a96693d..6956c3d9eb8 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DiskKernels.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/DiskKernels.hlsl @@ -203,161 +203,162 @@ static const float2 kDiskKernel[kSampleCount] = { static const int kDiskAllKernelSizes[7] = { 1, 8, 22, 43, 71, 106, 148 }; -static const float2 kDiskAllKernels[148] = { -float2(0, 0), -// ring 1 index=1 -float2(0.186046511627907, 0), -float2(0.115998102671392, 0.145457019994052), -float2(-0.0413992435267562, 0.181381937150107), -float2(-0.16762211495859, 0.0807225561148946), -float2(-0.16762211495859, -0.0807225561148945), -float2(-0.0413992435267562, -0.181381937150107), -float2(0.115998102671392, -0.145457019994052), -// ring 2 index=8 -float2(0.348837209302326, 0), -float2(0.314291465547356, 0.151354792715427), -float2(0.217496442508861, 0.272731912488848), -float2(0.0776235816126678, 0.34009113215645), -float2(-0.0776235816126678, 0.34009113215645), -float2(-0.217496442508861, 0.272731912488848), -float2(-0.314291465547355, 0.151354792715427), -float2(-0.348837209302326, 4.27202371795588E-17), -float2(-0.314291465547356, -0.151354792715427), -float2(-0.217496442508861, -0.272731912488848), -float2(-0.0776235816126679, -0.34009113215645), -float2(0.0776235816126674, -0.34009113215645), -float2(0.21749644250886, -0.272731912488848), -float2(0.314291465547356, -0.151354792715427), -// ring 3 index=22 -float2(0.511627906976744, 0), -float2(0.488897714588258, 0.150804972954416), -float2(0.422726814766323, 0.288210262265109), -float2(0.318994782346329, 0.400006804983643), -float2(0.186918663629318, 0.47626098767843), -float2(0.0382340013697985, 0.510197291581069), -float2(-0.113847919698579, 0.498800327162793), -float2(-0.255813953488372, 0.443082764726922), -float2(-0.375049794889679, 0.347995354208377), -float2(-0.460960816136121, 0.22198702931596), -float2(-0.505913445975647, 0.0762541826947871), -float2(-0.505913445975647, -0.0762541826947867), -float2(-0.460960816136121, -0.22198702931596), -float2(-0.375049794889679, -0.347995354208377), -float2(-0.255813953488372, -0.443082764726922), -float2(-0.11384791969858, -0.498800327162793), -float2(0.0382340013697985, -0.510197291581069), -float2(0.186918663629319, -0.47626098767843), -float2(0.318994782346329, -0.400006804983643), -float2(0.422726814766323, -0.288210262265109), -float2(0.488897714588258, -0.150804972954416), -// ring 4 index=43 -float2(0.674418604651163, 0), -float2(0.657509522169137, 0.150072257784491), -float2(0.607630166724887, 0.292619265916493), -float2(0.527281697478439, 0.420493122183797), -float2(0.420493122183797, 0.527281697478439), -float2(0.292619265916493, 0.607630166724887), -float2(0.150072257784491, 0.657509522169137), -float2(4.12962292735735E-17, 0.674418604651163), -float2(-0.150072257784491, 0.657509522169137), -float2(-0.292619265916493, 0.607630166724887), -float2(-0.420493122183797, 0.527281697478439), -float2(-0.527281697478438, 0.420493122183797), -float2(-0.607630166724887, 0.292619265916493), -float2(-0.657509522169137, 0.150072257784491), -float2(-0.674418604651163, 8.25924585471471E-17), -float2(-0.657509522169137, -0.150072257784491), -float2(-0.607630166724887, -0.292619265916493), -float2(-0.527281697478439, -0.420493122183797), -float2(-0.420493122183797, -0.527281697478439), -float2(-0.292619265916493, -0.607630166724887), -float2(-0.150072257784491, -0.657509522169137), -float2(-1.23888687820721E-16, -0.674418604651163), -float2(0.15007225778449, -0.657509522169137), -float2(0.292619265916493, -0.607630166724887), -float2(0.420493122183797, -0.527281697478439), -float2(0.527281697478439, -0.420493122183797), -float2(0.607630166724887, -0.292619265916492), -float2(0.657509522169137, -0.150072257784491), -// ring 5 index=71 -float2(0.837209302325581, 0), -float2(0.823755004408155, 0.149489493319789), -float2(0.783824542861175, 0.294174271323915), -float2(0.718701315573655, 0.429404046200294), -float2(0.630478436654186, 0.550832421716969), -float2(0.521991462021265, 0.654556589973234), -float2(0.396727252302976, 0.737242770856804), -float2(0.258711902267398, 0.796233362479663), -float2(0.112381338824084, 0.829632358689434), -float2(-0.0375612533167101, 0.836366288267147), -float2(-0.186296595870403, 0.81621871717548), -float2(-0.329044212547471, 0.769837204926796), -float2(-0.461216077494783, 0.698712491487602), -float2(-0.578564078221561, 0.605130583669444), -float2(-0.677316553430188, 0.492099280989047), -float2(-0.754299517313653, 0.363251502517026), -float2(-0.807038674070947, 0.222728521869775), -float2(-0.833838943809968, 0.0750468632679909), -float2(-0.833838943809968, -0.0750468632679907), -float2(-0.807038674070947, -0.222728521869774), -float2(-0.754299517313653, -0.363251502517025), -float2(-0.677316553430189, -0.492099280989047), -float2(-0.578564078221562, -0.605130583669444), -float2(-0.461216077494784, -0.698712491487602), -float2(-0.329044212547471, -0.769837204926796), -float2(-0.186296595870403, -0.81621871717548), -float2(-0.0375612533167103, -0.836366288267147), -float2(0.112381338824084, -0.829632358689434), -float2(0.258711902267398, -0.796233362479664), -float2(0.396727252302976, -0.737242770856804), -float2(0.521991462021265, -0.654556589973234), -float2(0.630478436654186, -0.550832421716969), -float2(0.718701315573655, -0.429404046200294), -float2(0.783824542861175, -0.294174271323915), -float2(0.823755004408155, -0.149489493319789), -// ring 6 index=106 -float2(1, 0), -float2(0.988830826225129, 0.149042266176174), -float2(0.955572805786141, 0.294755174410904), -float2(0.900968867902419, 0.433883739117558), -float2(0.826238774315995, 0.563320058063622), -float2(0.733051871829826, 0.680172737770919), -float2(0.623489801858734, 0.78183148246803), -float2(0.5, 0.866025403784439), -float2(0.365341024366395, 0.930873748644204), -float2(0.222520933956314, 0.974927912181824), -float2(0.0747300935864244, 0.99720379718118), -float2(-0.074730093586424, 0.99720379718118), -float2(-0.222520933956314, 0.974927912181824), -float2(-0.365341024366395, 0.930873748644204), -float2(-0.5, 0.866025403784439), -float2(-0.623489801858733, 0.78183148246803), -float2(-0.733051871829826, 0.680172737770919), -float2(-0.826238774315995, 0.563320058063622), -float2(-0.900968867902419, 0.433883739117558), -float2(-0.955572805786141, 0.294755174410905), -float2(-0.988830826225129, 0.149042266176175), -float2(-1, 1.22464679914735E-16), -float2(-0.988830826225129, -0.149042266176174), -float2(-0.955572805786141, -0.294755174410904), -float2(-0.900968867902419, -0.433883739117558), -float2(-0.826238774315995, -0.563320058063622), -float2(-0.733051871829826, -0.680172737770919), -float2(-0.623489801858734, -0.78183148246803), -float2(-0.5, -0.866025403784438), -float2(-0.365341024366395, -0.930873748644204), -float2(-0.222520933956315, -0.974927912181824), -float2(-0.0747300935864247, -0.99720379718118), -float2(0.0747300935864244, -0.99720379718118), -float2(0.222520933956314, -0.974927912181824), -float2(0.365341024366395, -0.930873748644204), -float2(0.499999999999999, -0.866025403784439), -float2(0.623489801858733, -0.78183148246803), -float2(0.733051871829827, -0.680172737770919), -float2(0.826238774315994, -0.563320058063623), -float2(0.900968867902419, -0.433883739117558), -float2(0.955572805786141, -0.294755174410905), -float2(0.988830826225128, -0.149042266176175), +static const half kDiskAllKernelRcpSizes[7] = { 1, 1.0/8, 1.0/22, 1.0/43, 1.0/71, 1.0/106, 1.0/148 }; +static const half3 kDiskAllKernels[148] = { + half3(0, 0, 0), + // ring 1 index=1 + half3(0.186046511627907, 0, 0.186046511627907), + half3(0.115998102671392, 0.145457019994052, 0.186046511627907), + half3(-0.0413992435267562, 0.181381937150107, 0.186046511627907), + half3(-0.16762211495859, 0.0807225561148946, 0.186046511627907), + half3(-0.16762211495859, -0.0807225561148945, 0.186046511627907), + half3(-0.0413992435267562, -0.181381937150107, 0.186046511627907), + half3(0.115998102671392, -0.145457019994052, 0.186046511627907), + // ring 2 index=8 + half3(0.348837209302326, 0, 0.348837209302326), + half3(0.314291465547356, 0.151354792715427, 0.348837209302326), + half3(0.217496442508861, 0.272731912488848, 0.348837209302326), + half3(0.0776235816126678, 0.34009113215645, 0.348837209302326), + half3(-0.0776235816126678, 0.34009113215645, 0.348837209302326), + half3(-0.217496442508861, 0.272731912488848, 0.348837209302326), + half3(-0.314291465547355, 0.151354792715427, 0.348837209302326), + half3(-0.348837209302326, 4.27202371795588E-17, 0.348837209302326), + half3(-0.314291465547356, -0.151354792715427, 0.348837209302326), + half3(-0.217496442508861, -0.272731912488848, 0.348837209302326), + half3(-0.0776235816126679, -0.34009113215645, 0.348837209302326), + half3(0.0776235816126674, -0.34009113215645, 0.348837209302326), + half3(0.21749644250886, -0.272731912488848, 0.348837209302326), + half3(0.314291465547356, -0.151354792715427, 0.348837209302326), + // ring 3 index=22 + half3(0.511627906976744, 0, 0.511627906976744), + half3(0.488897714588258, 0.150804972954416, 0.511627906976744), + half3(0.422726814766323, 0.288210262265109, 0.511627906976744), + half3(0.318994782346329, 0.400006804983643, 0.511627906976744), + half3(0.186918663629318, 0.47626098767843, 0.511627906976744), + half3(0.0382340013697985, 0.510197291581069, 0.511627906976744), + half3(-0.113847919698579, 0.498800327162793, 0.511627906976744), + half3(-0.255813953488372, 0.443082764726922, 0.511627906976744), + half3(-0.375049794889679, 0.347995354208377, 0.511627906976744), + half3(-0.460960816136121, 0.22198702931596, 0.511627906976744), + half3(-0.505913445975647, 0.0762541826947871, 0.511627906976744), + half3(-0.505913445975647, -0.0762541826947867, 0.511627906976744), + half3(-0.460960816136121, -0.22198702931596, 0.511627906976744), + half3(-0.375049794889679, -0.347995354208377, 0.511627906976744), + half3(-0.255813953488372, -0.443082764726922, 0.511627906976744), + half3(-0.11384791969858, -0.498800327162793, 0.511627906976744), + half3(0.0382340013697985, -0.510197291581069, 0.511627906976744), + half3(0.186918663629319, -0.47626098767843, 0.511627906976744), + half3(0.318994782346329, -0.400006804983643, 0.511627906976744), + half3(0.422726814766323, -0.288210262265109, 0.511627906976744), + half3(0.488897714588258, -0.150804972954416, 0.511627906976744), + // ring 4 index=43 + half3(0.674418604651163, 0, 0.674418604651163), + half3(0.657509522169137, 0.150072257784491, 0.674418604651163), + half3(0.607630166724887, 0.292619265916493, 0.674418604651163), + half3(0.527281697478439, 0.420493122183797, 0.674418604651163), + half3(0.420493122183797, 0.527281697478439, 0.674418604651163), + half3(0.292619265916493, 0.607630166724887, 0.674418604651163), + half3(0.150072257784491, 0.657509522169137, 0.674418604651163), + half3(4.12962292735735E-17, 0.674418604651163, 0.674418604651163), + half3(-0.150072257784491, 0.657509522169137, 0.674418604651163), + half3(-0.292619265916493, 0.607630166724887, 0.674418604651163), + half3(-0.420493122183797, 0.527281697478439, 0.674418604651163), + half3(-0.527281697478438, 0.420493122183797, 0.674418604651163), + half3(-0.607630166724887, 0.292619265916493, 0.674418604651163), + half3(-0.657509522169137, 0.150072257784491, 0.674418604651163), + half3(-0.674418604651163, 8.25924585471471E-17, 0.674418604651163), + half3(-0.657509522169137, -0.150072257784491, 0.674418604651163), + half3(-0.607630166724887, -0.292619265916493, 0.674418604651163), + half3(-0.527281697478439, -0.420493122183797, 0.674418604651163), + half3(-0.420493122183797, -0.527281697478439, 0.674418604651163), + half3(-0.292619265916493, -0.607630166724887, 0.674418604651163), + half3(-0.150072257784491, -0.657509522169137, 0.674418604651163), + half3(-1.23888687820721E-16, -0.674418604651163, 0.674418604651163), + half3(0.15007225778449, -0.657509522169137, 0.674418604651163), + half3(0.292619265916493, -0.607630166724887, 0.674418604651163), + half3(0.420493122183797, -0.527281697478439, 0.674418604651163), + half3(0.527281697478439, -0.420493122183797, 0.674418604651163), + half3(0.607630166724887, -0.292619265916492, 0.674418604651163), + half3(0.657509522169137, -0.150072257784491, 0.674418604651163), + // ring 5 index=71 + half3(0.837209302325581, 0, 0.837209302325581), + half3(0.823755004408155, 0.149489493319789, 0.837209302325581), + half3(0.783824542861175, 0.294174271323915, 0.837209302325581), + half3(0.718701315573655, 0.429404046200294, 0.837209302325581), + half3(0.630478436654186, 0.550832421716969, 0.837209302325581), + half3(0.521991462021265, 0.654556589973234, 0.837209302325581), + half3(0.396727252302976, 0.737242770856804, 0.837209302325581), + half3(0.258711902267398, 0.796233362479663, 0.837209302325581), + half3(0.112381338824084, 0.829632358689434, 0.837209302325581), + half3(-0.0375612533167101, 0.836366288267147, 0.837209302325581), + half3(-0.186296595870403, 0.81621871717548, 0.837209302325581), + half3(-0.329044212547471, 0.769837204926796, 0.837209302325581), + half3(-0.461216077494783, 0.698712491487602, 0.837209302325581), + half3(-0.578564078221561, 0.605130583669444, 0.837209302325581), + half3(-0.677316553430188, 0.492099280989047, 0.837209302325581), + half3(-0.754299517313653, 0.363251502517026, 0.837209302325581), + half3(-0.807038674070947, 0.222728521869775, 0.837209302325581), + half3(-0.833838943809968, 0.0750468632679909, 0.837209302325581), + half3(-0.833838943809968, -0.0750468632679907, 0.837209302325581), + half3(-0.807038674070947, -0.222728521869774, 0.837209302325581), + half3(-0.754299517313653, -0.363251502517025, 0.837209302325581), + half3(-0.677316553430189, -0.492099280989047, 0.837209302325581), + half3(-0.578564078221562, -0.605130583669444, 0.837209302325581), + half3(-0.461216077494784, -0.698712491487602, 0.837209302325581), + half3(-0.329044212547471, -0.769837204926796, 0.837209302325581), + half3(-0.186296595870403, -0.81621871717548, 0.837209302325582), + half3(-0.0375612533167103, -0.836366288267147, 0.837209302325581), + half3(0.112381338824084, -0.829632358689434, 0.837209302325581), + half3(0.258711902267398, -0.796233362479664, 0.837209302325581), + half3(0.396727252302976, -0.737242770856804, 0.837209302325581), + half3(0.521991462021265, -0.654556589973234, 0.837209302325581), + half3(0.630478436654186, -0.550832421716969, 0.837209302325581), + half3(0.718701315573655, -0.429404046200294, 0.837209302325581), + half3(0.783824542861175, -0.294174271323915, 0.837209302325581), + half3(0.823755004408155, -0.149489493319789, 0.837209302325581), + // ring 6 index=106 + half3(1, 0, 1), + half3(0.988830826225129, 0.149042266176174, 1), + half3(0.955572805786141, 0.294755174410904, 1), + half3(0.900968867902419, 0.433883739117558, 1), + half3(0.826238774315995, 0.563320058063622, 1), + half3(0.733051871829826, 0.680172737770919, 1), + half3(0.623489801858734, 0.78183148246803, 1), + half3(0.5, 0.866025403784439, 1), + half3(0.365341024366395, 0.930873748644204, 1), + half3(0.222520933956314, 0.974927912181824, 1), + half3(0.0747300935864244, 0.99720379718118, 1), + half3(-0.074730093586424, 0.99720379718118, 1), + half3(-0.222520933956314, 0.974927912181824, 1), + half3(-0.365341024366395, 0.930873748644204, 1), + half3(-0.5, 0.866025403784439, 1), + half3(-0.623489801858733, 0.78183148246803, 1), + half3(-0.733051871829826, 0.680172737770919, 1), + half3(-0.826238774315995, 0.563320058063622, 1), + half3(-0.900968867902419, 0.433883739117558, 1), + half3(-0.955572805786141, 0.294755174410905, 1), + half3(-0.988830826225129, 0.149042266176175, 1), + half3(-1, 1.22464679914735E-16, 1), + half3(-0.988830826225129, -0.149042266176174, 1), + half3(-0.955572805786141, -0.294755174410904, 1), + half3(-0.900968867902419, -0.433883739117558, 1), + half3(-0.826238774315995, -0.563320058063622, 1), + half3(-0.733051871829826, -0.680172737770919, 1), + half3(-0.623489801858734, -0.78183148246803, 1), + half3(-0.5, -0.866025403784438, 1), + half3(-0.365341024366395, -0.930873748644204, 1), + half3(-0.222520933956315, -0.974927912181824, 1), + half3(-0.0747300935864247, -0.99720379718118, 1), + half3(0.0747300935864244, -0.99720379718118, 1), + half3(0.222520933956314, -0.974927912181824, 1), + half3(0.365341024366395, -0.930873748644204, 1), + half3(0.499999999999999, -0.866025403784439, 1), + half3(0.623489801858733, -0.78183148246803, 1), + half3(0.733051871829827, -0.680172737770919, 1), + half3(0.826238774315994, -0.563320058063623, 1), + half3(0.900968867902419, -0.433883739117558, 1), + half3(0.955572805786141, -0.294755174410905, 1), + half3(0.988830826225128, -0.149042266176175, 1), }; #endif // UNITY_POSTFX_DISK_KERNELS