The separate materials per object are for the case where you have one object with different parts of it using different materials (think a car - one material for the body, another for the glass etc.).
In your case, you probably want a single “layered” material that uses two textures. That would be similar to builtin Decal shader (which uses one UV set for both textures).
the decal shader is most appropriate for the “layered texture” effect i want to produce.
The problem is that it uses only one UV set…
i was trying to re-use textures as much as possible.
so i thought to have one tiling brick all-purpose texture for all walls, and use the transparent “second” material imposed on the wall (with the second uv set)…
well I’d like to know how you can use Maya’s 2 UV sets in Unity… Apart from Konstantinos example the one that comes to mind for me is using lightmaps in the 2nd UV. I see it’s done in the FPS example (I think) so is it handled automatically by Unity or is there a step we need to take to use the 2nd UV set?
To use the 2nd UV set you have to use BindChannels command in the shader. This is what the builtin Lightmapped shader use (since they use 2 UV sets).
I made a Decal shader that uses two UV sets on Unify wiki: Decal 2 UVs. It’s just like builtin Decal, just uses 2nd UV set for the decal texture. Enjoy!
because (as mentioned above) the simple decal uses only the primary uv set.
now with the decal 2 uv im free to map to the second uv set the second texture … which is very convinient for me for the particular project i’m on now.
I just hope it will fall back nicely on older hardware (??)
core dumped! i don’t understand how i can do this. decal is a shader for imposing a second texure on another, no ? how can i use decal as geometry ?
But, this exactly i have done. my first uv set is dedicated to the primary texture ( for ex. brick tiled wall ) and i use the second uv set for secondary over-imposed dirt,etc.
This cannot be done with the standard decal shader, because both textures ( primary and secondary ) use the first uv set. Now, thands to Aras’s Decal 2UV its
possible to map the secondary decal texture using the second uv set! brilliant! thanks again Aras!
How this would be any different from the Decal 2 UV? Its “universal” enough i think… I have not yet played with the lightmap shader so i wouldn’t know.
I still have not tested how deval 2uv reacts on old hardware … i hope it will fall gently
The current version on the wiki should work on GeForce3 and up, Radeon and up. On older hardware it falls back to main texture only. Of course if you’re really concerned you can always write a sub shader for old hardware that does multi pass.
lol…
A decall is a simple plane with an alpha texture placed on ex a wall (for ex. graffiti).
Otee call their shader deacal but game wise its a simple plane…
i have never used the term “decal”, i use more
the term “billboard” for planes… actually
i have quite a few trees in the distant background
with this technique ( forced to rotate and face camera of course ) …
but i guess if you use a plane on top of another surface then it deserves more the term “decal” geometry.