line.shader 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Shader "Shader/line" {
  2. Properties {
  3. _Color ("Color", Color) = (1,1,1,1)
  4. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  5. _Glossiness ("Smoothness", Range(0,1)) = 0.5
  6. _Metallic ("Metallic", Range(0,1)) = 0.0
  7. }
  8. SubShader {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 200
  11. CGPROGRAM
  12. // Physically based Standard lighting model, and enable shadows on all light types
  13. #pragma surface surf Standard fullforwardshadows
  14. // Use shader model 3.0 target, to get nicer looking lighting
  15. #pragma target 3.0
  16. sampler2D _MainTex;
  17. struct Input {
  18. float2 uv_MainTex;
  19. };
  20. half _Glossiness;
  21. half _Metallic;
  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. // Albedo comes from a texture tinted by color
  31. fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
  32. o.Albedo = c.rgb;
  33. // Metallic and smoothness come from slider variables
  34. o.Metallic = _Metallic;
  35. o.Smoothness = _Glossiness;
  36. o.Alpha = c.a;
  37. }
  38. ENDCG
  39. }
  40. FallBack "Diffuse"
  41. }