I was talking to Kaelis in the IRC channel, who explained an interesting idea for a shader. I’m not really sure what it’s for, but it’s basically a simple diffuse vertex lit shader that uses a second texture to either brighten or darken the results of the lighting equation. By default, the brightness map is 50% grey and doesn’t do anything.
It’s kind of a strange shader and I can’t think what I’d use it for, but here goes:
Shader "Brightness Map" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_BrightTex ("Brightness (RGB)", 2D) = "gray" {}
}
SubShader {
Pass {
Material {
Diffuse [_Color]
Ambient [_Color]
}
Lighting On
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
//signed add brightness texture to lighting result
SetTexture [_BrightTex] {
Combine previous +- texture
}
}
}
FallBack "Diffuse"
}