diff options
Diffstat (limited to 'Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources')
26 files changed, 1256 insertions, 0 deletions
diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common.cginc b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common.cginc new file mode 100644 index 0000000..0064240 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common.cginc @@ -0,0 +1,76 @@ + +#ifdef UNITY_HDRP +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + +// Unity does not define the UNITY_DECLARE_TEX2D macro when using HDRP, at least at the time of writing this. +// But luckily HDRP is only supported on platforms where separate sampler states are supported, so we can define it like this. +#if !defined(UNITY_DECLARE_TEX2D) +// This is copied from com.unity.shadergraph@14.0.6/Editor/Generation/Targets/BuiltIn/ShaderLibrary/Shim/HLSLSupportShim.hlsl +#define UNITY_DECLARE_TEX2D(tex) TEXTURE2D(tex); SAMPLER(sampler##tex) +#endif + +#if !defined(UNITY_SAMPLE_TEX2D) +#define UNITY_SAMPLE_TEX2D(tex,coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) +#endif + +// This is not defined in HDRP either, but we do know that HDRP only supports these platforms (at least I think so...) +#define UNITY_SEPARATE_TEXTURE_SAMPLER + +#else +#include "UnityCG.cginc" + +// These exist in the render pipelines, but not in UnityCG +float4 TransformObjectToHClip(float3 x) { + return UnityObjectToClipPos(float4(x, 1.0)); +} + +half3 FastSRGBToLinear(half3 sRGB) { + return GammaToLinearSpace(sRGB); +} +#endif + +// Tranforms a direction from object to homogenous space +inline float4 UnityObjectToClipDirection(in float3 pos) { + // More efficient than computing M*VP matrix product + return mul(UNITY_MATRIX_VP, mul(UNITY_MATRIX_M, float4(pos, 0))); +} + +float lengthsq(float3 v) { + return dot(v,v); +} + +float4 ComputeScreenPos (float4 pos, float projectionSign) +{ + float4 o = pos * 0.5f; + o.xy = float2(o.x, o.y * projectionSign) + o.w; + o.zw = pos.zw; + return o; +} + + +// Converts to linear space from sRGB if linear is the current color space +inline float3 ConvertSRGBToDestinationColorSpace(float3 sRGB) { +#ifdef UNITY_COLORSPACE_GAMMA + return sRGB; +#else + return FastSRGBToLinear(sRGB); +#endif +} + +struct appdata_color { + float4 vertex : POSITION; + half4 color : COLOR; + float3 normal : NORMAL; + float2 uv : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +// Unity sadly does not include a bias macro for texture sampling. +#if defined(UNITY_SEPARATE_TEXTURE_SAMPLER) +#define UNITY_SAMPLE_TEX2D_BIAS(tex, uv, bias) tex.SampleBias(sampler##tex, uv, bias) +#else +#define UNITY_SAMPLE_TEX2D_BIAS(tex, uv, bias) tex2Dbias(float4(uv, 0, bias)) +#endif diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common.cginc.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common.cginc.meta new file mode 100644 index 0000000..51714ad --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1b135520270114849b121a628fe61ba8 +timeCreated: 1472987846 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_line.cginc b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_line.cginc new file mode 100644 index 0000000..064f311 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_line.cginc @@ -0,0 +1,107 @@ +#include "aline_common.cginc" + +struct LineData { + float3 start; + uint joinHintInstanceIndex; + float3 end; + float width; + float4 color; +}; + +static float2 vertexToSide[6] = { + float2(-1, -1), + float2(1, -1), + float2(1, 1), + + float2(-1, -1), + float2(1, 1), + float2(-1, 1), +}; + +struct line_v2f { + half4 col : COLOR; + noperspective float lineWidth: TEXCOORD3; + noperspective float uv : TEXCOORD4; + UNITY_VERTEX_OUTPUT_STEREO +}; + +// d = normalized distance to line +float lineAA(float d) { + d = max(min(d, 1.0), 0) * 1.116; + float v = 0.93124*d*d*d - 1.42215*d*d - 0.42715*d + 0.95316; + v /= 0.95316; + return max(v, 0); +} + + +float calculateLineAlpha(line_v2f i, float pixelWidth, float falloffTextureScreenPixels) { + float dist = abs((i.uv - 0.5)*2); + float falloffFractionOfWidth = falloffTextureScreenPixels/(pixelWidth*0.5); + float a = lineAA((abs(dist) - (1 - falloffFractionOfWidth))/falloffFractionOfWidth); + return a; +} + +line_v2f line_vert (appdata_color v, float pixelWidth, float lengthPadding, out float4 outpos : SV_POSITION) { + UNITY_SETUP_INSTANCE_ID(v); + line_v2f o; + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float4 Mv = TransformObjectToHClip(v.vertex.xyz); + // float4 Mv = UnityObjectToClipPos(v.vertex); + float3 n = normalize(v.normal); + float4 Mn = UnityObjectToClipDirection(n); + + // delta is the limit value of doing the calculation + // x1 = M*v + // x2 = M*(v + e*n) + // lim e->0 (x2/x2.w - x1/x1.w)/e + // Where M = UNITY_MATRIX_MVP, v = v.vertex, n = v.normal, e = a very small value + // We can calculate this limit as follows + // lim e->0 (M*(v + e*n))/(M*(v + e*n)).w - M*v/(M*v).w / e + // lim e->0 ((M*v).w*M*(v + e*n))/((M*v).w * (M*(v + e*n)).w) - M*v*(M*(v + e*n)).w/((M*(v + e*n)).w * (M*v).w) / e + // lim e->0 ((M*v).w*M*(v + e*n) - M*v*(M*(v + e*n)).w)/((M*v).w * (M*(v + e*n)).w) / e + // lim e->0 ((M*v).w*M*(v + e*n) - M*v*(M*(v + e*n)).w)/((M*v).w * (M*v).w) / e + // lim e->0 ((M*v).w*M*v + (M*v).w*e*n - M*v*(M*(v + e*n)).w)/((M*v).w * (M*v).w) / e + // lim e->0 ((M*v).w*M*v + (M*v).w*e*n - M*v*(M*v).w - M*v*(M*e*n).w)/((M*v).w * (M*v).w) / e + // lim e->0 ((M*v).w*M*e*n - M*v*(M*e*n).w)/((M*v).w * (M*v).w) / e + // lim e->0 ((M*v).w*M*n - M*v*(M*n).w)/((M*v).w * (M*v).w) + // lim e->0 M*n/(M*v).w - (M*v*(M*n).w)/((M*v).w * (M*v).w) + + // Previously the above calculation was done with just e = 0.001, however this could yield graphical artifacts + // at large coordinate values as the floating point coordinates would start to run out of precision. + // Essentially we calculate the normal of the line in screen space. + float4 delta = (Mn - Mv*Mn.w/Mv.w) / Mv.w; + + // The delta (direction of the line in screen space) needs to be normalized in pixel space. + // Otherwise it would look weird when stretched to a non-square viewport + delta.xy *= _ScreenParams.xy; + delta.xy = normalize(delta.xy); + // Handle DirectX properly. See https://docs.unity3d.com/Manual/SL-PlatformDifferences.html + float2 normalizedScreenSpaceNormal = float2(-delta.y, delta.x) * _ProjectionParams.x; + float2 screenSpaceNormal = normalizedScreenSpaceNormal / _ScreenParams.xy; + float4 sn = float4(screenSpaceNormal.x, screenSpaceNormal.y, 0, 0); + + // Left (-1) or Right (1) of the line + float side = (v.uv.x - 0.5)*2; + // Make the line wide + outpos = (Mv / Mv.w) + side*sn*pixelWidth*0.5; + + // -1 or +1 if this vertex is at the start or end of the line respectively. + float forwards = (v.uv.y - 0.5)*2; + // Add some additional length to the line (usually on the order of 0.5 px) + // to avoid occational 1 pixel holes in sequences of contiguous lines. + outpos.xy += forwards*(delta.xy / _ScreenParams.xy)*0.5*lengthPadding; + + // Multiply by w because homogeneous coordinates (it still needs to be clipped) + outpos *= Mv.w; + o.lineWidth = pixelWidth; + o.uv = v.uv.x; + return o; +} + +line_v2f line_vert_raw (appdata_color v, float4 tint, float pixelWidth, float lengthPadding, out float4 outpos) { + pixelWidth *= length(v.normal); + line_v2f o = line_vert(v, pixelWidth, lengthPadding, outpos); + o.col = v.color * tint; + o.col.rgb = ConvertSRGBToDestinationColorSpace(o.col.rgb); + return o; +}
\ No newline at end of file diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_line.cginc.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_line.cginc.meta new file mode 100644 index 0000000..3d3f3ea --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_line.cginc.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 605d8a659194d1a2695d7c0ecd7f1c36 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_surface.cginc b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_surface.cginc new file mode 100644 index 0000000..8d44d01 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_surface.cginc @@ -0,0 +1,21 @@ +#include "aline_common.cginc" + +struct v2f { + float4 pos : SV_POSITION; + float4 col : COLOR; + float2 uv : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO +}; + +v2f vert_base (appdata_color v, float4 tint, float scale) { + UNITY_SETUP_INSTANCE_ID(v); + v2f o; + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = TransformObjectToHClip(v.vertex.xyz); + + float4 worldSpace = mul(UNITY_MATRIX_M, v.vertex); + o.uv = float2 (worldSpace.x*scale,worldSpace.z*scale); + o.col = v.color * tint; + o.col.rgb = ConvertSRGBToDestinationColorSpace(o.col.rgb); + return o; +} diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_surface.cginc.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_surface.cginc.meta new file mode 100644 index 0000000..ee2358d --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_surface.cginc.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 74e11d375a4c443bebed3fd6b0bb0e10 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_text.cginc b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_text.cginc new file mode 100644 index 0000000..026d4f1 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_text.cginc @@ -0,0 +1,107 @@ +#include "aline_common.cginc" + +float4 _Color; +float4 _FadeColor; +UNITY_DECLARE_TEX2D(_MainTex); +UNITY_DECLARE_TEX2D(_FallbackTex); +float _FallbackAmount; +float _TransitionPoint; +float _MipBias; +float _GammaCorrection; + +struct vertex { + float4 pos : POSITION; + float4 color : COLOR; + float2 uv : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct v2f { + float4 col : COLOR; + float2 uv: TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO +}; + +v2f vert_base (vertex v, float4 tint, out float4 outpos : SV_POSITION) { + UNITY_SETUP_INSTANCE_ID(v); + v2f o; + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.uv = v.uv; + o.col = v.color * tint; + o.col.rgb = ConvertSRGBToDestinationColorSpace(o.col.rgb); + outpos = TransformObjectToHClip(v.pos.xyz); + return o; +} + +// float getAlpha2(float2 uv) { +// const float textureWidth = 1024; +// float pixelSize = 0.5 * length(float2(ddx(uv.x), ddy(uv.x))) * textureWidth; + +// // Depends on texture generation settings +// const float falloffPixels = 5; + +// float sample = UNITY_SAMPLE_TEX2D(_MainTex, uv).a; +// // float scale = 1.0 / fwidth(sample); +// float signedDistance1 = (0.5 - sample) * falloffPixels; +// float signedDistance2 = signedDistance1 / pixelSize; + +// return lineAA(signedDistance2 + 0.5); +// // float signedDistance = (sample - 0.5) * scale; +// // return fwidth(sample) * 10; +// // Use two different distance thresholds to get dynamically stroked text +// // float color = clamp(signedDistance + 0.5, 0.0, 1.0); +// // return color; +// } + +float getAlpha(float2 uv) { + float rawSignedDistance = UNITY_SAMPLE_TEX2D(_MainTex, uv).a; + float scale = 1.0 / fwidth(rawSignedDistance); + float thresholdedDistance = (rawSignedDistance - 0.5) * scale; + float color = clamp(thresholdedDistance + 0.5, 0.0, 1.0); + return color; +} + +// Shader modified from https://evanw.github.io/font-texture-generator/example-webgl/ +float4 frag (v2f i, float4 screenPos : VPOS) : SV_Target { + // float halfpixelSize = 0.5 * 0.5 * length(float2(ddx(i.uv.x), ddy(i.uv.x))); + // float fcolor0 = UNITY_SAMPLE_TEX2D(_FallbackTex, i.uv).a; + // float fcolor1 = UNITY_SAMPLE_TEX2D(_FallbackTex, i.uv + float2(halfpixelSize * 0.6, halfpixelSize * 0.3)).a; + // float fcolor2 = UNITY_SAMPLE_TEX2D(_FallbackTex, i.uv + float2(-halfpixelSize * 0.3, halfpixelSize * 0.6)).a; + // float fcolor3 = UNITY_SAMPLE_TEX2D(_FallbackTex, i.uv + float2(-halfpixelSize * 0.6, -halfpixelSize * 0.3)).a; + // float fcolor4 = UNITY_SAMPLE_TEX2D(_FallbackTex, i.uv + float2(halfpixelSize * 0.3, -halfpixelSize * 0.6)).a; + // float fallbackAlpha = (fcolor0 + fcolor1 + fcolor2 + fcolor3 + fcolor4) * 0.2; + // Bias the texture sampling to use a lower mipmap level. This makes the text much sharper and clearer. + float fallbackAlpha = UNITY_SAMPLE_TEX2D_BIAS(_FallbackTex, i.uv, _MipBias).a; + + // The fallback is used for small font sizes. + // Boost the alpha to make it more legible + fallbackAlpha *= 1.2; + + // Approximate size of one screen pixel in UV-space + float pixelSize = length(float2(ddx(i.uv.x), ddy(i.uv.x))); + // float pixelSize2 = length(float2(ddx(i.uv.y), ddy(i.uv.y))); + + // float color0 = getAlpha(i.uv); + // float color1 = getAlpha(i.uv + float2(halfpixelSize * 0.6, halfpixelSize * 0.3)); + // float color2 = getAlpha(i.uv + float2(-halfpixelSize * 0.3, halfpixelSize * 0.6)); + // float color3 = getAlpha(i.uv + float2(-halfpixelSize * 0.6, -halfpixelSize * 0.3)); + // float color4 = getAlpha(i.uv + float2(halfpixelSize * 0.3, -halfpixelSize * 0.6)); + // float color = (color0 + color1 + color2 + color3 + color4) * 0.2; + + float sdfAlpha = getAlpha(i.uv); + + // Transition from the SDF font to the fallback when the font's size on the screen + // starts getting smaller than the size in the texture. + float sdfTextureWidth = 1024; + // How sharp the transition from sdf to fallback is. + // A smaller value will make the transition cover a larger range of font sizes + float transitionSharpness = 10; + float blend = clamp(transitionSharpness*(_TransitionPoint*pixelSize*sdfTextureWidth - 1.0), 0, 1); + + float alpha = lerp(sdfAlpha, fallbackAlpha, blend * _FallbackAmount); + + float4 blendcolor = float4(1,1,1,1); + // blendcolor = lerp(float4(0, 1, 0, 1), float4(1, 0, 0, 1), blend); + + return blendcolor * i.col * float4(1, 1, 1, alpha); +}
\ No newline at end of file diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_text.cginc.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_text.cginc.meta new file mode 100644 index 0000000..699e27b --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_common_text.cginc.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a4bc56dd8cf7ec1bebb90e3a60d73472 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_droid_sans_mono.mat b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_droid_sans_mono.mat new file mode 100644 index 0000000..4b6d156 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_droid_sans_mono.mat @@ -0,0 +1,71 @@ +%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: aline_droid_sans_mono + m_Shader: {fileID: 4800000, guid: 537f9312ab33ad434a5484e558bbbca2, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DecalTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FallbackTex: + m_Texture: {fileID: 2800000, guid: a41cbdfe1465ffd70b661de460173296, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Falloff: + m_Texture: {fileID: 2800000, guid: 6267c94129d874d7bafe507aa753046a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: cecd6d13eb22ad90fb21ac4b8b925742, type: 3} + m_Scale: {x: 2, y: 2} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _FallbackAmount: 1 + - _GammaCorrection: 1.42 + - _InvFade: 1 + - _LengthPadding: 0.5 + - _MipBias: -1 + - _PixelWidth: 4.4 + - _Scale: -2.68 + - _Shininess: 0.7 + - _TransitionPoint: 1 + m_Colors: + - _Amb: {r: 0, g: 1, b: 0.33381772, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0} + - _Emission: {r: 0, g: 0, b: 0, a: 1} + - _Emmission: {r: 0.4744898, g: 0.4744898, b: 0.4744898, a: 1} + - _FadeColor: {r: 1, g: 1, b: 1, a: 1} + - _Low: {r: 1, g: 1, b: 1, a: 0.7} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} + - _Tint: {r: 1, g: 1, b: 1, a: 1} + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + m_BuildTextureStacks: [] +--- !u!1002 &2100001 +EditorExtensionImpl: + serializedVersion: 6 diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_droid_sans_mono.mat.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_droid_sans_mono.mat.meta new file mode 100644 index 0000000..e285f0b --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_droid_sans_mono.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb8c9e73fc8f8b86e9310790cf7e9df5 +timeCreated: 1442945121 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_fallback_font.png b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_fallback_font.png Binary files differnew file mode 100644 index 0000000..1aa41eb --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_fallback_font.png diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_fallback_font.png.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_fallback_font.png.meta new file mode 100644 index 0000000..07c2878 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_fallback_font.png.meta @@ -0,0 +1,134 @@ +fileFormatVersion: 2 +guid: a41cbdfe1465ffd70b661de460173296 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 5 + mipMapFadeDistanceEnd: 8 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 8 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 2 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.png b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.png Binary files differnew file mode 100644 index 0000000..8fa9b54 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.png diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.png.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.png.meta new file mode 100644 index 0000000..d9c4c17 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.png.meta @@ -0,0 +1,106 @@ +fileFormatVersion: 2 +guid: cecd6d13eb22ad90fb21ac4b8b925742 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 10 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 2 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 3 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 3 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.ttf b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.ttf Binary files differnew file mode 100644 index 0000000..6e79dad --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.ttf diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.ttf.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.ttf.meta new file mode 100644 index 0000000..9784beb --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_font.ttf.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: de5743d7052e68e1b968ac7e8398c2f8 +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: Droid Sans Mono + fontNames: + - Droid Sans Mono + fallbackFontReferences: + - {fileID: 12800000, guid: 21fc0bad37ce24a57aa83faa292e340e, type: 3} + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + shouldRoundAdvanceValue: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.mat b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.mat new file mode 100644 index 0000000..03960f6 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.mat @@ -0,0 +1,58 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: aline_outline + m_Shader: {fileID: 4800000, guid: 6c78a6dd468954643a87ebf0014bc305, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DecalTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Falloff: + m_Texture: {fileID: 2800000, guid: 6267c94129d874d7bafe507aa753046a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 0ff27a4aaa0ce4d1ba6a39ce3c868a76, type: 3} + m_Scale: {x: 2, y: 2} + m_Offset: {x: 0, y: 0} + m_Floats: + - _InvFade: 1 + - _LengthPadding: 0.5 + - _PixelWidth: 4.4 + - _Scale: -2.68 + - _Shininess: 0.7 + m_Colors: + - _Amb: {r: 0, g: 1, b: 0.33381772, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0} + - _Emission: {r: 0, g: 0, b: 0, a: 1} + - _Emmission: {r: 0.4744898, g: 0.4744898, b: 0.4744898, a: 1} + - _FadeColor: {r: 0.7075472, g: 0.7075472, b: 0.7075472, a: 0.12156863} + - _Low: {r: 1, g: 1, b: 1, a: 0.7} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} + - _Tint: {r: 1, g: 1, b: 1, a: 1} + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + m_BuildTextureStacks: [] +--- !u!1002 &2100001 +EditorExtensionImpl: + serializedVersion: 6 diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.mat.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.mat.meta new file mode 100644 index 0000000..9cf2bee --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 91035448860ba4e708919485c73f7edc +timeCreated: 1442945121 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.shader b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.shader new file mode 100644 index 0000000..b95a6f8 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.shader @@ -0,0 +1,165 @@ +Shader "Hidden/ALINE/Outline" { + Properties { + _Color ("Main Color", Color) = (1,1,1,0.5) + _FadeColor ("Fade Color", Color) = (1,1,1,0.3) + _PixelWidth ("Width (px)", Float) = 4 + _LengthPadding ("Length Padding (px)", Float) = 0 + } + + HLSLINCLUDE + float4 _Color; + float4 _FadeColor; + float _PixelWidth; + float _LengthPadding; + + // Number of screen pixels that the _Falloff texture corresponds to + static const float FalloffTextureScreenPixels = 2; + + #pragma vertex vert + #pragma fragment frag + ENDHLSL + + // First subshader is for the HighDefinitionRenderPipeline. + // The shader contents are identical except that it defines UNTIY_HDRP. + SubShader { + PackageRequirements { + "com.unity.render-pipelines.high-definition": "0.1" + } + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + Offset -3, -50 + Tags { "IgnoreProjector"="True" "RenderType"="Overlay" "RenderPipeline"="HighDefinitionRenderPipeline" } + // With line joins some triangles can actually end up backwards, so disable culling + Cull Off + + // Render behind objects + Pass { + ZTest Greater + + HLSLPROGRAM + #define UNITY_HDRP + #include "aline_common_line.cginc" + + line_v2f vert (appdata_color v, out float4 outpos : SV_POSITION) { + return line_vert_raw(v, _Color * _FadeColor, _PixelWidth, _LengthPadding, outpos); + } + + half4 frag (line_v2f i, float4 screenPos : VPOS) : COLOR { + return i.col * float4(1,1,1, calculateLineAlpha(i, i.lineWidth, FalloffTextureScreenPixels)); + } + ENDHLSL + } + + // First pass writes to the Z buffer where the lines have a pretty high opacity + Pass { + ZTest LEqual + ZWrite On + ColorMask 0 + + HLSLPROGRAM + #define UNITY_HDRP + #include "aline_common_line.cginc" + + line_v2f vert (appdata_color v, out float4 outpos : SV_POSITION) { + line_v2f o = line_vert_raw(v, float4(1,1,1,1), _PixelWidth, _LengthPadding, outpos); + o.col = float4(1,1,1,1); + return o; + } + + half4 frag (line_v2f i, float4 screenPos : VPOS) : SV_Target { + float a = calculateLineAlpha(i, i.lineWidth, FalloffTextureScreenPixels); + if (a < 0.7) discard; + return float4(1,1,1,a); + } + ENDHLSL + } + + // Render in front of objects + Pass { + ZTest LEqual + + HLSLPROGRAM + #define UNITY_HDRP + #include "aline_common_line.cginc" + + line_v2f vert (appdata_color v, out float4 outpos : SV_POSITION) { + return line_vert_raw(v, _Color, _PixelWidth, _LengthPadding, outpos); + } + + half4 frag (line_v2f i, float4 screenPos : VPOS) : SV_Target { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + return i.col * float4(1,1,1, calculateLineAlpha(i, i.lineWidth, FalloffTextureScreenPixels)); + } + ENDHLSL + } + } + + + SubShader { + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + Offset -3, -50 + Tags { "IgnoreProjector"="True" "RenderType"="Overlay" } + // With line joins some triangles can actually end up backwards, so disable culling + Cull Off + + // Render behind objects + Pass { + ZTest Greater + + HLSLPROGRAM + #include "aline_common_line.cginc" + + line_v2f vert (appdata_color v, out float4 outpos : SV_POSITION) { + return line_vert_raw(v, _Color * _FadeColor, _PixelWidth, _LengthPadding, outpos); + } + + half4 frag (line_v2f i, float4 screenPos : VPOS) : SV_Target { + return i.col * float4(1,1,1, calculateLineAlpha(i, i.lineWidth, FalloffTextureScreenPixels)); + } + ENDHLSL + } + + // First pass writes to the Z buffer where the lines have a pretty high opacity + Pass { + ZTest LEqual + ZWrite On + ColorMask 0 + + HLSLPROGRAM + #include "aline_common_line.cginc" + + line_v2f vert (appdata_color v, out float4 outpos : SV_POSITION) { + line_v2f o = line_vert_raw(v, float4(1,1,1,1), _PixelWidth, _LengthPadding, outpos); + o.col = float4(1,1,1,1); + return o; + } + + half4 frag (line_v2f i, float4 screenPos : VPOS) : SV_Target { + float a = calculateLineAlpha(i, i.lineWidth, FalloffTextureScreenPixels); + if (a < 0.7) discard; + return float4(1,1,1,a); + } + ENDHLSL + } + + // Render in front of objects + Pass { + ZTest LEqual + + HLSLPROGRAM + #include "aline_common_line.cginc" + + line_v2f vert (appdata_color v, out float4 outpos : SV_POSITION) { + return line_vert_raw(v, _Color, _PixelWidth, _LengthPadding, outpos); + } + + half4 frag (line_v2f i, float4 screenPos : VPOS) : SV_Target { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + return i.col * float4(1,1,1, calculateLineAlpha(i, i.lineWidth, FalloffTextureScreenPixels)); + } + ENDHLSL + } + } + Fallback Off +} diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.shader.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.shader.meta new file mode 100644 index 0000000..212dc4a --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_outline.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6c78a6dd468954643a87ebf0014bc305 +timeCreated: 1442945130 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.mat b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.mat new file mode 100644 index 0000000..a879e27 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.mat @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: aline_surface + m_Shader: {fileID: 4800000, guid: 6dad35c0b62e44c26ab244ad80deee1a, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DecalTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 2, y: 2} + m_Offset: {x: 0, y: 0} + m_Floats: + - _InvFade: 1 + - _Scale: -2.68 + - _Shininess: 0.7 + m_Colors: + - _Amb: {r: 0, g: 1, b: 0.33381772, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.551} + - _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0} + - _Emission: {r: 0, g: 0, b: 0, a: 1} + - _Emmission: {r: 0.4744898, g: 0.4744898, b: 0.4744898, a: 1} + - _FadeColor: {r: 0.6568808, g: 0.6568808, b: 0.6568808, a: 0.448} + - _Low: {r: 1, g: 1, b: 1, a: 0.7} + - _SpecColor: {r: 1, g: 1, b: 1, a: 1} + - _Tint: {r: 1, g: 1, b: 1, a: 1} + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + m_BuildTextureStacks: [] +--- !u!1002 &2100001 +EditorExtensionImpl: + serializedVersion: 6 diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.mat.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.mat.meta new file mode 100644 index 0000000..c96943f --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.mat.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5ce51318bbfb1466188b929a68a6bd3a diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.shader b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.shader new file mode 100644 index 0000000..37eec81 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.shader @@ -0,0 +1,174 @@ +Shader "Hidden/ALINE/Surface" { + Properties { + _Color ("Main Color", Color) = (1,1,1,0.5) + _MainTex ("Texture", 2D) = "white" { } + _Scale ("Scale", float) = 1 + _FadeColor ("Fade Color", Color) = (1,1,1,0.3) + } + + HLSLINCLUDE + float4 _MainTex_ST; + float4 _Color; + float4 _FadeColor; + float _Scale; + + #pragma vertex vert + #pragma fragment frag + ENDHLSL + + // First subshader is for the HighDefinitionRenderPipeline. + // The shader contents are identical except that it defines UNTIY_HDRP. + SubShader { + PackageRequirements { + "com.unity.render-pipelines.high-definition": "0.1" + } + Tags {"Queue"="Transparent+1" "IgnoreProjector"="True" "RenderType"="Transparent" "RenderPipeline"="HighDefinitionRenderPipeline"} + LOD 200 + Offset -2, -20 + Cull Off + + Pass { + // Z-write further back to avoid lines drawn at the same z-depth to partially clip the surface + Offset 0, 0 + ZWrite On + ColorMask 0 + + HLSLPROGRAM + #define UNITY_HDRP + #include "aline_common_surface.cginc" + + UNITY_DECLARE_TEX2D(_MainTex); + + v2f vert (appdata_color v) { + return vert_base(v, _Color, _Scale); + } + + float4 frag (v2f i) : SV_Target { + if (i.col.a < 0.3) discard; + return float4(1,1,1,1); + } + ENDHLSL + } + + + // Render behind + Pass { + ZWrite Off + ZTest Greater + Blend SrcAlpha OneMinusSrcAlpha + + HLSLPROGRAM + #define UNITY_HDRP + #include "aline_common_surface.cginc" + + UNITY_DECLARE_TEX2D(_MainTex); + + v2f vert (appdata_color v) { + return vert_base(v, _Color * _FadeColor, _Scale); + } + + float4 frag (v2f i) : SV_Target { + return UNITY_SAMPLE_TEX2D(_MainTex, i.uv) * i.col; + } + ENDHLSL + + } + + // Render in front + Pass { + ZWrite Off + ZTest LEqual + Blend SrcAlpha OneMinusSrcAlpha + + HLSLPROGRAM + #define UNITY_HDRP + #include "aline_common_surface.cginc" + + UNITY_DECLARE_TEX2D(_MainTex); + + v2f vert (appdata_color v) { + return vert_base(v, _Color, _Scale); + } + + float4 frag (v2f i) : SV_Target { + return UNITY_SAMPLE_TEX2D(_MainTex, i.uv) * i.col; + } + ENDHLSL + } + } + + SubShader { + Tags {"Queue"="Transparent+1" "IgnoreProjector"="True" "RenderType"="Transparent"} + LOD 200 + Offset -2, -20 + Cull Off + + Pass { + // Z-write further back to avoid lines drawn at the same z-depth to partially clip the surface + Offset 0, 0 + ZWrite On + ColorMask 0 + + HLSLPROGRAM + #include "aline_common_surface.cginc" + + UNITY_DECLARE_TEX2D(_MainTex); + + v2f vert (appdata_color v) { + return vert_base(v, _Color, _Scale); + } + + float4 frag (v2f i) : SV_Target { + if (i.col.a < 0.3) discard; + return float4(1,1,1,1); + } + ENDHLSL + } + + + // Render behind + Pass { + ZWrite Off + ZTest Greater + Blend SrcAlpha OneMinusSrcAlpha + + HLSLPROGRAM + #include "aline_common_surface.cginc" + + UNITY_DECLARE_TEX2D(_MainTex); + + v2f vert (appdata_color v) { + return vert_base(v, _Color * _FadeColor, _Scale); + } + + float4 frag (v2f i) : SV_Target { + return UNITY_SAMPLE_TEX2D(_MainTex, i.uv) * i.col; + } + ENDHLSL + + } + + // Render in front + Pass { + ZWrite Off + ZTest LEqual + Blend SrcAlpha OneMinusSrcAlpha + + HLSLPROGRAM + #include "aline_common_surface.cginc" + + UNITY_DECLARE_TEX2D(_MainTex); + + v2f vert (appdata_color v) { + return vert_base(v, _Color, _Scale); + } + + float4 frag (v2f i) : SV_Target { + return UNITY_SAMPLE_TEX2D(_MainTex, i.uv) * i.col; + } + ENDHLSL + } + } + + Fallback Off +} diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.shader.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.shader.meta new file mode 100644 index 0000000..52f87d2 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_surface.shader.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6dad35c0b62e44c26ab244ad80deee1a diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_text.shader b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_text.shader new file mode 100644 index 0000000..d308e80 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_text.shader @@ -0,0 +1,88 @@ +Shader "Hidden/ALINE/Font" { + Properties { + _Color ("Main Color", Color) = (1,1,1,0.5) + _FadeColor ("Fade Color", Color) = (1,1,1,0.3) + _MainTex ("Texture", 2D) = "white" {} + _FallbackTex ("Fallback Texture", 2D) = "white" {} + _FallbackAmount ("Fallback Amount", Range(0,1)) = 1.0 + _TransitionPoint ("Transition Point", Range(0,5)) = 0.6 + _MipBias ("Mip Bias", Range(-2,0)) = -1 + _GammaCorrection ("Gamma Correction", Range(0,2)) = 1 + } + + // First subshader is for the HighDefinitionRenderPipeline. + // The shader contents are identical except that it defines UNTIY_HDRP. + SubShader { + PackageRequirements { + "com.unity.render-pipelines.high-definition": "0.1" + } + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + Offset -3, -50 + Cull Off + Tags { "IgnoreProjector"="True" "RenderType"="Overlay" "RenderPipeline"="HighDefinitionRenderPipeline"} + + Pass { + ZTest Greater + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #define UNITY_HDRP + #include "aline_common_text.cginc" + v2f vert (vertex v, out float4 outpos : SV_POSITION) { + return vert_base(v, _Color * _FadeColor, outpos); + } + ENDHLSL + } + + Pass { + ZTest LEqual + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #define UNITY_HDRP + #include "aline_common_text.cginc" + v2f vert (vertex v, out float4 outpos : SV_POSITION) { + return vert_base(v, _Color, outpos); + } + ENDHLSL + } + } + + SubShader { + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + Offset -3, -50 + Cull Off + Tags { "IgnoreProjector"="True" "RenderType"="Overlay" } + + Pass { + ZTest Greater + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "aline_common_text.cginc" + v2f vert (vertex v, out float4 outpos : SV_POSITION) { + return vert_base(v, _Color * _FadeColor, outpos); + } + ENDHLSL + } + + Pass { + ZTest LEqual + + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "aline_common_text.cginc" + v2f vert (vertex v, out float4 outpos : SV_POSITION) { + return vert_base(v, _Color, outpos); + } + ENDHLSL + } + } + Fallback Off +} diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_text.shader.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_text.shader.meta new file mode 100644 index 0000000..28b9a8c --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Resources/aline_text.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 537f9312ab33ad434a5484e558bbbca2 +timeCreated: 1442945130 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: |