Add Unity's Standard (Roughness) shader properties to custom shader?

I have created a custom shader that is used to blend two materials easily. How do I include properties such as Normal map and emission properties and other properties as well from Unity’s Standard (Roughness) shader?

 Shader "Myshaders/ChangeMaterial" {
     Properties {
         _Tint ("Tint Color", Color) = (.9, .9, .9, 1.0)
         _TexMat1 ("Base (RGB)", 2D) = "white" {}
         _TexMat2 ("Base (RGB)", 2D) = "white" {}
         _Blend ("Blend", Range(0.0,1.0)) = 0.0
     }
     Category {
         ZWrite On
         Alphatest Greater 0
         Tags {Queue=Transparent}
         Blend SrcAlpha OneMinusSrcAlpha
         ColorMask RGB
     SubShader {
         Pass {
             Material {
                 Diffuse [_Tint]
                 Ambient [_Tint]
             }
             Lighting On
             SetTexture [_TexMat1] { combine texture }
             SetTexture [_TexMat2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
             SetTexture [_TexMat2] { combine previous +- primary, previous * primary }
         }
     }
     FallBack " Diffuse", 1
}
}

Hmmm. You are using legacy fixed function shader commands, and you should convert your shader to the newer shaderlab surchace shaders.

If you do that, you define the properties for normal and emission just like you woud for any texture. If you are writing a surface shader based on shader lab, use the standartized Output structure to pass the result back to Unity.

I don’t know how you would do that with the old shader commands, as I don’t know which passes are used for the Normals and Emission (if they exist at all – emission is part of the materials block, normals…?).

I changed the shader to support the current version. How do I add emission (HDR) and Normal Map properties that are in Standard Roughness to this custom shader below:

  Shader "Custom/Texture Blend" {
         Properties {
             _Color ("Color", Color) = (1,1,1,1)
             _Blend ("Texture Blend", Range(0,1)) = 0.0
             _MainTex ("Albedo (RGB)", 2D) = "white" {}
             _MainTex2 ("Albedo 2 (RGB)", 2D) = "white" {}
             _Glossiness ("Roughness", Range(0,1)) = 0.5
             _Metallic ("Metallic", Range(0,1)) = 0.0
             _Emission("Emission", float) = 0
           
         }
         SubShader {
             Tags { "RenderType"="Opaque" }
             LOD 200
           
             CGPROGRAM
             // Physically based Standard lighting model, and enable shadows on all light types
             #pragma surface surf Standard fullforwardshadows
     
             // Use shader model 3.0 target, to get nicer looking lighting
             #pragma target 3.0
     
             sampler2D _MainTex;
             sampler2D _MainTex2;
             float _Emission;
     
             struct Input {
                 float2 uv_MainTex;
                 float2 uv_MainTex2;
             };
     
             half _Blend;
             half _Roughness;
             half _Metallic;
             fixed4 _Color;
     
             void surf (Input IN, inout SurfaceOutputStandard o) {
                 // Albedo comes from a texture tinted by color
                 fixed4 c = lerp (tex2D (_MainTex, IN.uv_MainTex), tex2D (_MainTex2, IN.uv_MainTex2), _Blend) * _Color;
                 o.Albedo = c.rgb;
                 // Metallic and smoothness come from slider variables
                 o.Metallic = _Metallic;
                 o.Smoothness = _Roughness;
                 o.Alpha = c.a;
                 o.Emission = c.rgb * tex2D(_MainTex, IN.uv_MainTex).a * _Emission;
             }
             ENDCG
         }
         FallBack "Diffuse"
     }

I don’t have any experience with Roughness shaders (except that I can dimly remember that there was somethng like that), but I’d think that normal should work like a Standard texture (and you feed that to o.Normal. I’m not sure if you can lerp the normal maps, but it’s worth a try). Emission seems taken care of, except I would have taken it from an emission texture rather than main tex.This of course requires you setting up the properties accordingly (as Tex 2D, same as main tex)