Home Technical Talk

Im an idiot when it comes to mirroring objects.

polycounter lvl 14
Offline / Send Message
ENODMI polycounter lvl 14
EDIT: Erased original question because it was convoluted and basically not describing my problem.

The Problem: Mirrored objects are behaving strangely with applied normal maps. No amount of freezing, reversing normals, changing render stats is getting them to display correctly. Not sure what going on.

Replies

  • ibarter
    Offline / Send Message
    ibarter polycounter lvl 8
    Mesh-> Mirror Geometry
  • ENODMI
    Offline / Send Message
    ENODMI polycounter lvl 14
    Heres an example using Mesh-> Mirror Geometry, which is producing a very similar effect. Also, I dont usually use this because of the way it mirrors and combines the end product. I also miss the ability to place the pivot as the axis to mirror off of.
    whatthe.jpg
    And if I recombine them, the visual issue with the normals goes away? So is this an actual problem, or just a rendering issue within maya that leads me to endlessly flipping normals in an attempt to remedy it?
  • asjo07
    Usually when I mirror an object I use the Mirror Geometry!
    If I can, I place it so I can mirror it directly over the axis but with an offset, so that when I put the mirroring pivot at zero, the object will be seperated (visually - they're still a combined mesh though)..

    Also I find that it works better to select all faces of the mirror and use "Mesh-> extract" to seperate them from the original mesh...

    I'm not sure if this is exactly what your asking, but I have never had any normal problems using this mathod! In regards to why that happens with your method, I really don't know!.. All I could guess is that the mirrored object may loose normal information when you seperate them... maybe.. don't hold me up on it though..! :D

    good luck with it!..
  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth
    It's a simple fix. After mirroring your object, freeze transforms. Still in object mode, do a normals > reverse. Hit control+A for attributes (might have to hit it a couple of times) until you see a tab marked "render stats" and expand it. Uncheck the box marked "opposite". You're done.
  • Bal
    Offline / Send Message
    Bal polycounter lvl 17
    Yeah most of the time to uncheck "Opposite" you have to uncheck "Double Sided" first if it's checked, you can then check it again. I really don't understand why Maya still does this, it's pretty stupid and messes with so many beginners.
  • Warheart
    Offline / Send Message
    Warheart polycounter lvl 17
    The fix described by CheeseOnToast/Bai will also fix meshes mirrored by doing the inverse scale thing.

    I prefer to use inverse scale on an instance duplicate because it means I can preview the mirrored result and have it update while I work on one half.
  • ENODMI
    Offline / Send Message
    ENODMI polycounter lvl 14
    CheeseOnToast, Bal - Yup, thats what I usually, always do...never fails, and then all of sudden nothing is working lately. Im starting to think my issue is hardware related and it just spun me out... Ill test everything again this afternoon and see what happens. Thanks guys
  • ENODMI
    Offline / Send Message
    ENODMI polycounter lvl 14
    So the two pieces of geometry here share the same normal map, and same uv space, just mirrored. The one on the left is the original, the one on the right is new. When combined they both look great, the moment I separate them the one on the right get distorted, as if the green channel is flipped. If I recombine them, poof, it looks perfect again. If I take these into marmoset, as both one object and as two, I dont get any strange rendering, just in maya. This was leading me to believe I was mirroring incorrectly, but I think Maya just isn't displaying it correctly in this exact instance. Anyone else ever experience this? Ive tried just about everything here, and it just seems silly at this point. It's obviously something I can deal with... but I hate its guts at the moment.
    whatthe2.jpg
  • Warheart
    Offline / Send Message
    Warheart polycounter lvl 17
    There is actually something unusual about the way Maya handles UVs which may be causing your problem. Maya uses the UV winding order to determine which way UVs "face". This is not an issue in game engines because they don't calculate it this odd way.

    If this is your issue then it's purely a maya viewport issue regarding the way it calculates tangent space. You can find more info about this issue here: http://autodesk.com/us/maya/2011help/index.html?url=./files/Polygons_nodes_Tangent_Space.htm,topicNumber=d0e239582

    To fix, try going into the attribues for the shape node of the object which has the visual issues. Under the "Tangent Space" rollout change "Coordinate Space" to left handed. In some cases having the "UV winding order" option set to "Detect" is enough to fix this (but not always) so it's worth making sure this is selected too.

    Edit: Funnily enough with this issue if you leave your normals pointing the wrong way (inward toward the center of the gear), assuming you have it rendering double sided, then the normal map should look correct :P. Obviously this is not a fix because when you export to the engine your object will be inside out but it's an interesting test to work out how it works. I wish they'd fix this issue in Maya, it's been like this for ages.

    Edit again: To check which direction Maya thinks your UVs are "facing" turn on "shaded UV display". Blue means it thinks they're facing up, and red, down (opposite to your vertex normals).
  • Mark Dygert
    Max also inverse scales meshes if you use the mirror tool, if you reset xform it will show the true direction of the normals (flipped inside out). Instead use the symmetry modifier. Its 100x better and doesn't do the inverse scaling thing. It also slices and welds the center seam for you, and if placed highest in the stack it will allow you to work on one side of the mesh while actively updating the other side as you work.

    I'd be pissed is a similar system doesn't exist in Maya, raise holy hell if it doesn't you really need it.
  • ENODMI
    Offline / Send Message
    ENODMI polycounter lvl 14
    Yup, that was it! And thats why it looked like a flipped channel to me... you sir have made my day, thanks so much! It now looks perfect in Maya, and exports perfect as well. I think it is strange that they would do this, especially with so much cross development between programs.

    Googling this turns up an old thread here on polycount discussing this same issue, ha, if only I would have known the key words:)
  • Warheart
    Offline / Send Message
    Warheart polycounter lvl 17
    Hehehe yup and I believe I actually helped that time too :P. The problem it produces is actually the same as a flipped channel. The reason for flipping channels is when you move your normal map and mesh from a system that prefers left handed tangent space to one that likes right handed (e.g. max to maya). Yea it seems strange to me too. Linking UV winding order to the tangent space calculation means that mirrored geometry that shares UVs will always be a problem.

    Glad you got it working :)
  • ceebee
    Offline / Send Message
    ceebee polycounter lvl 14
    Bookmarking this thread, I know I am going to have this problem soon D:

    Props to ENODMI for having this problem, and the people who solved it! :P
Sign In or Register to comment.