Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/VertexShadow" {
- Properties
- {
- _Color ("Color", Color) = (1, 1, 1, 1)
- }
- SubShader {
- Pass {
- Tags { "LightMode"="ForwardBase" }
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma multi_compile_fwdbase
- #include "UnityCG.cginc"
- #include "AutoLight.cginc"
- struct v2f
- {
- float4 pos : SV_POSITION;
- LIGHTING_COORDS(0, 1)
- };
- v2f vert(appdata_base v) {
- v2f o;
- o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
- TRANSFER_VERTEX_TO_FRAGMENT(o);
- return o;
- }
- fixed4 _Color;
- fixed4 _LightColor0;
- fixed4 frag(v2f i) : COLOR {
- float attenuation = LIGHT_ATTENUATION(i);
- return _Color * attenuation * _LightColor0;
- }
- ENDCG
- }
- }
- Fallback "VertexLit"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement