Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/My Shader"
- {
- Properties
- {
- _Color ("Main Color", Color) = (1,1,1,1)
- _Glossiness ("Smoothness", Range(0,1)) = 0.5
- _Metallic ("Metallic", Range(0,1)) = 0
- _MainTex ("Texture (RGB)", 2D) = "surface" {}
- _BumpMap ("Normal map", 2D) = "bump" {}
- _Scale ("Texture Scale", Float) = 0.1
- }
- SubShader
- {
- Tags { "RenderType"="Opaque" }
- LOD 200
- CGPROGRAM
- #pragma surface surf Lambert
- sampler2D _MainTex;
- sampler2D _BumpMap;
- struct Input
- {
- float3 worldNormal;
- float3 worldPos;
- float2 uv_MainTex;
- float2 uv_BumpMap;
- };
- float4 _Color;
- float _Scale;
- void surf (Input IN, inout SurfaceOutput o)
- {
- float2 UV;
- fixed4 c;
- if(abs(IN.worldNormal.z)>0.5)
- {
- UV = IN.worldPos.xy;
- c = tex2D(_MainTex, UV* _Scale);
- }
- o.Albedo = c.rgb * _Color;
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement