PagedLod_Light.shader 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Shader "PagedLod/Light"
  2. {
  3. Properties
  4. {
  5. _Color ("Color", Color) = (1,1,1,1)
  6. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  7. }
  8. SubShader
  9. {
  10. Tags { "RenderType"="Opaque" }
  11. LOD 200
  12. CGPROGRAM
  13. // Physically based Standard lighting model, and enable shadows on all light types
  14. #pragma surface surf Standard fullforwardshadows
  15. // Use shader model 3.0 target, to get nicer looking lighting
  16. #pragma target 3.0
  17. sampler2D _MainTex;
  18. struct Input
  19. {
  20. float2 uv_MainTex;
  21. };
  22. fixed4 _Color;
  23. // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
  24. // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
  25. // #pragma instancing_options assumeuniformscaling
  26. UNITY_INSTANCING_BUFFER_START(Props)
  27. // put more per-instance properties here
  28. UNITY_INSTANCING_BUFFER_END(Props)
  29. void surf (Input IN, inout SurfaceOutputStandard o)
  30. {
  31. // Albedo comes from a texture tinted by color
  32. fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
  33. o.Albedo = c.rgb;
  34. // Metallic and smoothness come from slider variables
  35. o.Alpha = c.a;
  36. }
  37. ENDCG
  38. }
  39. FallBack "Diffuse"
  40. }