I am trying to get a light baked texture to work with a detail texture overlay – no such animal in the standard assets, but I found something that seems perfect on the Wiki :
Shader "Baked Lighting/Detail Texture" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Detail ("Detail (RGB)", 2D) = "gray" {}
}
Category {
// Bind per-vertex color for use
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
// Two texture cards: main and detail texture
SubShader {
Pass {
SetTexture [_MainTex] { Combine texture * primary }
SetTexture [_Detail] { Combine previous * texture DOUBLE, previous }
}
}
// Single texture cards: only main texture
SubShader {
Pass {
SetTexture [_MainTex] { Combine texture * primary }
}
}
}
}
Except it doesn’t work when I try to build a shader using this code. The shader appears as “Default” in the shader list and no params are exposed. Hmm. So I tried to build some of the other shaders on the Wiki, some work, some, same problem. Is this because I only have an indie license? Or am I doing something wrong?
I doubled checked that no funky characters were getting into pasted source, and that I used the correct extension, etc. Beyond that I’m stumped!
Tia,
– Bo