Seven is the number.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

4 years ago
  1. Shader "Custom/Planet_Clouds"
  2. {
  3. Properties{
  4. _MainTex("Base (RGB)", 2D) = "white" {}
  5. _AlphaScale("Alpha Scale", Range(0.0, 2.0)) = 1.0
  6. [NoScaleOffset]_BumpMap("Normal Map", 2D) = "bump" {}
  7. _BumpScale("Bump Scale", Range(0.0, 1.0)) = 1.0
  8. _DisplacementClouds ("Clouds displacement", Range(0, .1)) = 0.1
  9. }
  10. CGINCLUDE
  11. #define _GLOSSYENV 1
  12. #define UNITY_SETUP_BRDF_INPUT SpecularSetup
  13. ENDCG
  14. SubShader
  15. {
  16. Tags
  17. {
  18. "RenderType" = "Transparent"
  19. "Queue" = "Transparent"
  20. }
  21. LOD 300
  22. Blend SrcAlpha OneMinusSrcAlpha
  23. ZWrite Off
  24. CGPROGRAM
  25. #pragma target 3.0
  26. #include "UnityPBSLighting.cginc"
  27. //#pragma surface surf Standard
  28. #pragma surface surf Standard fullforwardshadows alpha vertex:vert
  29. //#pragma surface surf Lambert
  30. //#define UNITY_PASS_FORWARDBASE
  31. sampler2D _MainTex;
  32. sampler2D _BumpMap;
  33. uniform float _BumpScale;
  34. uniform float _AlphaScale;
  35. uniform float _DisplacementClouds;
  36. struct Input
  37. {
  38. float2 uv_MainTex;
  39. };
  40. void vert (inout appdata_full v)
  41. {
  42. v.vertex.xyz += v.normal * _DisplacementClouds;
  43. }
  44. void surf(Input IN, inout SurfaceOutputStandard o)
  45. {
  46. float4 albedotex = tex2D(_MainTex, IN.uv_MainTex);
  47. float4 normaltex = tex2D(_BumpMap, IN.uv_MainTex);
  48. o.Albedo = albedotex.rgb;
  49. o.Alpha = saturate(albedotex.a * _AlphaScale);
  50. o.Normal = normalize(UnpackScaleNormal(normaltex, _BumpScale));
  51. o.Metallic = 0.0f;
  52. o.Smoothness = 0.0f;
  53. }
  54. ENDCG
  55. }
  56. FallBack "Diffuse"
  57. }