Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. Shader "Custom/Simple Specular"
  2. {
  3. Properties
  4. {
  5. _Color ("Color", Color) = (1,1,1,1)
  6. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  7. _Glossiness("Smoothness", Range(0,1)) = 0.5
  8. _Metallic("Metallic", Range(0,1)) = 0.0
  9. }
  10. SubShader
  11. {
  12. CGPROGRAM
  13. #pragma surface surf SimpleSpecular
  14.  
  15. half4 LightningSimpleSpecular(SurfaceOutput s, half3 lightDir, half3 viewDir, half atten) {
  16. half diff = max(0, dot(s.Normal, lightDir));
  17. float nh = max(0, dot(s.Normal, h));
  18. float spec = pow(nh, 48.0);
  19.  
  20. half4 c;
  21. c.rgb = (s.Albedo * _LightColor0.rgb * diff * _LightColor0.rgb * spec) * atten;
  22. c.a = s.Alpha;
  23. return c;
  24. }
  25. struct Input {
  26. float2 uv_MainTex;
  27. };
  28. sampler2D _MainTex;
  29.  
  30. void surf (Input IN, inout SurfaceOutputStandard o)
  31. {
  32. o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb;
  33. }
  34. ENDCG
  35. }
  36. FallBack "Diffuse"
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement