SenceShader.shader 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2016 Nibiru. All rights reserved.
  2. // Licensed under the Apache License, Version 2.0 (the "License");
  3. // you may not use this file except in compliance with the License.
  4. // You may obtain a copy of the License at
  5. //
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. Shader "NAR/SenceShader" {
  14. Properties {
  15. _Color ("Color", Color) = (1,1,1,1)
  16. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  17. _Glossiness ("Smoothness", Range(0,1)) = 0.5
  18. _Metallic ("Metallic", Range(0,1)) = 0.0
  19. }
  20. SubShader {
  21. Tags { "RenderType"="Opaque" }
  22. LOD 200
  23. cull off
  24. CGPROGRAM
  25. // Physically based Standard lighting model, and enable shadows on all light types
  26. #pragma surface surf Standard fullforwardshadows
  27. // Use shader model 3.0 target, to get nicer looking lighting
  28. #pragma target 3.0
  29. sampler2D _MainTex;
  30. struct Input {
  31. float2 uv_MainTex;
  32. };
  33. half _Glossiness;
  34. half _Metallic;
  35. fixed4 _Color;
  36. void surf (Input IN, inout SurfaceOutputStandard o) {
  37. // Albedo comes from a texture tinted by color
  38. fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
  39. o.Albedo = c.rgb;
  40. // Metallic and smoothness come from slider variables
  41. o.Metallic = _Metallic;
  42. o.Smoothness = _Glossiness;
  43. o.Alpha = c.a;
  44. }
  45. ENDCG
  46. }
  47. FallBack "Diffuse"
  48. }