Jump to content

Normal Map Funkyness with Mirrored Meshes


Recommended Posts

So I am trying to figure out my issue with some of my parts that utilize mirroring of mesh segments to optimize UV texturing space. After adding the normal to the part, segments that are mirrored have some strange shading.

I understand the concept of normal maps with the light casting of red and green from specific directions, and I realize the reason for this issue, but is there some method of somehow "inverting" the mesh so that the shadowing is applied correctly?

dZlPrpH.png

7uGqMXe.png

Link to comment
Share on other sites

first make sure the Normal Map is marked as Normal Map Texture Type in Unity; then try different Tangent setting in the mesh import. https://docs.unity3d.com/Manual/FBXImporter-Model.html

inverting mesh normals has to be done in 3d app before export. your screencap doesn't look like flipped normals, those usually look "transparent"

Edited by nli2work
Link to comment
Share on other sites

The second pic is actually just the diffuse texture,not the normal map used in Unity. I was just showing how the UV island is setup to understand what ares of the object to look at. 

In edit mode I had the meshes flipped after mirroring them so they wouldnt be exported as "transparent", but the question is related to the shading when bumped specular is used.

 

I'll have to post more pics when i get home for clarification on my question.

Link to comment
Share on other sites

Is your UV map normal map baked using the right coordinate system?

 

EDIT: no, this shouldn't be the issue. I have revisited some of my models to check how I set them up, and i have a few mirrored ones, all working well. Also baked out a normal with different coordinates, no success.

Edited by InsaneDruid
Link to comment
Share on other sites

here is a comparison of the part in Unity vs in-game. in Unity it looks perfectly fine, but in KSP it gets funky. I've included the normal map in the album as well.

If you refer back to my fist post showing the UV island, the trouble segment takes up about 7/8th of a cylinder face. I'm thinking an easy solution might be to modify the texture so that it takes up 2 cylinder faces and not use mirroring.

 

 

Edited by cxg2827
typo
Link to comment
Share on other sites

It's due to the mirrored half being inverted in UV space... their W is pointed in the opposite direction as the half you initially unwrapped before mirroring. I would rearrange the UV such that the stacked patches cover a whole repeated section instead of half of one as you have it now. each section would include the whole round attachment cut-out plus half of the separation panels on each side. the black/white markers will be tiled as well if you include them in the main mesh/texture. if they have to asymmetrical I'd split them into separate mesh object that sample main texture. 

something like this, assuming the upper area in the lower right isn't taken up by anything. You would have 4 UV sections stacked together, that covers the cylindrical shape. then the endcaps and other bits 
 plT5dXI.png

Edited by nli2work
Link to comment
Share on other sites

thanks for the suggestion. So I guess there isnt any function available to tag UVs to reverse specific swizzle coordinates or some type of similar trickery? 

Coincidentally I just added some more stuff to that empty space a few minutes ago :P , but I might be able to still rearrange things to fit the unstacked patches like you show.

 

Link to comment
Share on other sites

I believe the triangulation should by default be mirrored using the mirror function in blender, right? Most of my faces are quads, so I'm not sure if this might be something that could be fixed with manually triangulating using the knife tool. (just tested that out and didnt seem to do anything for it)

however, I did stumble on this thread, and it seems to have similar shading issues. though it seems pretty complicated (for my level of blender knowledge) to try to try out.

http://polycount.com/discussion/116922/a-solution-to-normal-maps-with-mirrored-uvs-in-udk

Link to comment
Share on other sites

I am using xNormal for the Normal map, its not being generated from grayscale via unity. Though i did notice that part tools exports the normal as a grayscale normal instead of that purple one, when did this happen?

 

Link to comment
Share on other sites

it should be the grayscale if it's converted to DDS. R is put copied to G and B; G is put into Alpha. this minimizes DTX compression artifacts in Normal maps.

Mirroring texture can work for some texture layouts, but limits your option if you need tiled areas like tire tracks. This is set in the Texture asset's wrap mode.

Edited by nli2work
Link to comment
Share on other sites

  • 2 weeks later...
On 6/20/2016 at 1:16 AM, Van Disaster said:

As an aside, if you're just using the map for grooves and panel edges, might it not be worth just doing them in geometry and ditching the map?

No point in wasting all the polys, plus he makes the UV map much simpler.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...