This repository has been archived on 2024-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
snakeinabox/Assets/Materials/Wet.shader
2020-07-09 11:41:01 -07:00

63 lines
1.2 KiB
Text

Shader "Custom/Wet"
{
Properties
{
}
SubShader
{
Tags { "Queue"="Transparent" }
// LOD 100
Blend One One
ZWrite Off
// Cull Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#pragma target 3.5
// #include "UnityCG.cginc"
#include "UnityStandardBRDF.cginc"
struct appdata
{
float4 vertex : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
fixed3 normal : NORMAL;
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed3 normal : TEXCOORD1;
fixed4 color : COLOR;
};
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
o.vertex = UnityObjectToClipPos(v.vertex);
o.normal = UnityObjectToWorldNormal(v.normal);
fixed4 base = fixed4(1, 1, 1, 1);
o.color = base * 0.1 * clamp(dot(o.normal, UnityWorldSpaceViewDir(o.vertex)), 0, 1);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
return i.color;
}
ENDCG
}
}
}