Home Technical Talk

Normal Maps and the CryENGINE

polycounter lvl 13
Offline / Send Message
Wesley polycounter lvl 13
[I've posted this on the Crydev site, but I'm pretty desperate to figure this out as it's really starting to hold up my environment now.]

After watching the free video from Simon Fuchs on Eat3D, I've been baking normal maps using xNormal with the X+ Y- Z+ settings. But these normal maps actually appear incorrect in the free SDK, and maps baked with X+ Y+ Z+ appear correct. Is this a difference between the Crysis 2 SDK and the free SDK, or something that was changed in an update?

The normal maps are being saved from xNormal as .tga, and then opened in Photoshop, the alpha channel removed and saved using the Crytif exporter, as a normal map high-quality.

I've done a super simply test using these meshes:

normalProblemMeshes.jpg

I've baked using xNormal with a +Y and -Y.

Here's the result in the engine:

normalProblemResult.jpg

On the left is the model with the normal map baked with the correct -Y. On the right is the incorrect +Y.

But the one on the right looks correct; the top of the square is highlighted, and the bottom is shaded. The "correct" model on the left instead looks indented.

I've uploaded all the files as well in case anyone would like to see if they get the same result, might help me narrow down what I've done wrong.

The Max (2010) file: http://wesleymackinder.com/publicImages/garageRedux/normalProblem/normalTest.max

The high poly mesh saved as SBM for xNormal: http://wesleymackinder.com/publicImages/garageRedux/normalProblem/high.SBM

The low: http://wesleymackinder.com/publicImages/garageRedux/normalProblem/low.SBM

The normal map saved using Crytif, -Y: http://wesleymackinder.com/publicImages/garageRedux/normalProblem/normalProblem-Y_normals.tif

+Y: http://wesleymackinder.com/publicImages/garageRedux/normalProblem/normalProblem%2BY_normals.tif

Also I've checked the channel information for the -Y and the channels are correct and it is indeed -Y.

I just tested the object in Marmoset render, with the -Y normal, checked invert Y on Marmoset (therefore reading it how CryEngine reads normals maps?) and it looks correct.

marmoset.jpg

So clearly something is going wrong when it's in the engine...?

Replies

  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Someone suggested using a solid to see if it was my model. I've applied the -Y to a solid and it appears incorrectly, sunken in rather than popping out. I also have a weird glitching problem with my normals flipping when moving around, this appears to only be with the -Y map.

    cryEngineFlipping.gif

    I'm going to do a fresh "install" on another PC and see if it's in any way related to my copy or PC.
  • [HP]
    Options
    Offline / Send Message
    [HP] polycounter lvl 13
    Is it possible to provide non dropbox links? Dropbox is blocked here at work.
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Sorry about that, I sometimes forget about Dropbox being blocked most places. I've updated the posts.
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    i've found the default lighting definitely isn't enough to make the maps pop either.. but yeah, that switching is way odd. mips gone crazy?
  • Xendance
    Options
    Offline / Send Message
    Xendance polycounter lvl 7
    Could it be because of the bounce lighting from the ground? Or other ambient lighting.
  • Olli.
    Options
    Offline / Send Message
    Olli. polycounter lvl 8
    ive always found that cryengine requires flipping of some channels for the normals to work.. thats just how it is and ive dealt with it.

    The flipping normals glitch looks weird though.. never had that with static textures.. looks like a badly coded swf to me.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Did you try with a fresh new scene? It could be the mips are being stored for performance and it's only reading the 'new' high rez?

    Also, I thought that the SDK came with it's own Normal Map baking tool for XSI and Max as a plugin, wouldn't that be better since it's synched?
  • Olli.
    Options
    Offline / Send Message
    Olli. polycounter lvl 8
    polybump has always come with cryengine, but ive never used it or needed it.

    it is plausible that the problem might be a mip map problem, if the engine is failing to update the mipmaps, and is only udpating the full size image.
  • e-freak
    Options
    Offline / Send Message
    try disabling global illumination before you judge normal maps! (either in roll up bar environment settings or in console e_GI 0). or create a black box (vis area with some solids forming a closed room in it and use only standard lights. ;)
  • Wesley
    Options
    Offline / Send Message
    Wesley polycounter lvl 13
    Thanks for all the help guys. Xendance and e-freak hit the nail on the head, it was essentially the light bouncing from the default terrain material. Heh... There was also a few other things going a bit pear shaped, but it's all looking better now. :poly142:
Sign In or Register to comment.