Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/Splat Specular" {
- Properties {
- _MainTex ("Tex2 (RGB)", 2D) = "white" {}
- _MainTex2 ("Tex2 (RGB)", 2D) = "white" {}
- _Splat ("Splat", 2D) = "white" {}
- _Color ("Main Color", Color) = (1,1,1,1)
- _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
- _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
- }
- SubShader {
- Tags { "RenderType"="Opaque" }
- LOD 300
- CGPROGRAM
- #pragma surface surf BlinnPhong
- sampler2D _MainTex;
- sampler2D _MainTex2;
- sampler2D _Splat;
- float4 _Color;
- float _Shininess;
- struct Input {
- float2 uv_MainTex;
- float2 uv_MainTex2;
- };
- void surf (Input IN, inout SurfaceOutput o) {
- half4 c1 = tex2D (_MainTex, IN.uv_MainTex);
- half4 c2 = tex2D (_MainTex2, IN.uv_MainTex2);
- float s = tex2D (_Splat, IN.uv_MainTex).r;
- float midDip = saturate((0.25-(abs(s-0.5)))*2);
- half4 u = lerp(c1,c2,s);
- o.Albedo = (u.rgb - midDip*0.25) * _Color.rgb;
- o.Gloss = u.a;
- o.Alpha = u.a * _Color.a;
- o.Specular = _Shininess;
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment