Got a shader that has a normal map slot I don't need (need advice)

Ok so basically I was fishing around on the forums for a diffuse shader which had the specular map slot separate (this is because I use GIMP and just can’t find a way to put the specular map in the alpha slot, I’ve spent hours trying, I know photoshop does it easy though). I did find this excellent shader someone very kindly posted (sorry to that person though because I didn’t catch their username!), however I was wondering if anyone knew how to modify this so that the shader doesn’t use a normal map? I ask this because Unity is telling me it’s bad for optimisation if I have that slot but don’t use it?

Shader "Bumped ColoredSpecular" {

Properties {

    _Color ("Main Color", Color) = (1,1,1,1)

    _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)

    _Shininess ("Shininess", Range (0.03, 1)) = 0.078125

    _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}

    _BumpMap ("Normalmap", 2D) = "bump" {}

    

    _SpecTex ("Spec (RGB)", 2D) = "white" {}

}

SubShader { 

    Tags { "RenderType"="Opaque" }

    LOD 400

    

CGPROGRAM

#pragma surface surf BlinnPhong

 

sampler2D _MainTex;

sampler2D _BumpMap;

sampler2D _SpecTex;

float4 _Color;

//float4 _SpecColor;

float _Shininess;

 

struct Input {

    float2 uv_MainTex;

    float2 uv_BumpMap;

};

 

void surf (Input IN, inout SurfaceOutput o) {

    half4 tex = tex2D(_MainTex, IN.uv_MainTex);

    half4 spectex = tex2D(_SpecTex, IN.uv_MainTex);

    _SpecColor = spectex;

    

    o.Albedo = tex.rgb * _Color.rgb;

    o.Gloss = tex.a;

    o.Alpha = tex.a * _Color.a;

    o.Specular = _Shininess;

    o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));

}

ENDCG

}

 

FallBack "Specular"

}

Find and remove these lines…

_BumpMap (“Normalmap”, 2D) = “bump” {}
sampler2D _BumpMap;
float2 uv_BumpMap;
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));

Awesome! Thankyou very much :smile: