summaryrefslogtreecommitdiff
path: root/Other/NavMeshTest/Assets/Shaders/double_face_shader.shader
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-05-23 10:10:23 +0800
committerchai <215380520@qq.com>2024-05-23 10:10:23 +0800
commit81330a6b68d307937c262368a42a3fa4e9ad4207 (patch)
tree0616a08be385794e062fb616df4ffb503631ee08 /Other/NavMeshTest/Assets/Shaders/double_face_shader.shader
parent8722a9920c1f6119bf6e769cba270e63097f8e25 (diff)
+ NavMeshTest
Diffstat (limited to 'Other/NavMeshTest/Assets/Shaders/double_face_shader.shader')
-rw-r--r--Other/NavMeshTest/Assets/Shaders/double_face_shader.shader64
1 files changed, 64 insertions, 0 deletions
diff --git a/Other/NavMeshTest/Assets/Shaders/double_face_shader.shader b/Other/NavMeshTest/Assets/Shaders/double_face_shader.shader
new file mode 100644
index 0000000..66b9c96
--- /dev/null
+++ b/Other/NavMeshTest/Assets/Shaders/double_face_shader.shader
@@ -0,0 +1,64 @@
+Shader "NavMesh/double_face_shader"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "white" {}
+ _Color("Color", Color) = (0,0,1,0)
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" "Queue"="Geomatry"}
+ LOD 100
+ Cull Off
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ // make fog work
+ #pragma multi_compile_fog
+
+ #include "UnityCG.cginc"
+
+ struct appdata
+ {
+ float4 vertex : POSITION;
+ float2 uv : TEXCOORD0;
+ };
+
+ struct v2f
+ {
+ float2 uv : TEXCOORD0;
+ UNITY_FOG_COORDS(1)
+ float4 vertex : SV_POSITION;
+ };
+
+ sampler2D _MainTex;
+ float4 _MainTex_ST;
+
+ fixed4 _Color;
+
+ v2f vert (appdata v)
+ {
+ v2f o;
+ o.vertex = UnityObjectToClipPos(v.vertex);
+ o.uv = TRANSFORM_TEX(v.uv, _MainTex);
+ UNITY_TRANSFER_FOG(o,o.vertex);
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+ // sample the texture
+ fixed4 col = tex2D(_MainTex, i.uv);
+ // apply fog
+ UNITY_APPLY_FOG(i.fogCoord, col);
+ return _Color;
+ }
+ ENDCG
+ }
+ }
+
+ FallBack "Diffuse"
+}