Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/Simple Specular"
- {
- Properties
- {
- _Color ("Color", Color) = (1,1,1,1)
- _MainTex ("Albedo (RGB)", 2D) = "white" {}
- _Glossiness("Smoothness", Range(0,1)) = 0.5
- _Metallic("Metallic", Range(0,1)) = 0.0
- }
- SubShader
- {
- CGPROGRAM
- #pragma surface surf SimpleSpecular
- half4 LightningSimpleSpecular(SurfaceOutput s, half3 lightDir, half3 viewDir, half atten) {
- half diff = max(0, dot(s.Normal, lightDir));
- float nh = max(0, dot(s.Normal, h));
- float spec = pow(nh, 48.0);
- half4 c;
- c.rgb = (s.Albedo * _LightColor0.rgb * diff * _LightColor0.rgb * spec) * atten;
- c.a = s.Alpha;
- return c;
- }
- struct Input {
- float2 uv_MainTex;
- };
- sampler2D _MainTex;
- void surf (Input IN, inout SurfaceOutputStandard o)
- {
- o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb;
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement