LadyTentacle

Custom/MM

Jan 24th, 2020
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Custom/MM"
  2. {
  3. Properties
  4. {
  5. _Albedo("Albedo", 2D) = "White"{}
  6. _Color("Colour", Color) = (1,1,1,1)
  7. _AORM("AO/R/M", 2D) = "black"{}
  8. _Normal("Normal", 2D) = "bump" {}
  9. _NSlider("Normal Power", Range(-10,10)) = 1
  10. _Tile("Tile", Range(0,20)) = 1
  11.  
  12. }
  13. SubShader
  14. {
  15. Tags { "RenderType" = "Opaque" }
  16. LOD 200
  17.  
  18. CGPROGRAM
  19. #pragma surface surf Standard fullforwardshadows
  20.  
  21. sampler2D _Albedo;
  22. sampler2D _Normal;
  23. sampler2D _AORM;
  24. fixed4 _Color;
  25. half _NSlider;
  26. half _Tile;
  27.  
  28.  
  29. struct Input
  30. {
  31. float2 uv_Albedo;
  32. float2 uv_Normal;
  33. float2 uv_AORM;
  34. };
  35.  
  36. void surf(Input i, inout SurfaceOutputStandard o)
  37. {
  38. fixed4 c = tex2D(_Albedo, i.uv_Albedo * _Tile) *_Color;
  39.  
  40. o.Albedo = c.rgb;
  41. o.Normal = UnpackNormal(tex2D(_Normal, i.uv_Normal * _Tile));
  42. o.Normal *= float3(_NSlider, _NSlider, 1);
  43. o.Metallic = tex2D(_AORM, i.uv_AORM * _Tile).b;
  44. o.Smoothness = 1 - (tex2D(_AORM, i.uv_AORM * _Tile)).g;
  45. o.Occlusion = tex2D(_AORM, i.uv_AORM * _Tile).r;
  46.  
  47. }
  48. ENDCG
  49. }
  50.  
  51. Fallback "Standard"
  52.  
  53.  
  54. }
RAW Paste Data