Download

What's best? Importing half a mesh and mirror in the engine or not?

Hi fellas,

Short: what’s best, importing half mesh and mirroring it in the engine… or build the whole mesh and import it as a whole?

Longer: I’m in the process of reconstructing a small medieval city based on many excavations from archaeologists. I’m trying to be as correct as possible, which means it will be pretty heavy in the end.
Some of the buildings can be mirrored, thus I was wondering if the engine would save memory if I import them as half meshes.

Thanks ahead, fellow enthusiasts!

Interesting question, I’ve never heard about mirroring things in engine. It might be more “expensive” to perform the mirror than it would be just to have the full static mesh.

You could probably get a pretty high number of polygons on screen, and if you start running into memory issues look into creating different LODs(Level of details) for buildings. (Assassins Creed games utilize this technique)

HI YannickDesmet,

I’ve not heard of anyone wanting to do this exactly. It’s completely possible. Whether or not the lightmaps come out looking OK with this type of implementation is another thing. You may want to consider building assets modularly and reusing them throughout the level. Which I understand you are doing to some degree from what you’ve written. (You can see how our modular assets are set up pretty well in the Mobile Temple example as that was build using modular assets)

As far as things being “heavy” on the engine, Vertex/poly count is not going to be as bad as you would think (so long as the meshes aren’t highpoly meshes pushing hundreds of thousands of verts!) The biggest thing you will need to focus on is, like Alexotronic pointed out, LODs, culling volumes, texture sizes, and being careful how many dynamic lights you use in a scene. A lot of what you’re trying to do would just require optimization to manage how much the engine is handling at a given time. Instancing will help with draw calls but optimization is key to getting a good frame rate and running smoothly!

If you have any other questions feel free to ask!
Also when you get going post some of your progress in the WIP if you like.

Thank you!

Tim

Yeah, you can do that. I’ve done it with several things, general objects work just fine when you mirror them, the main issue that can happen is with normals. If you have something curved that you’re trying to mirror next to each other then there can be a seam in the middle.
If you aren’t using normal maps you can fix this by creating explicit normals in your 3D modeling program—normally when you split a round object in half the normals on the edges will readjust and you’ll get a visible seam, if you change the normals to be explicit they will stay the same no matter what. But it can be complicated to set up–in 3ds Max, take your whole object, apply a Normal modifier and then select all the normals and click Make Explicit (that will change them to green). Then to split it, you have to delete the half you don’t want.
After that though, if you change the model it will screw up the normals, so only do that when you’re finished with the model and ready to export.
For objects that use normal maps, it doesn’t work because the normals get flipped so you would get a seam. In some cases if you don’t want the mirrors next to each other it doesn’t matter though.

Thanks for the quick responses, Alexotronic and Tim!

I’m doing my very best to have the models as low poly as possible. At the moment I’m constructing a tower with 4 exact same walls. I was thinking of importing only 1 wall and mirroring it 4 times in the engine.
Of course only if this would be less expensive on memory.

At the moment I’m only at the first block level, but I’ll be having a lot of trees and bushes near the end.
I’m aware that textures and lights are most expensive so I will focus on optimizing those when the time comes.

Tim, ‘culling volumes’, does that mean they aren’t rendered when they are not visible?
The character will most likely not be able to climb and only see the buildings from the street it’s in. Will the meshes from other streets be culled automatically or only when the character physically points the other direction?

Thanks again!

Oh, darthviper107, thanks for the tip!

I’m not yet familiar with normals yet (I know what they do, but I haven’t made them yet)
As far as I’m concerned, I would only do it on hard corners, it’s a medieval city/village, so I don’t expect lot’s of curved buildings.

In search I came across this, and for other people who browser here:
If you put (in editor) the scale in negative, it will “mirror” the mesh on whatever axis is negative. I believe, as to if it would work for x,y,z case, I don’t know.