Home Technical Talk

1px border in (normal) maps from xnormal

walkonsky
polycounter lvl 11
Offline / Send Message
walkonsky polycounter lvl 11
hi there,
i already asked in the xnormal master thread but as no quick answer could be found i am opening this thread to leave the master thread to more general questions...

i have the following problem in all my recent bakes (every one since I discovered it):
every map (AO, normal and several others) rendered out in xnormal has a strange one pixel border on the top and right side like this:
uswqJ.jpg
(what you see here is the top right corner of my normal map in high magnification on a grey background.)

the map was generated with two highpoly models and one single plane as the lowpoly hovering above the highpoly meshes with its normal pointing upwards.
the top and right line of pixels are apparently not used. they become 127,127,127 in normal maps or background color in AO bakes. the alpha channel of the normal map is black on the pixels of the border.
im using xnormal 3.17.15.2000 x64 version.

scaling the low poly mesh does not influence the error.
inverting the normal of the lowpoly so that it points at and not away from the highpoly did not solve the problem.
the uvs of my lowpoly plane use the whole -1 to 1 area, so the whole canvas should be used.

does anyone know why this happens and how i can make xnormal use the whole map?

Replies

  • Stromberg90
    Options
    Offline / Send Message
    Stromberg90 polycounter lvl 11
    Could you upload the plane you use as a lowpoly model?
  • walkonsky
    Options
    Offline / Send Message
    walkonsky polycounter lvl 11
    yeah, sure. thx for the help!
    i've uploaded both the lowpoly and the highpoly mesh to my dropbox. here are the links:
    https://www.dropbox.com/s/f192t0fww3yp8rq/pattern_hp.obj
    https://www.dropbox.com/s/lwofmihp7ez37vo/pattern_lp.obj

    (unlike what i said in my first post, i don't have two highpoly meshes, but it should not make a difference in this case..., just to clarify)
  • Snader
    Options
    Offline / Send Message
    Snader polycounter lvl 15
    Did you check the cage? If you've used just a simple push modifier then the cage is bigger than the high and lowpolies, and causes rays to undershoot the highpoly.
    Like this (sideview):

    cageoffset.jpg
    blue are high and lowpoly, green is the cage, and yellow are the rays that go under the highpoly and are thus considered flat 128,128,256 pixels.
  • walkonsky
    Options
    Offline / Send Message
    walkonsky polycounter lvl 11
    until now, i haven't used a cage assuming that it was not needed for a single plane as a lowpoly mesh(the vertex normals of the lp mesh are pointing straight up, btw, so the rays should have been cast correctly anyway)
    i generated a cage now, however, and tried again, but the result was the same as before.
    the cage is another plane hovering above both lowpoly and highpoly mesh.
    the resulting map is exactly the same as before. i baked a 256x256 map without edge padding and without antialiasing
    i have uploaded the cage file as well. would some one be so nice to try baking a normal map with these files?
    https://www.dropbox.com/s/kbs0eo2jfszigl0/pattern_lp_cage.obj
  • Stromberg90
    Options
    Offline / Send Message
    Stromberg90 polycounter lvl 11
    Yeah, the cage should not be the problem since it does not expand when using a singe plane.
    I have no idea what the problem might be, I could try baking out the files but not until I get home, which is quite a few hours away.
  • walkonsky
    Options
    Offline / Send Message
    walkonsky polycounter lvl 11
    still no solution, but i tried one more thing. baking with the 32bit version of xnormal. but that didn't solve the problem either. anyone with an idea what is going on here?
    could anyone try to bake a normal map with the models i have linked to see if the models might be the problem?
  • tyl3r
    Options
    Offline / Send Message
    Just tried baking this for you.
    Brought into Max, lowered low poly plane below highpoly mesh.
    Re-UV'ed the plane to make sure it was perfectly snapped to grid.
    Added Cage to low.
    Exported as .SBM for both Low and High. Had problems with the normals exporting correctly so I set hi-poly to 'harden normals'

    0 Bleed. Baked at 512, and seemed to work for me.
    oNnXS.jpg
  • walkonsky
    Options
    Offline / Send Message
    walkonsky polycounter lvl 11
    thx very much! could you (or someone else) try to bake with my uvs and xnormal maybe? i work with blender and i would like to rule out that my uvs are the issue here...
    i just tried to unwrap the lowpoly plane again and use the "snap to pixel" function for uv-vertices (which i hadn't used before). that, however, didn't solve the problem either.
  • tyl3r
    Options
    Offline / Send Message
    Tried it again, exact same method as last time except left the UV's as is, and the bake still turned out perfect.

    I am using v3.17.5.41463
  • walkonsky
    Options
    Offline / Send Message
    walkonsky polycounter lvl 11
    thank you for trying again.
    this whole thing is very weird. i extended the uvs of my lowpoly just a little bit beyond the -1,1 space on those sides that had the 1px border. with those modified uvs, the border disappeared. interestingly, i did not even get errors on the opposite sides of the -1,1 space, where the uvs are effectively overlapping.
    i suspect, there is something wrong with blenders uvs and/or exporting of obj, that is automatically fixed, when you import the meshes in another app, like you, tyl3r, did.
    maybe i find something related over at blenderartists.org...
    thx for the help!
Sign In or Register to comment.