Hello every one.
I'm trying to realize a diffuse bump blending (whith shader).
For the moment I wrote this :
Shader "Diffuse Bump Blending" {
Properties {
_Blend ("Blend", Range(0, 1)) = 0.5
_MainTex ("Texture", 2D) = ""
_Texture2 ("Texture 2", 2D) = ""
_BumpMap ("Bumpmap", 2D) = "bump" {}
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float2 uv_MainTex;
float2 uv_BumpMap;
};
sampler2D _MainTex;
sampler2D _BumpMap;
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
}
ENDCG
}
Fallback "Diffuse"
}
I don't know how to add the blending effect to this shader. I have this code for the blending :
Shader "Blend 2 Textures" {
Properties {
_Blend ("Blend", Range(0, 1)) = 0.5
_MainTex ("Texture 1", 2D) = ""
_Texture2 ("Texture 2", 2D) = ""
}
SubShader {
Pass {
SetTexture[_MainTex]
SetTexture[_Texture2] {
ConstantColor (0,0,0, [_Blend])
Combine texture Lerp(constant) previous
}
}
}
}
Any idea ?
Thanks !