Advertisement
Xibanya

Basic Shader Template

Jul 4th, 2019
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "Xibanya/XibStandard"
  2. {
  3.     Properties
  4.     {
  5.         _Color ("Color", Color) = (1,1,1,1)
  6.         _MainTex ("Albedo (RGB)", 2D) = "white" {}
  7.         _BumpMap("Normal", 2D) = "bump" {}
  8.         _NormalStrength("Normal Strength", Float) = 1
  9.     }
  10.     SubShader
  11.     {
  12.         Tags { "RenderType"="Opaque" }
  13.         LOD 200
  14.  
  15.         CGPROGRAM
  16.         #pragma surface surf Standard fullforwardshadows
  17.         #pragma target 3.0
  18.  
  19.         sampler2D _MainTex;
  20.         sampler2D _BumpMap;
  21.  
  22.         struct Input
  23.         {
  24.             float2 uv_MainTex;
  25.         };
  26.  
  27.         fixed4 _Color;
  28.         float _NormalStrength;
  29.  
  30.         void surf (Input IN, inout SurfaceOutputStandard o)
  31.         {
  32.             o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb * _Color;
  33.             o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));
  34.             o.Normal.z *= _NormalStrength;
  35.         }
  36.         ENDCG
  37.     }
  38.     FallBack "Diffuse"
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement