Advertisement
Guest User

Untitled

a guest
Nov 17th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. Shader "Custom/My Shader2" {
  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.  
  12. CGPROGRAM
  13. // Physically based Standard lighting model, and enable shadows on all light types
  14. #pragma surface surf Standard fullforwardshadows
  15.  
  16. // Use shader model 3.0 target, to get nicer looking lighting
  17. #pragma target 3.0
  18.  
  19. sampler2D _MainTex;
  20.  
  21. struct Input
  22. {
  23. float2 uv_MainTex;
  24. };
  25.  
  26. half _Glossiness;
  27. half _Metallic;
  28. fixed4 _Color;
  29.  
  30. void surf (Input IN, inout SurfaceOutputStandard o) {
  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.Metallic = _Metallic;
  36. o.Smoothness = _Glossiness;
  37. o.Alpha = c.a;
  38. }
  39. ENDCG
  40. }
  41. FallBack "Diffuse"
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement