diff options
author | chai <chaifix@163.com> | 2022-02-18 14:38:20 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-02-18 14:38:20 +0800 |
commit | 63795c45af9ecca5aea36fbe291b18fcd9fb9b7d (patch) | |
tree | 60d811d8a0b1944ab32d24aa28394183b82cadeb /JamHelper/Assets/JamUtils/Shaders | |
parent | a41c8da0787e0285d4c5b16a5cf5bc3e7a34f521 (diff) |
*rename folder name
Diffstat (limited to 'JamHelper/Assets/JamUtils/Shaders')
-rw-r--r-- | JamHelper/Assets/JamUtils/Shaders/pure_color.shader | 61 | ||||
-rw-r--r-- | JamHelper/Assets/JamUtils/Shaders/pure_color.shader.meta | 10 |
2 files changed, 71 insertions, 0 deletions
diff --git a/JamHelper/Assets/JamUtils/Shaders/pure_color.shader b/JamHelper/Assets/JamUtils/Shaders/pure_color.shader new file mode 100644 index 0000000..d0b1d4d --- /dev/null +++ b/JamHelper/Assets/JamUtils/Shaders/pure_color.shader @@ -0,0 +1,61 @@ +Shader "JamTools/PureColor"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "white" {}
+ _Color("Color", Color) = (1,1,1,1)
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" }
+ LOD 100
+
+ 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
+ }
+ }
+}
diff --git a/JamHelper/Assets/JamUtils/Shaders/pure_color.shader.meta b/JamHelper/Assets/JamUtils/Shaders/pure_color.shader.meta new file mode 100644 index 0000000..8243625 --- /dev/null +++ b/JamHelper/Assets/JamUtils/Shaders/pure_color.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 66cfb3573dab31d4192ab92e62b7d46b +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: |