Unlit with shadow

Offy163
polycounter lvl 3
Offline / Send Message
Pinned
Offy163 polycounter lvl 3
Hi guys, need a little help. 
How i can delete the shadow on the body ? But dont touch the shadow on the floor? 

  1. Shader "Unlit With Shadows" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB)", 2D) = "white" {}
  5. }
  6. SubShader {
  7. Tags {"Queue" = "Geometry" "RenderType" = "Opaque"}
  8.  
  9. Pass {
  10. Tags {"LightMode" = "ForwardBase"}
  11. CGPROGRAM
  12. #pragma vertex vert
  13. #pragma fragment frag
  14. #pragma multi_compile_fwdbase
  15. #pragma fragmentoption ARB_fog_exp2
  16. #pragma fragmentoption ARB_precision_hint_fastest
  17. #include "UnityCG.cginc"
  18. #include "AutoLight.cginc"
  19. struct v2f
  20. {
  21. float4 pos : SV_POSITION;
  22. float2 uv : TEXCOORD0;
  23. LIGHTING_COORDS(1,2)
  24. };
  25.  
  26. float4 _MainTex_ST;
  27.  
  28. v2f vert (appdata_tan v)
  29. {
  30. v2f o;
  31. o.pos = mul( UNITY_MATRIX_MVP, v.vertex);
  32. o.uv = TRANSFORM_TEX (v.texcoord, _MainTex).xy;
  33. TRANSFER_VERTEX_TO_FRAGMENT(o);
  34. return o;
  35. }
  36.  
  37. sampler2D _MainTex;
  38.  
  39. fixed4 frag(v2f i) : COLOR
  40. {
  41. fixed atten = LIGHT_ATTENUATION(i); // Light attenuation + shadows.
  42. //fixed atten = SHADOW_ATTENUATION(i); // Shadows ONLY.
  43. return tex2D(_MainTex, i.uv) * atten;
  44. }
  45. ENDCG
  46. }
  47.  
  48. Pass {
  49. Tags {"LightMode" = "ForwardAdd"}
  50. Blend One One
  51. CGPROGRAM
  52. #pragma vertex vert
  53. #pragma fragment frag
  54. #pragma multi_compile_fwdadd_fullshadows
  55. #pragma fragmentoption ARB_fog_exp2
  56. #pragma fragmentoption ARB_precision_hint_fastest
  57. #include "UnityCG.cginc"
  58. #include "AutoLight.cginc"
  59. struct v2f
  60. {
  61. float4 pos : SV_POSITION;
  62. float2 uv : TEXCOORD0;
  63. LIGHTING_COORDS(1,2)
  64. };
  65.  
  66. float4 _MainTex_ST;
  67.  
  68. v2f vert (appdata_tan v)
  69. {
  70. v2f o;
  71. o.pos = mul( UNITY_MATRIX_MVP, v.vertex);
  72. o.uv = TRANSFORM_TEX (v.texcoord, _MainTex).xy;
  73. TRANSFER_VERTEX_TO_FRAGMENT(o);
  74. return o;
  75. }
  76.  
  77. sampler2D _MainTex;
  78.  
  79. fixed4 frag(v2f i) : COLOR
  80. {
  81. fixed atten = LIGHT_ATTENUATION(i); // Light attenuation + shadows.
  82. //fixed atten = SHADOW_ATTENUATION(i); // Shadows ONLY.
  83. return tex2D(_MainTex, i.uv) * atten;
  84. }
  85. ENDCG
  86. }
  87. }
  88. FallBack "VertexLit"
  89. }

Replies

Sign In or Register to comment.