I just got a bit confused myself:
- Are "material id" assigned by sub mesh, uv island, smoothing group or some other mesh property? Can you just pick any polygon and assign them a "material id", but not cause it to become a submesh?
- What does it mean to have "multiple materials on the same model"? Does it imply the model contains "sub mesh" ready for material assignment?
- Each polygon should only match a single material id, right?
Please help.
(I am not a 3DS Max user, I am just thinking of "material id" as a way for modeling software and game engine to assign materials to a model's polygons accordingly)
(I recently encounter a modeling tool that split mesh into sub mesh on export, using material id as group, I am not sure this is a requirement of obj wavefront spec, or just the tool decided to do that to keep 1 material per mesh...)
Replies
Let me try to summarize your answer, do tell if I am mistaken:
- Material ID / Material assignment isn't limited to any "group" of polygons, I can assign them at will, and still keep them as a single mesh, without any sub mesh.
- But each polygon should have only 1 material id.
(I just tried Blender and it seems to work as expected, so for now I am blaming that particular tool that force sub mesh creation based on material id...)
So for the example above the skin would be a single material and the face/body uvs would be on different channels and lerped using a custom mask.
I guess we need to establish what a material is first:
In my mind: 1 material = 1 shader variant + some inputs. You can use as many Polygon / UV / Texture as you like, as long as the hardware/engine support it (eg. number of interpolators).
So to me: multiple materials = multiple shaders + sets of inputs (they can be similar or different). If you have a model with multiple materials, it simply means you render the model with different shaders or inputs.
(polycount post editor is broken on Safari, it inserts links unnecessarily and I have to use HTML mode to fix them...)
The whole reason for my thread was I encountered a strange tool that force mesh to split into sub mesh by material assignment, so I got confused. Other tools like Blender doesn't do this.
And I guess "Material ID" is indeed a term with multiple meaning. I wasn't talking about id map (which is a texture you baked for other texturing), but the material id "slot" assign to polygons (which is used by game engine to actually assign materials, for rendering).
TL;DR: I think I got it, thx all.
The blender export simply assign material to faces.
while the tool I was using, created groups for each material.
The end result: Unity decides to import the model as 2 sub mesh. And I was left thinking: wait, does other tools do this or was it just this tool being weird...
(the tool was ProBuilder by the way.)
If your modeling app starts with uv1, then it's uv1 and uv2. Same thing tho.
But there's nothing stopping a game dev team from adopting any uv channels they want. And any material IDs they want. Except if the file format or engine has specific limits.
There are no hard rules about which material uses which UV. It's up to the team to decide what they want to enforce. Then implement it in their shaders.