I’ve got a spaceship model that I created that has three levels of armor (so that’s a diffuse map, a normals map, and a specular map per armor level).
In addition, I want to have four team color schemes for the spaceships, so that’s one diffuse map per team.
To cover all combinations, I think I have to create a total of 12 diffuse maps (4 team colors * 3 armor levels), 3 normals maps, and 3 specular maps per ship.
That seems like a lot of textures and I’m wondering if anyone could recommend a shortcut of some sort to save time and texture memory.
Should I break out parts of the UV for faces that carries team colors and treat it as a different material (that would add a Draw call to affect performance if I understand it correctly?)
Or is there some way to modify the hue/color of a certain part of a mesh within Unity?
Or is there a way to do multitextures or paste a decal on a mesh?
Curious to find out how you would solve it =)
(I’ve attached a picture of the model with armor levels and team colors. It’s a render and the mesh is about 1K polys and texture size is 1024x1024. I will use “top down view” in the game so I will probably optimize the mesh and drop the texture size to 256x256.)
Thanks for the reference woodn. Initially it looked like the perfect solution but then I realized that Unity uses the alpha channel for specular reflections so I won’t be able to put the coloring mask there =(
There is no other way for Unity to add bumped specular rather than carrying the specular map as alpha in the diffuse map I suppose?
yes, it would require a custom shader. either one that uses an additional mask texture or the objects vertex color as mask.
as it happens, i did some of those a while ago in strumpy shader editor. i have no clue how their performance is and they most likely won’t run on mobile devices, but i attached them to this post.
woodn, thank you very much for that shader, it works!
I did some performance comparisons:
(128 ships on screen, 145.9k tris, 294.8k verts, 384 draw calls, 1024x1024 textures)
diffuse 520-547 FPS
diffuse spec bump 470-530 FPS
diffuse tint spec bump 460-520 FPS
On my machine (which is quite powerful) there is a minimal loss of performance using the tint shader so I will probably go this route. I’ll do some performance testing on other machines too, but it definitely looks promising.
I’m aiming for the PC platform with this game so I’m not too bothered if the shader doesn’t work on handhelds… at this stage.
Sorry to bump an old thread, but I’m currently looking for something similar that would work on mobile devices. Preferably just a shader similar to the built-in mobile/VertexLit but with an adjustable color and a mask for it.