Hello all,
This is my first question here ever. Sorry for the long post!
The situation: I have a room model that can have up to 4 possible doors (one for each side). When there is no door at the side, I’d like for the model to look closed there. Using my modelling program of choice (blender), I made an extra model which is a wall and closes exactly the gap as it should. This model uses a different area of the same UV texture.
As you might have already guessed, lighting there does look odd, in a way that makes it obvious the extra wall is a different object. I was expecting that. Merging the shapes improves it somehow, but contrary to my expectations you can still distinguish it even after recalculating the normals. I have even tried using a model of the base room without the faces that would overlap, with the same results.
Now, if I combine the models via Blender and remove the double vertices, the model looks perfect. Since the room is symmetric in 4 sides, assuming there are no rooms with no doors (because that’d make no sense) and assuming I can rotate but not mirror a mesh, there are really only 6 possible combinations. This isn’t much at all; only +4 ~10-20kb models. The programming beast within me, however, growls at this solution, because there could be a time in the future when this solution would not be enough, since I plan to have different environments in the future.
So, what causes this issue, and how could I fix it? Merging the vertices sounds like a good idea, but won’t that screw up the UVs? I assume that when blender exports, it separates a vertex into many if the UV coordinates are different for each face they belong to. But if that’s true, then the imported room should be technically identical to the generated one, as it contains exactly the same vertices at exactly the same positions. One possible explanation is that there’s some kind of very minor float precision problem which somehow causes the common vertices of the two combined meshes to not actually be identical.
Finally, in-editor solutions (if any) will not do because I’m using my own custom level editor and so everything is created during runtime in the beginning of each level.
~ Zoodinger