Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/TestSurfaceDecal" {
- Properties {
- _Color("Main Color", Color) = (1,1,1,1)
- _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
- _BumpMap("Normalmap", 2D) = "bump" {}
- _SpecGlossMap("Specular", 2D) = "white" {}
- _Gloss("Gloss", Range(0.0, 1.0)) = 1.0
- }
- SubShader {
- Tags { "RenderType"="Transparent" "IgnoreProjector" = "True" "Queue" = "AlphaTest" }
- LOD 200
- //Blend SrcAlpha OneMinusSrcAlpha
- CGPROGRAM
- // Physically based Standard lighting model, and enable shadows on all light types
- #pragma surface surf StandardSpecular fullforwardshadows decal:blend//alpha:blend
- // Use shader model 3.0 target, to get nicer looking lighting
- #pragma target 3.0
- sampler2D _MainTex;
- sampler2D _BumpMap;
- sampler2D _SpecGlossMap;
- float _Gloss;
- fixed4 _Color;
- struct Input {
- float2 uv_MainTex;
- float2 uv_BumpMap;
- float4 color: Color;
- };
- void surf (Input IN, inout SurfaceOutputStandardSpecular o) {
- fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color * IN.color;
- o.Albedo = c.rgb;
- o.Alpha = c.a;
- o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
- half4 specGloss = tex2D(_SpecGlossMap, IN.uv_MainTex);
- o.Specular = specGloss.rgb;
- o.Smoothness = specGloss.a*_Gloss;
- }
- ENDCG
- }
- FallBack "Decal/Transparent Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement