Feedback

What's your question?

By: [ Editor ] Asked

IBL using Mental Ray in Maya

Hello,

the place where I am working have got a bunch of Mental Ray licenses they want us to use.

So I am trying to figure out what the best way is to do fast Image based Lighting using Maya and mental ray, you know, the HDR ball.

There is this node called mentalRayIbl but the problem with that is that it combines environment reflection and IBL diffuse lighting, so I can't set the values separately. And it doesn't seem like I can have two nodes doing one task each?

How do you do it?

cheers fred

Add comment viewed 3,338 times Latest activity 11 months ago

or Cancel

1 answer

  • 1

benf

Hi Fred,

I use a set of shaders for mentalRay called Shaders_P

Within this set of shaders is a very cool node called *'p ray_type'*. It allows you to pipe in a separate HDR image into the Final Gather and a different texture into the Environment or Reflection, and control them independently (plus more!). The node itself gets connected to the mentalRayIbl node via its .color.

Another option, which is an 'out-of-the-box' solution that definitely works for Maya 2008 ext.2 (which is what I'm still working on) is where you alter a mentalRay start-up script to unlock a number of 'unsupported' production shaders. One of these is called a 'raySwitch'. Basically, it has the same functionality of the aforementioned *'p ray_type'*. Here's how you do it:

  • Open 'mentalrayCustomNodeClass.mel' (in ../scripts/others) and replace this chunk of code...

    // Internal MentalRay Nodes. Not meant to be used with Maya.
    
    
    
    if ($nodeType == "misss_physical_phen"  ||
        $nodeType == "mip_rayswitch" ||
        $nodeType == "mip_rayswitch_advanced" ||
        $nodeType == "mip_rayswitch_environment" ||
        $nodeType == "mip_card_opacity" ||
        $nodeType == "mip_motionblur" ||
        $nodeType == "mip_matteshadow" ||
        $nodeType == "mip_cameramap" ||
        $nodeType == "mip_mirrorball" ||
        $nodeType == "mip_grayball" ||
        $nodeType == "mip_gamma_gain" ||
        $nodeType == "mip_render_subset" ||
        $nodeType == "mip_matteshadow_mtl" ||
            $nodeType == "surfaceSampler" ||
            $nodeType == "mip_motion_vector")
    
    
            return "rendernode/mentalray/internal";
    
    
    return "";
    

    }

...with this...

// Internal MentalRay Nodes. Not meant to be used with Maya.
// So? Should poor Maya users use 3dsmax? C'mon... ;)

 if ($nodeType == "misss_physical_phen"  ||         
     $nodeType == "mip_card_opacity" ||             
     $nodeType == "mip_matteshadow" ||         
     $nodeType == "mip_matteshadow_mtl" ||
     $nodeType == "surfaceSampler")
return "rendernode/mentalray/material";
return "";}



 if ($nodeType == "mip_rayswitch" ||             
     $nodeType == "mip_rayswitch_advanced" ||    
     $nodeType == "mip_cameramap" ||    
     $nodeType == "mip_mirrorball" ||   
     $nodeType == "mip_grayball")
return "rendernode/mentalray/texture";
return "";}


 if ($nodeType == "mip_rayswitch_environment")
return "rendernode/mentalray/environment";
return "";}



 if ($nodeType == "mip_motionblur" ||
     $nodeType == "mip_motion_vector")
return "rendernode/mentalray/output";
return "";}

 if ($nodeType == "mip_gamma_gain" ||
     $nodeType == "mip_render_subset")
return "rendernode/mentalray/lens";
return "";}
  • Now when you start Maya, there should be a bunch of new shaders/utilities available to you. Go to Mental Ray Materials and click on the *'mip_rayswitch'* material.

  • Create a mentalRay IBL environment. Connect the outValue of the *'mip_rayswitch'* to the 'color' of the mentalRayIblShape

  • Now you can map your HDR image to the 'Final Gather' and another map to the environment reflection.

I hope this helps!

BenF

NN comments
benf
-

‘Emit Lighting’ tends to slow my renders down. I change the FG settings in the MR render globals to a point so that I’m picking up the ambient colour from the IBL but no so much the occlusion. I can also add a couple of lights myself, depending on the scene. This removes the ‘flickering’ effect. I normally would have to set up a separate occlusion pass to compensate. It’s pretty quick to render too.

The settings I use are as follows:

Accuracy: 100 Point Density: 1.0 Use Radius Quality Control: ON Max Radius: 10.0 Min Radius: 1.0 Filter: 2 FallOff Start: 0.000 FallOff End: 0.001

Good luck!

julian
-
-moved your last post here, as its more a comment on this answer than an answer itself ;)

Hi Ben, that’s perfect! Thanks that’s just what I needed.

So you usually go with Final Gathering for the IBL diffuse lighting? I used the ‘Emit Light’ under the ‘Light Emission’ tab in the AE as I has been a bit wary that FG would be noisy or slow. Though I haven’t actually done any tests on that, so thats next up.

Because the Autodesk mip_rayswitch does not seem to function with the ‘Emit Light’ function of the mentalrayIbl.

But as you say it works perfectly using Final Gather! :)

cheers fred

or Cancel
  • 0

freds [ Editor ]

Hi Ben,

that's perfect! Thanks that's just what I needed.

So you usually go with Final Gathering for the IBL diffuse lighting? I used the 'Emit Light' under the 'Light Emission' tab in the AE as I has been a bit wary that FG would be noisy or slow. Though I haven't actually done any tests on that, so thats next up.

Because the Autodesk mip_rayswitch does not seem to function with the 'Emit Light' function of the mentalrayIbl.

But as you say it works perfectly using Final Gather! :)

cheers fred

or Cancel