Unified Sampling in 3.10 (and other changes)

Autodesk released their 2013 products this last week. This is the first public release of mental ray 3.10.

You will find this release focuses mostly on bug fixes and enhancements to existing features. The “What’s New” section leaves out the details. You can find the details in the Release Notes section. This is the best place to find fixes and enhancements you may need to know about.

The majority of your performance increase will be seen with Unified Sampling. Things to note for Unified Sampling in 3.10:

  • Previous scene’s Quality settings will generate fewer eye rays since they are unnecessary
  • Unified Sampling will sample dark areas of an image less
  • Unified Sampling produces smoother grain in areas with insufficient Quality
  • Framebuffers no longer have artifacts
  • Edges and thin objects (like hair) have improved sharpness
  • Motion Blur is smoother than before

Many of the previous caveats that may have kept you from using Unified Sampling before have been fixed in Maya now. More improvements are to come. We’ve been told from Autodesk that Hotfixes will be more often and hopefully provide more opportunity to upgrade and replace mental ray since it is now a separate plug-in.

For same-scene renders you can expect complex scenes will render 10-15% faster than before.

Below are some examples. I was kindly given a scene from a current intern at Full Sail University in Orlando, Florida. I cannot experiment or release my current work on the blog so it’s great when I have some nice projects to play with and share!

You can find more of Jiayu’s work on: Jayuliu

Previously for this scene it was taking multiple hours a frame using traditional techniques. I have since updated the sampling on the scene to use Unified Sampling and area lights. For a 720HD render it now takes about an hour for the night time scenes you will see shortly. 10 minutes a frame for the close-up Bedroom scene. There could be some more tweaking done to these using advanced lighting (covered later) but one thing at a time. 😉

Daylight Bedroom:

Jiayu's Bedroom Model Render

These scenes are rendered following the guides in the Unified Sampling for Artists Post and the Area Light Post.

In mental ray 3.9 I rendered the above scene with these settings:

  • samples min 1
  • samples max 500
  • samples quality 4.
  • error cutoff 0.04
  • Gaussian filter 2. 2.

For mental ray 3.10 I used the settings that gave me the nearest result without going overboard:

  • samples min 1
  • samples max 500
  • samples quality 2.5
  • error cutoff 0.02
  • Gaussian filter 2. 2.

The time saved for a quick render are minimal for a trivial scene:

3.9:       0:12:11.04

3.10:     0:11:12.86

What is of note is how Unified Sampling sees the scene. Below are the Sampling Diagnostic Framebuffers, 3.9 first, 3.10 next. Brighter areas are more samples.

3.9 Samples Diagnostic

3.10 Samples Diagnostic

Notice how dark areas sample much less than before (in the painting above the bed and the foot of the bed for example). Below is the visual difference from imf_diff utility, somewhat exaggerated to see better.

Image Difference from 3.9 to 3.10

Things to notice here are:

  • Edges are cleaner than in 3.9.1 (this change was introduced in 3.9.2 and improved in 3.10)
  • Area Light grain is less noticeable/clumpy than before (overall sampling pattern is smoother)
Pertinent diagnostics are below:
mental ray 3.9

JOB 0.2 progr: 100.0% rendered on SIAB.2
RC 0.10 info : rendering statistics
RC 0.10 info : type                             number     per eye ray
RC 0.10 info : eye rays                       12597442     1.00
RC 0.10 info : transparent rays                 278449     0.02
RC 0.10 info : reflection rays                 8661007     0.69
RC 0.10 info : refraction rays                  643795     0.05
RC 0.10 info : shadow rays                   126100094    10.01
RC 0.10 info : environment rays                 146106     0.01
RC 0.10 info : probe rays                     34008648     2.70
RC 0.10 info : fg points interpolated         20323641     1.61
RC 0.10 info : on average 86.51 finalgather points used per interpolation
RC 0.10 progr: rendering finished
RC 0.10 info : wallclock 0:12:11.04 for rendering
RC 0.10 info : allocated 353 MB, max resident 413 MB
GAPM 0.10 info : triangle count (including retessellation) : 994312
PHEN 0.10 info : Reflection rays skipped by threshold: 4405980
PHEN 0.10 info : Refraction rays skipped by threshold: 22742

mental ray 3.10

JOB 0.7 398 MB progr: 100.0% rendered on SIAB.7
RC 0.3 398 MB info : rendering statistics
RC 0.3 398 MB info : type                        number    per eye ray
RC 0.3 398 MB info : eye rays                   9192639    1.00
RC 0.3 398 MB info : transparent rays            275289    0.03
RC 0.3 398 MB info : reflection rays            6560278    0.71
RC 0.3 398 MB info : refraction rays             553186    0.06
RC 0.3 398 MB info : shadow rays               95549199   10.39
RC 0.3 398 MB info : environment rays            142848    0.02
RC 0.3 398 MB info : probe rays                26833006    2.92
RC 0.3 398 MB info : fg points interpolated    14966173    1.63
RC 0.3 398 MB info : on average 87.47 finalgather points used per interpolation
RC 0.3 352 MB info : wallclock 0:11:12.86 for rendering
RC 0.3 352 MB info : current mem usage 352 MB, max mem usage 411 MB
GAPM 0.3 352 MB info : triangle count (including retessellation) : 994312
PHEN 0.3 352 MB info : Reflection rays skipped by threshold: 3560987
PHEN 0.3 352 MB info : Refraction rays skipped by threshold: 19657

Below is the night image. 12 area lights of different sizes/types. As above I am using the ambient occlusion in the mia_material set to 4 samples. The wall behind the bed has the color bleed option turned on to improve the light from the glowing mushroom night light.

Night image, time for render: 1:09:13

The more important diagnostics can be seen here from 3.9 to 3.10. This scene did not have a change in any settings from 3.9 to 3.10. Exactly the same settings were used.

mental ray 3.9

RC 0.10 info : rendering statistics
RC 0.10 info : type                           number     per eye ray
RC 0.10 info : eye rays                     18624542     1.00
....
RC 0.10 info : wallclock 1:34:57.79 for rendering
RC 0.10 info : allocated 1132 MB, max resident 1302 MB
GAPM 0.10 info : triangle count (including retessellation) : 1882529

mental ray 3.10

RC 0.3 764 MB info : rendering statistics
RC 0.3 764 MB info : type                     number     per eye ray
RC 0.3 764 MB info : eye rays               11500119     1.00
....
RC 0.3 679 MB info : wallclock 1:09:09.39 for rendering
RC 0.3 679 MB info : current mem usage 679 MB, max mem usage 850 MB
GAPM 0.3 679 MB info : triangle count (including retessellation) : 1882529

The time saved is 23%! A reduction in 7 million eye rays and nearly 500MB for memory consumption for the same image.

Below is a day scene based on the original scene I was given that can now be rendered in a reasonable amount of time as an animation:

Jiayu's Original Day scene, no changes from file other than technical.

Additional Notes:

  • Complex scenes will now render faster than before with no changes and consume less memory.
  • Greater complexity sees more benefit.
  • You should be able to reduce your Quality for Unified Sampling and still see a better quality image than 3.9 with a shorter render time.
  • 3.10 now allows you to mix Final Gathering with Irradiance Particles without interpolation artifacts. It also exposes new ways to combine FG + Importons and/or IP, see the Release Notes for the most information.
  • Texture caching is improved and will allow you to render more textures at once with much less memory. The mechanism is also faster. In a future post we will show you how to use this with your Maya installation.
  • user_ibl shaders increase how quickly and easily you can light using mapped textures. user_ibl_env allows you to light in the same way as you would with the Native IBL, but has simpler controls and preserves texture details better. Both follow the same guidelines for samples as the Area Light post (4-8 for samples in the area light) and must match the samples on the light shader itself for best results. More samples will be necessary for more complex HDR images.
  • Raytracing speed was improved but the emphasis was hair and fur. Unified Sampling and better raytrace speed should increase the speed of scenes with hair and fur without needed rasterization.
  • New shaders for hair and fur can be written to make brute force sampling for hair and fur a reality with Final Gathering.
  • Framebuffers with Unified Sampling no longer produce artifacts.

About David

I am a VFX artist that specializes in Lighting and Rendering. I spend a fair amount of my time supplying clients with artistic solutions as well as technology solutions. With a background in fine art and technical animation training, I strive to bridge the divide between the artist and technologist.

Posted on April 15, 2012, in Example, maya, Optimization, Uncategorized, unified sampling and tagged , , , . Bookmark the permalink. 19 Comments.

  1. Awesome! Thx for the updates. I have been checking your site regularly for these cool tips

    Keep it up 😀

  2. “There could be some more tweaking done to these using advanced lighting (covered later)…”
    Hey David, in your upcoming post on lighting, was wondering if you could explain pros/cons of using Area Lights with various light shaders (portal lights, photometric, physical etc) and which would work best with Unified. Now that Unified is going to be more ‘useable’ in 3.10 for Maya, will it be feasible to start mapping area lights with textures (something akin to Vray’s area lights which can be efficiently texture mapped). Lighting in Mental Ray (at least in Maya) is not very straightforward: Light intensity values are meaningless. With regards to direct lighting, never sure which light shaders should be used (as far as accuracy and performance are concerned).

    Looking forward to the next post,
    Cheers

    • user_ibl_rect can be mapped for lighting and use a better importance method than regular area light. We’ll be touching on those (user_ibl shaders) hopefully soon.

      Maya units are always arbitrary. mental ray can use whatever units you want, but match the Maya setup. And to be honest, I try to use radiometric rather than photometric units. It’s more straight forward. (Watts as opposed to lumens. Conversions with photometric are more of a pain.)

      Decent article here: http://www.optics.arizona.edu/palmer/rpfaq/rpfaq.htm

      Look at the section on quantities and units for photometry and you’ll see it gets a little more complex than I’d like to deal with, personally. Also, for VFX we eyeball intensity. So knowing 1 = 20 watts or something isn’t really as helpful as you might think.

  3. Thanks very much for the continued posts and updates on these features.
    99% of the time I use vray at home, however at work we currently use MR, so it’s great to keep up-to-date on these features.
    I do have a request that may not be possible, is there a chance of getting what you’d call a fairly heavy scene to work with ?

    • I have worked with some heavy scenes, but I don’t have any I can show publicly. Even if the scene is released I can’t access it later for blog purposes. It has to be something I can re-purpose.

      For example, the Driller on Transformers: Dark of the Moon for ILM took over 2 hours to load onto a workstation it was so large. I have worked on scenes with instances upwards of 1 billion triangles before. (A lot of what you see where someone touts billions of triangles are not unique triangles, they are instances or proxies.) The only system I’ve seen where billions of unique triangles are easily rendered is through Two-Level Raytracing, research done by Alexander Keller et al.

      As for gigabytes of textures, that’s also possible and we’ll be talking about that soon.

      • Crazy stuff !
        I thought it was bad enough here waiting 10-15 mins, let alone 2 hours.

        I think what I may do is create a fairly simple scene but populate it with a lot of objects (cars in my case), with some 4k textures on various bits n bobs. Probably the best I can do just for speed sake.

        I know that previously you were demonstrating things with the classroom scene. It would be good just to have a point of reference to work from for comparisons.

  4. Hi David!!! I´ve met your blog recently and I was surprised… It´s so good…
    Last friday I finally managed to study and test Unified Sampling and I´ve learned a lot from you… Thanks !!!

    I would like to know if you are planning to post something about the new BSDF shaders… It´s exposed now and I haven´t found any good explanation about it…

    Thank you

    • Thanks! You can actually see a lot about the BSDF shaders in a thread on the ARC forum here: BSDF/BRDF Shaders in Maya 2011

      These were previously unexposed but have existed for some time. They are a different shader model and take some time to get used to. But they are generally very efficient at things like glossy effects. Take care that this set has some limitations for bumps and cannot be layered. IOR is also locked at 1.5 for refraction.

  5. Have you tried the new sss shaders? What’s your thoughts about them?

    • Sadly, I don’t do much character work (or not sadly, I’m not very good at it some days). But in looking at it, the controls should be much easier to understand than before. They reduce a lot of the extra controls to a scatter that should be easier to understand.

      This is also a preferred set of controls that was worked on with some leading studios to get their input on how they wanted the model to work.

  6. Thank you very much. But wait, how did you expose these parameters (unified) in maya 2013?

  7. David as you wrote 3.10 now allows you to mix Final Gathering with Irradiance Particles without interpolation artifacts……………. see the Release Notes for the most information.
    I checked them here:
    http://docs.autodesk.com/MENTALRAY/2013/ENU/mental-ray-help/files/manual/upgrading310.html
    and here :
    http://docs.autodesk.com/MENTALRAY/2013/ENU/mental-ray-help/files/relnotes/relnotes.html
    I am using Importons and IP for my project . Haven’t found note about FG and IP improvement which you mentioned. May be I am looking in wrong place. Also tried unified sampling in Importons and IP. During R&D AA took 7.57 min (and better result) and unified took 10:42 min. Have you ever tried both together? I do explosions, destruction and fire water glass effects. What is your suggestion GI/FG/IP ? as fg flickr alot. Also want to know In importons with density of 1 and 0.100 gives almost similar result with very minute difference (in less time). One way its good but can’t increase quality by increasing Density.
    Expecting Your suggestion for effect artist about lighting and rendering !

    • For the majority of effects shots, Final Gather is “good enough” and you can use the FG Shooter script found here: https://elementalray.wordpress.com/2012/01/04/fgshooter-ui-for-maya/

      This will help reduce or eliminate flickering pretty easily.

      IP will help render more quickly if your lighting scenario is very complex. Lighting that causes FG variance and splotches can be quickly resolved with IP. Lower density may cause articats because not enough lighting information was provided in the pre-pass. But if your lighting and geometry aren’t very complicated you can greatly reduce it.

      FG+IP will work with improved importance string options to speed up those same scenes with complex lighting.

      final gather importance [off,partial,full]

  8. Hi David!
    I see everywhere on the internet, that Unified Samples is the new “God” of Mental Ray’s workflow. I tried to use in many projects, but every time, after testing many combinations of Quality/Min/Max I ended up using Adaptive Sampling (0-2).
    To match the result of adaptative sampling I always have to use 30% percent more render time with Unified Sampling.

    I started to think that the great benefits of Unified Sampling resides on reducing the noises of Final Gather/Soft Shadows/Motion Blur. And I’m just looking at edges artifacts…

    Is that it?

    I’m working on a fairly realistic “Car on white studio” scene. I thought this time I could use Unified Samples, but didn’t work again. Too Slow

    (Sorry for the Noob question)

    • Unified Sampling is the groundwork for methods that use a unified sampling technique. Meaning your render quality is controlled through one parameter and not several. In this case: Unified Quality

      What version of mental ray are you using? 3.9 inside Maya suffered some edge artifacts that 3.10 resolves. (It was resolved in 3.9.2 but that was not made available in Maya) What types of scenes are you rendering? Are they complex? Do you have a lot of realistic soft shadows or motion blur?

      Many times we see users try Unified Sampling on very trivial scenes. Or they combine Unified Sampling with old techniques like large reflection ray counts or high area light samples. Reduce these as mentioned in the Unified Sampling Visually post to very low numbers or in some cases all the way to 1 sample (ray).

      This will allow Unified sampling to do the work for you and select where to sample more without the shader compensating.

      Now, here’s the part where you need to objectively view the render result. In some cases the time to complete the frame is longer than with regular legacy AA. However, the quality of the image is very high. If you attempt to match the quality of the Unified Sampling frame using regular legacy AA you will find the result typically takes MUCH longer than Unified Sampling.

      For instance I have a scene tested where the Unified Sampling frame was about 13% longer. But the resulting wide glossy reflections were noise-free unlike the regular AA frame. Achieving that through regular AA took nearly 75% longer than Unified. So in fact, Unified was MUCH faster.

  1. Pingback: Unified Sampling – Visually for the Artist « elemental ray

  2. Pingback: Unified Sampling – Visually for the Artist | Pixel

  3. Pingback: MILA New Features – May | elemental ray

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: