Home Technical Talk

Maya - Render normal maps with Mental Ray ?

Okay, so I've run into a situation where I would like to render a baked normal map on my mesh with Mental Ray.

I'm running into some strange problems with the rendering itself.

normalrendermentalbug.jpg

Uploaded with ImageShack.us

For troubleshooting purposes I have tried to completely blank the normal map (i.e. make it the default blue/purple normal color, it's still giving me the same result). Hence I've excluded the normal map as being the issue here.

I have tried multiple shaders with this, regular maya blinns, MISSS shaders (which is what I want in this case), and MIA_MATERIAL_X_PASSES, and all of them are giving me very bad results when rendered with Mental Ray.

I can however use a Blinn for example, and view the normalmap perfectly fine in High Quality/Hardware/Viewport 2.0-mode. Without these seams.


In terms of solutions, I've found different things across the google-web, none that solves my situation really.
For example:
http://www.pixero.com/downloads_mr.html
This node when connected to the material should make it work, but it gives me the same result.

And this:
http://www.headus.com.au/samples/norm-MR/graph2.fig.html
Well that just makes me dizzy...

Any takers on this?

Replies

  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Are the uv's mirrored that you are trying render with a normal map?
  • MM
    Offline / Send Message
    MM polycounter lvl 18
    check 'Maya derivatives' and make sure it is on.
    it is under render settings -> options -> performance

    if the problem still persists then check your mesh normal, make sure they are facing the proper way.
  • MNeMiC
    @Malcom: The UVs are not mirrored and not overlapping.

    @Mm: The Maya derivates settings were off, but when enabled I'm still getting the same result. The mesh is 100% facing the right direction, I've reset the normals and tested with Unlock Normals, Average Normals, Set to Face and Conform.
  • MNeMiC
    Here is another example where you can clearly see the seams across the shoulders. The bottom (textured) one is using mia_material_x_passes, the middle one is a lambert, the top one is a blinn.

    mayanormals.jpg

    Uploaded with ImageShack.us
    I've tried with both tangent space normals and I've rendered out object space normals, all with the same horrible rendering results.

    When I try to render with Maya Software/Maya Hardware/Maya Hardware 2.0 I get no problems at all except that it doesn't look as good as I want it to be with Mental Ray.
    mayarenders.jpg

    Uploaded with ImageShack.us
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    No idea then, you can try turning on Maya derivatives in the mental ray render globals, it's under Options> Performance. Have you tried with a basic Maya shader like lambert?
  • MNeMiC
    @Malcom:
    Yeah I tried that, got the same results.
    In the renders above there are three shaders:
    blinn (top)
    lambert (middle)
    mia_material_x_passes (bottom)

    So yes, I'm getting the same results no matter the shader.

    I've gotten some sort of result with the JS_Normalmapper node from Jan Sandström (http://www.pixero.com/downloads_mr.html), but while this works with Blinn/Lambert/Phong, I can't get it to work with the mia_material_x_passes, which is what I want to use here.
    The reason for this is that the js_normalmapper node connects it's output values with the camera_normal value, which doesn't exist for the mia_material_x_passes.

    Currently I'm using baked displacement-maps as bump-maps, not optimal but gets me some kind of result. I might be forced to bake bump-maps in Maya as I can't find any bump-baking options in Mudbox or xNormal.

    Still though I would prefer to use normal-maps here, or if there is a smoother way of getting proper bump maps generated. Converting with NVidias Normal Map Tools for Photoshop didn't work well either.
  • MM
    Offline / Send Message
    MM polycounter lvl 18
    try connecting the bump node to the standard bump. i tested that shader and it works.
    what file format are you using for the textures ?

    all the shaders work on my end without any third part shader/plugin.
    if u want u can send me a test file and i can check it out.
  • ceebee
    Offline / Send Message
    ceebee polycounter lvl 14
    Why do you need to use mental ray to render your normal maps? I find maya's default renderer to work great as long as you up the sampling and have a good cage.
  • MNeMiC
    @MM - Yeah that's how I've done it. Note that I am getting results from the normal-map, my issue is that I get ugly seams where the seams in the normalmap are. Even if the normal-map is completely single-coloured, I will get a seam where the UVs are.

    Here is a link to an .obj and .tga-file I'm using. Thanks for checking it out and see if you get the same result.

    www.henriklarsson.info/temp/Coat.zip

    @ceebee - I'm not having a problem "baking" the normal-map, but making use of it for a final render. That's what I'm using Mental Ray for.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    MNeMiC, I just tried your scene works fine for me wiht a Blin shader in mental ray. I'm in Maya 2010. Is there a new bug perhaps in the new version of mental ray? I rendered near the armpit where you have the uv seams, normal map looks fine. Can you post a large image of the issue, I can't tell what the problem is on your coat model from those tiny renders.
  • MNeMiC
    @malcom - Right now I seem to be unable to get ANY sort of result when adding normal maps and rendering with Mental Ray, not even any errors.

    But seeing the render of MM and then you saying it works it must be something wrong with my hardware or Maya. I'm using Maya 2012, haven't tried with an older version.

    After I tried some more I came to the conclusion that my mesh must be foobar so I imported the OBJ I uploaded earlier, and now it's all working fine.. So clearly my scene is buggered up with crap and needs a nice reset. I guess that happens when it's version 65 of the scene and after messing around with hair and fur for weeks in it :)

    Thanks so much for the help guys.


    So for anyone getting the same or similar issues as the ones I had here, here is a few steps to check:

    1. Make sure your normals are facing the right direction.
    2. Clean up your Maya-scene.
    3. Export to OBJ or some format that definitely cleans your geometry completely.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Did you do all the standard "Freeze Transforms", "Reset Transforms" and "Unlock Normals" methods before trying the OBJ export/import hack?

    You should always be able to clean up the geometry in the scene without resorting to exporting/importing it.
  • MNeMiC
    @Mop: Yeah I tried all those and all the tricks in the book that normally solves it. I bet that it's gotten issues during modeling from duplicating/merging etc.
  • mdeforge
    Offline / Send Message
    mdeforge polycounter lvl 14
    Maya is always giving my coworker and I some sort of shit. I've fought the normal map issue before as well. Does it work in a new scene? One time, something in my scene was broke and just creating a new scene and importing stuff over again fixed it. I believe I also fixed it one time by nesting a material inside another material (might only be possible through mental ray mats). Also, try turning off the default light and making your own. Shouldn't matter, but I've stopped trying to rationalize solutions with any of Autodesk's products. They have the strangest bugs with the strangest solutions.
  • MNeMiC
    @Stradigos:
    Yes, new scene was also tried. The mesh was the problem for me. It needed to be completely cleansed by exporting it as an OBJ and then returning it to Maya again. Simply exporting it to it's own .ma-file didn't work.

    Please note that my issues have been solved and I don't require further assistance on this problem. Feel free to post other solutions though for future reference of other users getting the same problem and finding this thread.
  • mdeforge
    Offline / Send Message
    mdeforge polycounter lvl 14
    Thanks for posting the solution. I will definitely keep this in mind if things go wonky on me again one day. I usually export/import stuff as an OBJ anyway, but I'll keep a mental note regardless.
  • killkill142002
    try to put the bump map into .png

    I have the same problem before, and now is fixed
  • RedMattis
    Make sure you are not reading a normal map from a .psd image. I believe Mental Ray sometimes reads them as bump maps. .png works fine.
  • kirin122
    I've put jpg format but having the same issue. Sometimes it renders as it should and sometimes it doesn't.
  • dan001
    Offline / Send Message
    dan001 polycounter lvl 6
    I had the same issue and nothing worked until I reset my maya to default, then all the solutions given here and it worked after. Thank you all 
Sign In or Register to comment.