Home Technical Talk

uv s and normal maps

Ruz
polycount lvl 666
Online / Send Message
Ruz polycount lvl 666
I modeled some trousers and normal mapped them and they work fine. But then I copied my trouser normal map in to my main uv layout which includes the rest of the body, then pasted my original trouser normal map in to this layout but rotated it 90 degrees.
My question is , does rotating a normal map affect the way it works as it now look inside out. i tried flipping both red and green channel, but no joy.
Looking at poops uv layout he seems to have stuff rotated around, so how come this is happening.

Replies

  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    yes.

    Rotating it fucks it up.
  • Ruz
    Online / Send Message
    Ruz polycount lvl 666
  • Toomas
    Offline / Send Message
    Toomas polycounter lvl 18
    Why didnt you render them to their correct place from the start?
  • Ruz
    Online / Send Message
    Ruz polycount lvl 666
    well thats because I was just doing tests and our current mahines haven't really got the power to have the whole high mesh in the scene.

    But for example is you want to add detail on a normal map in pshop afterwards with the nvidia plugin, then this will cause problems
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    all you have to do.

    is do the shake and vac and put the freshness back

    or

    load the lowpoly and highpoly objects, put the uvs of the lowpoly in the corect place, and rebuild your normal maps.
  • Bryan Cavett
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    you can get away with rotating your normal maps. All you have to do is either invert the red or green channels or switch the red and green channels with one another... depending on what way you rotated it.

    edit: ofcourse this only works if your just rotating them in 90 degree increments.
  • Ruz
    Online / Send Message
    Ruz polycount lvl 666
    yup, i ended up swapping the red and green channels, got annoyed with it then decided that I could rotate the canvas so the trousers were the right away up, paint the detail, then rotate it back after using the filter.

    Rick - I will be doing it that way, when we get our new more powerful machines.
    But even then i am sure lots of people will want to edit the normal maps afterwards anyway.
    I suppose the easiest thing would be to keep everything the right way up, even if you don't get as good a uv layout
  • rollin
    Offline / Send Message
    rollin polycounter
    funny.. found this a few secounds before reading this .. don´t testet it yet but could be usefull

    klickadiklick

    but i think i keep laying out my uv´s unrotated..
  • Ruz
    Online / Send Message
    Ruz polycount lvl 666
    I think its ok to lay out your uv's roated, but its only when you want to paint overlays in pshop that the problems start
  • sinistergfx
    Offline / Send Message
    sinistergfx polycounter lvl 18
    Ruz: I'm fairly sure (just looked a some things i normal mapped with rotated uvs, and noticed this in the past) that no matter the orientation of the uvs: "up" in the green channel faces towards the top of the image, "down" faces the bottom; and the same with the red channel for left and right.

    This is because normal maps are generated and used relative to the UVs, not relative to the orientation on a model.

    Here's an example (small chunk of a normal map):
    normal_orientation.jpg
    The normal map chunk that this is from is rotated 90 degrees relative to its orientation on the model and it still retains that in the red channel: black = left, white = right and in the green channel (doom3 convention): black = up, white = down.
    I've observed this behavior in arbitrarily rotated UV chunks, and within a single chunk where the orientation doesn't stay consistant (pieces that wrap around a model).

    Summary: As long as you follow your engine's green channel convention, you should have no problem painting extra detail no matter the rotation of your UVs.


    *EDIT: and yes, you can rotate normal map pieces after the fact if you wanted to, as long as your correct the red and green channels for the rotation. This easily done in Photoshop for rotations of 90 degree increments. (Especially with my normal map actions set laugh.gif : url=http://sinistergfx.com/index.php?func=tools).

    I've tried to figure out a way to correct arbitrary rotations in Photoshop, but am so far unsuccessful with a "correct" solution; and I also believe there would be no way to do it without losing fidelity (limitations of the color depth) unless you wrote a custom filter.
  • Ruz
    Online / Send Message
    Ruz polycount lvl 666
    doh my brain hurts. i will study this some more tomorrow
Sign In or Register to comment.