how does the mesh filter chose which material to use in a multiple material 3d model?
I am working on a tile-based project and I need to switch the mesh filter of tile at runtime. On this tile object, I have two materials, one top material, and base material. But when I change the mesh filter of a tile(to have a different look to the tile), it swaps the two materials of the 3d model. Some types of tiles that I swap are fine and have the correct material assigned to the specific faces, but most of the materials are inverted.The Problem
So I tried to see if this has to do with the order of the materials in my 3d software blender, but the order did not do anything to fix the problem. I tried to invert the two materials in blender, but this also did nothing. Only if I assign a different face to a material I will see a difference in the model. And if I try to do this face by face to make the material not inverted, it will eventually switch back to the incorrect material placement. Overall, I just keep getting inconsistent errors and I don't know what to do to debug this. My guess is that unity makes the order differs depending on the number of faces that a particular material has(and that has to do with the mesh filter). Or I am using blender incorrectly and have some sort of bug with the model. here's some screenshot to better visualize my problem : ![alt text][1] ![alt text][2]Things that I tried
If anyone has any insight on how I can fix this problem it would be most appreciated. I would like to know more about mesh filters if possible, the unity documentation doesn't provide the information that I need to solve this. it would be nice to know how does the mesh filter chose the material if they are multiple ones for example.conclusion
[1]: /storage/temp/187133-screenshot-8.png [2]: /storage/temp/187135-screenshot-4.png
screenshot-4.png
(141.2 kB)
screenshot-8.png
(505.1 kB)
Comment
Best Answer
Answer by Flixel · Apr 05 at 03:47 AM
ok, it's with the indices of the vertex that unity is used to determine which material goes first in the mesh rendered. in blender there's a button that rearrange the indices so that it will always show the desired material first
Your answer
Follow this Question
Related Questions
Texture or Illumination bug, anyone knows why? 0 Answers
Unity 5 problem with Object Material 0 Answers
hair does not show 0 Answers
importing onto unity from blender problems 0 Answers
Mesh doesnt have normals, please create some for GI 0 Answers