Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Custom/TestSurface"
  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.         [HDR]_Emission("Emission", Color) = (1,1,1,1)
  10.     }
  11.     SubShader
  12.     {
  13.         Tags {"Queue" = "Transparent" "RenderType" = "Transparent" }
  14.         ZWrite Off
  15.         //Blend SrcAlpha OneMinusSrcAlpha
  16.         //ColorMask RGB
  17.         LOD 200
  18.  
  19.         CGPROGRAM
  20.         // Physically based Standard lighting model, and enable shadows on all light types
  21.         #pragma surface surf Standard fullforwardshadows alpha:blend
  22.  
  23.         // Use shader model 3.0 target, to get nicer looking lighting
  24.         #pragma target 3.0
  25.  
  26.         sampler2D _MainTex;
  27.  
  28.         struct Input
  29.         {
  30.             float2 uv_MainTex;
  31.         };
  32.  
  33.         half _Glossiness;
  34.         half _Metallic;
  35.         fixed4 _Color;
  36.         fixed4 _Emission;
  37.  
  38.         // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
  39.         // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
  40.         // #pragma instancing_options assumeuniformscaling
  41.         UNITY_INSTANCING_BUFFER_START(Props)
  42.             // put more per-instance properties here
  43.         UNITY_INSTANCING_BUFFER_END(Props)
  44.  
  45.         void surf (Input IN, inout SurfaceOutputStandard o)
  46.         {
  47.             // Albedo comes from a texture tinted by color
  48.             fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
  49.             o.Albedo = c.rgb;
  50.             o.Emission = _Emission;
  51.             // Metallic and smoothness come from slider variables
  52.             o.Metallic = _Metallic;
  53.             o.Smoothness = _Glossiness;
  54.             o.Alpha = c.a;
  55.         }
  56.         ENDCG
  57.     }
  58.     FallBack "Diffuse"
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement