RO_Diffuse_DmShadow.shader 843 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Simplified Diffuse shader. Differences from regular Diffuse one:
  2. // - no Main Color
  3. // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH.
  4. Shader "RO/RO_Diffuse_DmShadow" {
  5. Properties {
  6. _MainTex ("Base (RGB)", 2D) = "white" {}
  7. }
  8. SubShader {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 150
  11. CGPROGRAM
  12. #pragma surface surf Lambert noforwardadd
  13. //#pragma surface surf myLightModel noforwardadd
  14. sampler2D _MainTex;
  15. struct Input {
  16. float2 uv_MainTex;
  17. };
  18. // 自定义光照模型
  19. float4 LightingmyLightModel(SurfaceOutput s, float3 lightDir, half3 viewDir, half atten)
  20. {
  21. float4 c;
  22. c.rgb = s.Albedo;
  23. c.a = s.Alpha;
  24. return c;
  25. }
  26. void surf (Input IN, inout SurfaceOutput o) {
  27. fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
  28. o.Albedo = c.rgb;
  29. o.Alpha = c.a;
  30. }
  31. ENDCG
  32. }
  33. //FallBack "Mobile/VertexLit"
  34. }