Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Maya 2011 Mental Ray render pass compositing

  1. #1
    Join Date
    Feb 2011
    Posts
    20

    Default Maya 2011 Mental Ray render pass compositing

    Hi there,

    First post hoping, hoping for some mental images direction!

    I'm rendering out linear passes in mental ray, maya 2011, as 16bit half float exrs for compositing in nuke.

    When using the pass presets beauty, diffuse, specular etc. and the compositing equations from the white paper;

    Beauty = Diffuse + specular + reflection etc

    I have no problem in recreating the beauty pass in nuke.

    However, if I break my passes down one step further, rendering out diffuse material colour and direct irradiance and I try to recreate a the diffuse pass with the equation;

    Diffuse = diffuse material colour * direct irradiance

    I get an "anti aliasing/filtering" issue in my recreated diffuse pass where objects are in front/behind one another. This is not present in the normal diffuse pass.

    After further experimentation I noticed that if I turn off "filtering" on all my passes they composite correctly to recreate the diffuse pass. However an unfiltered result isn't useable.

    I have attached some images of a simple test scene that I set up, including a "difference" image to show the effect as it is quite subtle in this example! However for what I am doing it is quite important.

    Is there a way that I should approach my render passes in maya/mental ray that would eliminate this issue??

    Any guidance would be appreciated.

    Thanks for your time

    James
    Attached Images Attached Images

  2. #2
    Join Date
    Oct 2007
    Location
    New York
    Posts
    366

    Default

    yeah any multiplication on your anti aliased renders will cause this type of artifact. That is why multiplication should be avoided in the composite.

    As you say you have rendered a non filtered version. This is common workaround. What you need to do though is render it at double/treble or even quadruple your output resolution. You can then do the comp and then scale down the image back to the desired output res.

    Give it a go.

    Best,

    Rich

  3. #3
    Join Date
    Feb 2011
    Posts
    20

    Default

    Thanks for the reply Rich,

    Reconstructing the diffuse/specular/reflection passes from raw and levels relies heavily on multiplication of passes, are you saying that the resulting artifacts are unavoidable no matter how they are rendered out/composited?

    Rendering at quadruple resolution would be a serious render time and therefore cost....

    Thanks

    James

  4. #4
    Join Date
    Oct 2007
    Location
    New York
    Posts
    366

    Default

    Hey James,

    When you are dealing renders where you have overlapping objects with noticeable colour/contrast/lighting differences and try and split out these raw passes meaning multiplication is necessary to comp them back together, then yes these fringing artifacts will be evident if the images have already been anti-aliased.

    If you have a simple single object or overlapping objects of little colour/contrast difference then these artifacts might not be so noticeable so you could get away with it.

    By rendering your passes without anti aliasing will mean you can avoid these artifacts because your values from your objects edges will not be filtered together. They are either a value from one object or the other.

    Effectively when anti-aliasing, more rays are being shot into the scene, so by not anti aliasing and making the image bigger in theory you will be shooting a similar number of rays so render time should be pretty similar. Memory consumption might be more as your res is bigger but render will not be that far off.

    Rich
    Last edited by rlevene; February 25th, 2011 at 10:51.

  5. #5
    Join Date
    Dec 2005
    Location
    Hollywood
    Posts
    1,980

    Default

    Probably simpler: premultiply by the alpha after the color mult.

    We do that for objects we composite all the time and works fine. We almost always have a diffuse raw/direct irradiance pass that gets multiplied against the surface color. And we render normally.
    "Don't let anyone drive you crazy when you know it's in walking distance."

    "I occasionally confuse my desire for revenge with my desire for justice. Oops." -me

    http://elementalray.wordpress.com/

  6. #6
    Join Date
    Dec 2005
    Location
    Hollywood
    Posts
    1,980

    Default

    Quote Originally Posted by rlevene
    What you need to do though is render it at double/treble or even quadruple your output resolution.
    That makes my right eye twitch uncontrollably. Stop scaring David.

    Example:

    You should still be able to take the beauty and comped and layer them with difference and see none in Photoshop. The "wrong" version is before I applied the correction in Nuke from multiplying. So you know they were rendered together against a background.

    So please continue to render with anti-aliasing at the size of your choosing.
    Attached Images Attached Images
    Last edited by Remydrh; February 26th, 2011 at 10:49.
    "Don't let anyone drive you crazy when you know it's in walking distance."

    "I occasionally confuse my desire for revenge with my desire for justice. Oops." -me

    http://elementalray.wordpress.com/

  7. #7
    Join Date
    Oct 2007
    Location
    New York
    Posts
    366

    Default

    Hey David,

    Apologies for scarring you and causing that strange twitching sensation

    This premult by alpha would only fix the outer edges of your objects where your objects sample the background, and not the edges where two objects overlap, no?

    Attached are a diffuseMaterialColor, directIrradiance and alpha.

    So you are saying if I multiply the two together and then do a premult by the alpha then that solves the issue? Because it doesn't for me.

    Maybe if I rendered each object out individually and so each object had its own alpha.

    I have attached my scene, passes and nuke script.

    Cheers,

    Rich
    Attached Images Attached Images
    Attached Files Attached Files

  8. #8
    Join Date
    Dec 2005
    Location
    Hollywood
    Posts
    1,980

    Default

    I have an older Nuke than you.

    But I see you are using multiply and plus.

    Try copy for multiply and over for add. Copy preserves the luminance and over tends to work better than plus. If you don't color correct after that then you can possibly get away without using the premult beauty option. I attached that example of that scenario. But if you do, there's the beauty alpha option.

    I'm not a comper though so I'm not so elegant with these things.
    Attached Files Attached Files
    "Don't let anyone drive you crazy when you know it's in walking distance."

    "I occasionally confuse my desire for revenge with my desire for justice. Oops." -me

    http://elementalray.wordpress.com/

  9. #9
    Join Date
    Oct 2007
    Location
    New York
    Posts
    366

    Default

    Hey David,

    For some reason I am just seeing black in all passes other than the main rgb pass.

    If i put the viewer onto any of the shuffle nodes you have coming out of the main image, it is black?

    Am I missing anything?

    I am very curious to see how those operations you are using work instead of multiply and plus. I cannot get my head around using an over instead of plus?? An over will use the alpha of your foreground image to stamp a whole out of your background image and then your foreground image gets added on. FG.rgb + BK.rgb * (1-FG.a) Seems it would be the same as a plus if you had nothing in your alpha.

    Cheers,

    Rich
    Attached Images Attached Images

  10. #10
    Join Date
    Dec 2005
    Location
    Hollywood
    Posts
    1,980

    Default

    Because I sent you the wrong file. Wondered why it was so small. . . . Attaching the real one now.

    How are you rendering your layers? Your framebuffer pass should not only be linear (ignores a lens shader applying color changes) but it shouldn't have an alpha in it either. That happens in your beauty pass. You can quickly test this by opening imf_disp and looking at the layers.

    Maya passes tend to ignore the alpha connection from the shader output. Generally that's not a concern for comping just the color, you copy your beauty alpha for operations that require it. So the over operation works fine. I have problems using multiply instead of copy as well. Multiply can occasionally over darken it compared to the beauty.

    The suggestions I'm making are coming from my compositors. I'm no that smart fer compering. But this way I can learn at the same time!
    Attached Files Attached Files
    Last edited by Remydrh; February 27th, 2011 at 11:02.
    "Don't let anyone drive you crazy when you know it's in walking distance."

    "I occasionally confuse my desire for revenge with my desire for justice. Oops." -me

    http://elementalray.wordpress.com/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •