This commit is contained in:
CortexCore
2023-11-02 20:58:55 +08:00
parent f0f348c246
commit ee3ecec6cb
168 changed files with 58830 additions and 379 deletions

View File

@@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailClearMask
m_Shader: {fileID: 4800000, guid: d65df080bc2274b17b40ec41c9475d6a, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,63 @@
Shader "TrailsFX/ClearMask" {
Properties {
_Cull ("Cull", Int) = 2
}
SubShader
{
Tags { "Queue"="Transparent+110" "RenderType"="Transparent" }
Pass
{
Stencil {
Ref 2
ReadMask 2
WriteMask 2
Comp equal
Pass zero
}
ColorMask 0
ZTest Always
ZWrite Off
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.pos = UnityObjectToClipPos(v.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
return 0;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailEffectClone
m_Shader: {fileID: 4800000, guid: bbcc364a8f3a645a3b03709ca87499e5, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,125 @@
Shader "TrailsFX/Effect/Clone" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
_CutOff("Cut Off", Float) = 0.5
_Cull ("Cull", Int) = 2
}
SubShader
{
Tags { "Queue"="Transparent+101" "RenderType"="Transparent" }
Pass
{
Stencil {
Ref 2
ReadMask 2
Comp NotEqual
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#pragma multi_compile_local _ TRAIL_ALPHACLIP
#pragma multi_compile_local _ TRAIL_INTERPOLATE
#pragma multi_compile_local _ TRAIL_MASK
#pragma multi_compile_local _ TRAIL_LOCAL
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
#if TRAIL_INTERPOLATE
float4 prevVertex : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
sampler2D _MainTex;
float4 _MainTex_ST;
fixed _CutOff;
sampler2D _MaskTex;
float4x4 _PivotMatrix;
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Colors)
#if TRAIL_INTERPOLATE
UNITY_DEFINE_INSTANCED_PROP(half, _SubFrameKeys)
#endif
#if TRAIL_LOCAL
UNITY_DEFINE_INSTANCED_PROP(float4x4, _ParentMatrices)
#endif
UNITY_INSTANCING_BUFFER_END(Props)
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 vertex = v.vertex;
#if TRAIL_INTERPOLATE
half key = UNITY_ACCESS_INSTANCED_PROP(Props, _SubFrameKeys);
vertex.xyz = lerp(v.prevVertex.xyz, vertex.xyz, key);
#endif
#if TRAIL_LOCAL
vertex = mul(unity_ObjectToWorld, vertex);
float4x4 parentMatrix = UNITY_ACCESS_INSTANCED_PROP(Props, _ParentMatrices);
vertex = mul(parentMatrix, vertex);
vertex = mul(_PivotMatrix, vertex);
o.pos = mul(UNITY_MATRIX_VP, vertex);
#else
o.pos = UnityObjectToClipPos(vertex);
#endif
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
inline fixed getLuma(fixed3 rgb) {
const fixed3 lum = float3(0.299, 0.587, 0.114);
return dot(rgb, lum);
}
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
fixed4 col = tex2D(_MainTex, i.uv);
#if TRAIL_ALPHACLIP
clip(getLuma(col.rgb) - _CutOff);
#endif
col *= UNITY_ACCESS_INSTANCED_PROP(Props, _Colors);
#if TRAIL_MASK
fixed4 mask = tex2D(_MaskTex, i.uv);
col.a *= mask.r;
#endif
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailEffectColor
m_Shader: {fileID: 4800000, guid: 0b2a4427332444a4e9e4bcbb0e39792b, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,146 @@
Shader "TrailsFX/Effect/Color" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
_Cull ("Cull", Int) = 2
_ColorRamp("Color Ramp", 2D) = "white" {}
}
SubShader
{
Tags { "Queue"="Transparent+101" "RenderType"="Transparent"}
Pass
{
Stencil {
Ref 2
ReadMask 2
Comp NotEqual
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#pragma multi_compile_local _ TRAIL_INTERPOLATE
#pragma multi_compile_local _ TRAIL_COLOR_RAMP
#pragma multi_compile_local _ TRAIL_MASK
#pragma multi_compile_local _ TRAIL_LOCAL
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
#if TRAIL_INTERPOLATE
float4 prevVertex : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
#if TRAIL_COLOR_RAMP
float3 wpos : TEXCOORD1;
#endif
UNITY_VERTEX_OUTPUT_STEREO
};
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Colors)
#if TRAIL_INTERPOLATE || TRAIL_COLOR_RAMP
UNITY_DEFINE_INSTANCED_PROP(half, _SubFrameKeys)
#endif
#if TRAIL_COLOR_RAMP
UNITY_DEFINE_INSTANCED_PROP(float4, _RampStartPos)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _RampEndPos)
#endif
#if TRAIL_LOCAL
UNITY_DEFINE_INSTANCED_PROP(float4x4, _ParentMatrices)
#endif
UNITY_INSTANCING_BUFFER_END(Props)
sampler2D _ColorRamp;
sampler2D _MaskTex;
float4 _MaskTex_ST;
float4x4 _PivotMatrix;
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 vertex = v.vertex;
#if TRAIL_INTERPOLATE
half key = UNITY_ACCESS_INSTANCED_PROP(Props, _SubFrameKeys);
vertex.xyz = lerp(v.prevVertex.xyz, vertex.xyz, key);
#endif
#if TRAIL_LOCAL
vertex = mul(unity_ObjectToWorld, vertex);
float4x4 parentMatrix = UNITY_ACCESS_INSTANCED_PROP(Props, _ParentMatrices);
vertex = mul(parentMatrix, vertex);
vertex = mul(_PivotMatrix, vertex);
o.pos = mul(UNITY_MATRIX_VP, vertex);
#if TRAIL_COLOR_RAMP
o.wpos = vertex.xyz;
#endif
#else
o.pos = UnityObjectToClipPos(vertex);
#if TRAIL_COLOR_RAMP
o.wpos = mul(unity_ObjectToWorld, vertex).xyz;
#endif
#endif
#if TRAIL_MASK
o.uv = TRANSFORM_TEX(v.uv, _MaskTex);
#endif
return o;
}
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
fixed4 col = UNITY_ACCESS_INSTANCED_PROP(Props, _Colors);
#if TRAIL_COLOR_RAMP
half key = UNITY_ACCESS_INSTANCED_PROP(Props, _SubFrameKeys);
float3 rampStart = UNITY_ACCESS_INSTANCED_PROP(Props, _RampStartPos).xyz;
float3 rampEnd = UNITY_ACCESS_INSTANCED_PROP(Props, _RampEndPos).xyz;
float3 dir = rampEnd - rampStart;
float len = length(dir);
float3 axis = dir / len;
float3 toWpos = i.wpos - rampStart;
float t = dot(toWpos, axis);
float d = t / len;
fixed4 ramp = tex2Dlod(_ColorRamp, float4(d, key, 0, 0));
col *= ramp;
if (floor(d) != 0) col = 0;
#endif
#if TRAIL_MASK
fixed4 mask = tex2D(_MaskTex, i.uv);
col.a *= mask.r;
#endif
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailEffectDistort
m_Shader: {fileID: 4800000, guid: b2ec35bcf9559476bb1a7cd86d073907, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,241 @@
Shader "TrailsFX/Effect/Distort" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
_Cull ("Cull", Int) = 2
_AdditiveTint ("Additive Tint", Color) = (0,0,0.1)
}
SubShader
{
Tags { "Queue"="Transparent+101" "RenderType"="Transparent" "RenderPipeline" = "UniversalPipeline" }
Pass
{
Stencil {
Ref 2
ReadMask 2
Comp NotEqual
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#pragma multi_compile_local _ TRAIL_INTERPOLATE
#pragma multi_compile_local _ TRAIL_MASK
#pragma multi_compile_local _ TRAIL_LOCAL
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
#if TRAIL_INTERPOLATE
float4 prevVertex : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
float4 grabPos : TEXCOORD1;
fixed4 color : COLOR;
UNITY_VERTEX_OUTPUT_STEREO
};
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Colors)
#if TRAIL_INTERPOLATE
UNITY_DEFINE_INSTANCED_PROP(half, _SubFrameKeys)
#endif
#if TRAIL_LOCAL
UNITY_DEFINE_INSTANCED_PROP(float4x4, _ParentMatrices)
#endif
UNITY_INSTANCING_BUFFER_END(Props)
sampler2D _MaskTex;
float4 _MaskTex_ST;
float4x4 _PivotMatrix;
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 vertex = v.vertex;
#if TRAIL_INTERPOLATE
half key = UNITY_ACCESS_INSTANCED_PROP(Props, _SubFrameKeys);
vertex.xyz = lerp(v.prevVertex.xyz, vertex.xyz, key);
#endif
#if TRAIL_LOCAL
vertex = mul(unity_ObjectToWorld, vertex);
float4x4 parentMatrix = UNITY_ACCESS_INSTANCED_PROP(Props, _ParentMatrices);
vertex = mul(parentMatrix, vertex);
vertex = mul(_PivotMatrix, vertex);
o.pos = mul(UNITY_MATRIX_VP, vertex);
#else
o.pos = UnityObjectToClipPos(vertex);
#endif
o.grabPos = ComputeGrabScreenPos(o.pos);
o.color = UNITY_ACCESS_INSTANCED_PROP(Props, _Colors);
o.grabPos.xy += (0.5.xx - o.color.rg) * o.color.a / o.grabPos.w;
#if TRAIL_MASK
o.uv = TRANSFORM_TEX(v.uv, _MaskTex);
#endif
return o;
}
sampler2D _CameraOpaqueTexture;
fixed4 _AdditiveTint;
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
fixed4 col = tex2Dproj(_CameraOpaqueTexture, i.grabPos);
col.rgb += _AdditiveTint;
col.a *= i.color.a;
#if TRAIL_MASK
fixed4 mask = tex2D(_MaskTex, i.uv);
col.a *= mask.r;
#endif
return col;
}
ENDCG
}
}
SubShader
{
Tags { "Queue"="Transparent+101" "RenderType"="Transparent" }
GrabPass {
"_BackgroundTexture"
}
Pass
{
Stencil {
Ref 2
ReadMask 2
Comp NotEqual
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#pragma multi_compile_local _ TRAIL_INTERPOLATE
#pragma multi_compile_local _ TRAIL_MASK
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
#if TRAIL_INTERPOLATE
float4 prevVertex : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
float4 grabPos : TEXCOORD1;
fixed4 color : COLOR;
UNITY_VERTEX_OUTPUT_STEREO
};
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Colors)
#if TRAIL_INTERPOLATE
UNITY_DEFINE_INSTANCED_PROP(half, _SubFrameKeys)
#endif
UNITY_INSTANCING_BUFFER_END(Props)
sampler2D _BackgroundTexture;
fixed4 _AdditiveTint;
sampler2D _MaskTex;
float4 _MaskTex_ST;
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 vertex = v.vertex;
#if TRAIL_INTERPOLATE
half key = UNITY_ACCESS_INSTANCED_PROP(Props, _SubFrameKeys);
vertex.xyz = lerp(v.prevVertex.xyz, vertex.xyz, key);
#endif
o.pos = UnityObjectToClipPos(vertex);
o.grabPos = ComputeGrabScreenPos(o.pos);
o.color = UNITY_ACCESS_INSTANCED_PROP(Props, _Colors);
o.grabPos.xy += (0.5.xx - o.color.rg) * o.color.a / o.grabPos.w;
#if TRAIL_MASK
o.uv = TRANSFORM_TEX(v.uv, _MaskTex);
#endif
return o;
}
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
fixed4 col = tex2Dproj(_BackgroundTexture, i.grabPos);
col.rgb += _AdditiveTint;
col.a *= i.color.a;
#if TRAIL_MASK
fixed4 mask = tex2D(_MaskTex, i.uv);
col.a *= mask.r;
#endif
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailEffectLaser
m_Shader: {fileID: 4800000, guid: 1e2ed48517d8843da9dce67060676fb7, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _NormalThreshold: 0.1
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,127 @@
Shader "TrailsFX/Effect/Laser" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
_LaserData("Laser Data", Vector) = (0.1, 20, 0.1)
_Cull ("Cull", Int) = 2
}
SubShader
{
Tags { "Queue"="Transparent+101" "RenderType"="Transparent" }
Pass
{
Stencil {
Ref 2
ReadMask 2
Comp NotEqual
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#pragma multi_compile_local _ TRAIL_INTERPOLATE
#pragma multi_compile_local _ TRAIL_MASK
#pragma multi_compile_local _ TRAIL_LOCAL
#include "UnityCG.cginc"
#pragma target 3.5
struct appdata
{
float4 vertex : POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
#if TRAIL_INTERPOLATE
float4 prevVertex : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
float3 vertex : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Colors)
#if TRAIL_INTERPOLATE
UNITY_DEFINE_INSTANCED_PROP(half, _SubFrameKeys)
#endif
#if TRAIL_LOCAL
UNITY_DEFINE_INSTANCED_PROP(float4x4, _ParentMatrices)
#endif
UNITY_INSTANCING_BUFFER_END(Props)
sampler2D _MaskTex;
float4 _MaskTex_ST;
float4x4 _PivotMatrix;
v2f vert (appdata v, uint vid : SV_VertexID)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 vertex = v.vertex;
#if TRAIL_INTERPOLATE
half key = UNITY_ACCESS_INSTANCED_PROP(Props, _SubFrameKeys);
vertex.xyz = lerp(v.prevVertex.xyz, vertex.xyz, key);
#endif
o.vertex = v.vertex;
#if TRAIL_LOCAL
vertex = mul(unity_ObjectToWorld, vertex);
float4x4 parentMatrix = UNITY_ACCESS_INSTANCED_PROP(Props, _ParentMatrices);
vertex = mul(parentMatrix, vertex);
vertex = mul(_PivotMatrix, vertex);
o.pos = mul(UNITY_MATRIX_VP, vertex);
#else
o.pos = UnityObjectToClipPos(vertex);
#endif
#if TRAIL_MASK
o.uv = TRANSFORM_TEX(v.uv, _MaskTex);
#endif
return o;
}
float3 _LaserData;
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
fixed4 col = UNITY_ACCESS_INSTANCED_PROP(Props, _Colors);
float seq = (abs(i.vertex.y) + _LaserData.x * 0.5) % _LaserData.x;
seq = 1.0 - saturate(abs(seq - _LaserData.x * 0.5) * _LaserData.y);
seq *= (col.a % _LaserData.z)> (_LaserData.z * 0.5);
col *= seq;
#if TRAIL_MASK
fixed4 mask = tex2D(_MaskTex, i.uv);
col.a *= mask.r;
#endif
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailEffectOutline
m_Shader: {fileID: 4800000, guid: d3fb47ec58ff74676bf2843b703bbe9a, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _NormalThreshold: 0.1
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,124 @@
Shader "TrailsFX/Effect/Outline" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
_NormalThreshold("Normal Threshold", Float) = 0.1
_Cull ("Cull", Int) = 2
}
SubShader
{
Tags { "Queue"="Transparent+101" "RenderType"="Transparent" }
Pass
{
Stencil {
Ref 2
ReadMask 2
Comp NotEqual
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#pragma multi_compile_local _ TRAIL_INTERPOLATE
#pragma multi_compile_local _ TRAIL_MASK
#pragma multi_compile_local _ TRAIL_LOCAL
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float3 norm : NORMAL;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
#if TRAIL_INTERPOLATE
float4 prevVertex : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
#if TRAIL_MASK
float2 uv : TEXCOORD0;
#endif
float3 wsNorm : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Colors)
#if TRAIL_INTERPOLATE
UNITY_DEFINE_INSTANCED_PROP(half, _SubFrameKeys)
#endif
#if TRAIL_LOCAL
UNITY_DEFINE_INSTANCED_PROP(float4x4, _ParentMatrices)
#endif
UNITY_INSTANCING_BUFFER_END(Props)
sampler2D _MaskTex;
float4 _MaskTex_ST;
float4x4 _PivotMatrix;
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 vertex = v.vertex;
#if TRAIL_INTERPOLATE
half key = UNITY_ACCESS_INSTANCED_PROP(Props, _SubFrameKeys);
vertex.xyz = lerp(v.prevVertex.xyz, vertex.xyz, key);
#endif
#if TRAIL_LOCAL
vertex = mul(unity_ObjectToWorld, vertex);
float4x4 parentMatrix = UNITY_ACCESS_INSTANCED_PROP(Props, _ParentMatrices);
vertex = mul(parentMatrix, vertex);
vertex = mul(_PivotMatrix, vertex);
o.pos = mul(UNITY_MATRIX_VP, vertex);
#else
o.pos = UnityObjectToClipPos(vertex);
#endif
o.wsNorm = UnityObjectToWorldNormal(v.norm);
#if TRAIL_MASK
o.uv = TRANSFORM_TEX(v.uv, _MaskTex);
#endif
return o;
}
float _NormalThreshold;
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
fixed4 col = UNITY_ACCESS_INSTANCED_PROP(Props, _Colors);
fixed dx = saturate(dot(fwidth(i.wsNorm), 1.0.xxx) / _NormalThreshold);
col *= dx;
#if TRAIL_MASK
fixed4 mask = tex2D(_MaskTex, i.uv);
col.a *= mask.r;
#endif
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailEffectTextureStamp
m_Shader: {fileID: 4800000, guid: cb82836984de04e3fb920ce355d018df, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _CutOff: 0.5
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,106 @@
Shader "TrailsFX/Effect/TextureStamp" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color1", Color) = (1,1,1,1)
_CutOff("Cut Off", Float) = 0.5
_Cull ("Cull", Int) = 2
}
SubShader
{
Tags { "Queue"="Transparent+101" "RenderType"="Transparent" }
Pass
{
Stencil {
Ref 2
ReadMask 2
Comp NotEqual
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Cull Off
Offset -1, -1
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing assumeuniformscaling nolightprobe nolodfade nolightmap
#pragma multi_compile_local _ TRAIL_MASK
#pragma multi_compile_local _ TRAIL_LOCAL
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
sampler2D _MainTex;
float4 _MainTex_ST;
fixed _CutOff;
sampler2D _MaskTex;
float4x4 _PivotMatrix;
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Colors)
UNITY_DEFINE_INSTANCED_PROP(float4x4, _ParentMatrices)
UNITY_INSTANCING_BUFFER_END(Props)
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 vertex = v.vertex;
#if TRAIL_LOCAL
vertex = mul(unity_ObjectToWorld, vertex);
float4x4 parentMatrix = UNITY_ACCESS_INSTANCED_PROP(Props, _ParentMatrices);
vertex = mul(parentMatrix, vertex);
vertex = mul(_PivotMatrix, vertex);
o.pos = mul(UNITY_MATRIX_VP, vertex);
#if TRAIL_COLOR_RAMP
o.wpos = vertex.xyz;
#endif
#else
o.pos = UnityObjectToClipPos(vertex);
#endif
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
fixed4 col = tex2D(_MainTex, i.uv);
clip(col.a - _CutOff);
col *= UNITY_ACCESS_INSTANCED_PROP(Props, _Colors);
#if TRAIL_MASK
fixed4 mask = tex2D(_MaskTex, i.uv);
col.a *= mask.r;
#endif
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,72 @@
Shader "TrailsFX/Mask" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1) // not used; dummy property to avoid inspector warning "material has no _Color property"
_CutOff("Cut Off", Float) = 0.5
_Cull ("Cull", Int) = 2
}
SubShader
{
Tags { "Queue"="Transparent+100" "RenderType"="Transparent" }
// Create mask
Pass
{
Stencil {
Ref 2
WriteMask 2
Comp always
Pass replace
}
ColorMask 0
ZTest Always
ZWrite Off
Cull [_Cull]
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 pos: SV_POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
sampler2D _MainTex;
fixed _CutOff;
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
#if TRAIL_ALPHACLIP
clip(col.a - _CutOff);
#endif
return 0;
}
ENDCG
}
}
}