- Home /
Missing second normalmap effect in lightmap
I create a custom shader which uses 2 normalmaps by surface shader method. Then I bake them in Dual-lightmap mode with deferered render setting. Only first normalmap (_BumpMap) can be baked in lightmap. Second normalmap name is "_BumpMap1", it can not be baked in lightmap. Anyone has good idea?
Please help, thanks
This is my custom shader
Shader "Custom/Blend2Normal" {
Properties {
_Color ("CCd",Color)=(1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_BumpMap ("N1",2D)="bump"{}
_BumpMap1 ("N2",2D)="bump" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf BlinnPhong dualforward
sampler2D _MainTex;
sampler2D _BumpMap1;
sampler2D _BumpMap;
fixed4 _Color;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
fixed3 n1 = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));
fixed3 n2 = UnpackNormal(tex2D(_BumpMap1, IN.uv_MainTex));
o.Normal = normalize(n1+n2);
o.Albedo = c.rgb*_Color.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Comment
Your answer
Follow this Question
Related Questions
Using dualforward in a shader for specularity and lightmaps 0 Answers
Emissive shaders not working 0 Answers
Directional lightmap in custom shader. 1 Answer
Shader and light maps 0 Answers
Loaded Lightmaps Clearing On Play 1 Answer