Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/My Shader3" {
- Properties {
- _MainTex ("Base (RGB)", 2D) = "white" {}
- _BumpMap ("Bump map", 2D) = "bump" {} //Указываем что это обычная текстура
- }
- SubShader {
- Tags { "RenderType"="Opaque" }
- LOD 200
- CGPROGRAM
- #pragma surface surf Lambert
- sampler2D _MainTex;
- sampler2D _BumpMap;
- struct Input {
- float2 uv_MainTex;
- float2 uv_BumpMap;
- };
- void surf (Input IN, inout SurfaceOutput o) {
- half4 c = tex2D (_MainTex, IN.uv_MainTex);
- o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); //Магия
- o.Albedo = c.rgb;
- o.Alpha = c.a;
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Add Comment
Please, Sign In to add comment