I have a very strange problem. I’m not sure if it’s a bug or just an error on my part.
I have created a very simple shader that combines color, lightmap and texture.
The problem is, when I use it, it looks well on the editor, but on the application the texture dissapears. Also, if I save and reload Unity, the texture also dissapears.
But this is the most weird part: if I use it in a multiple material object, and at least one of the materials doesn’t use this shader, then it works. ¿?
Maybe it will look clearer with an example:
You have both sets to uv’s pointing to the same texturing stage?
You also might want to swap both Bind’s around because at the moment you said you wanted to use uv2 for the lightmap but you’re using both uv1 and uv2 for the lightmap stage and nothing for the main texture?
It worked like a charm. Now that the code is correct, the problem is gone.
Please excuse me, I am a total newbie at programming shaders. I had read the shaderlab reference of course, but I found it confusing that it uses the same name texcoord for both the mesh coordinates and the pass coordinates. Now it’s all clear to me.