I should start by saying that I don’t know the first thing about building shaders… however, I’d like to know if what I’m about to ask is even possible.
I would like to use a shader that has:
2 decals
a background color that can be changed without altering the tint of either decal
Preferably, it would be a VertexLit shader, because those do seem to render faster. Is this possible? Has it been done before?
I sort of did it yesterday. However, if you only need a solid color as the base, and not a texture, we can do a lot better! None of the “caveats” I listed there apply to this one, except the SeparateSpecular issue. I put “SeparateSpecular On” in the first subshader below, that requires three texture units, so the specular lighting won’t match between really old cards, and modern ones, but I think that’s reasonable. Just get rid of that line if you want an exact match at the expense of probably looking better.
This shader isn’t for a “shadow texture”. This is for an entire object, an object that is colored solid and has two decals on it. Also, it looks like you’re using pixel lighting; this shader can’t handle that. (And neither can the iPhone for that matter.)
Yeah, I’m using a decal as a trick to achieve a contact shadow.
No pixel lights here, but thanks for pointing that out.
Anyway, I found the problem. Sort of. I was using Unity primitives when things weren’t working. Once I switched to mesh-only FBX exports from 3ds Max, everything worked fine.
Interesting, but I’m not going to argue with it.
Thanks again for your help and for the nice shader!