2011-04-15

2012 and Unified Sampling

Hello World!

The new 2012 versions of the Autodesk products Max/Maya/Softimage are upon us, and they are loaded up with mental ray 3.9.

One of the cool new features in 3.9, which doesn't seem to be exposed in some of the products, is "unified sampling".

The new "Unified Sampling" is a new way to choose which and how many samples (i.e. "rays") are shot into a given pixel, and what position in space AND TIME those rays have.

This becomes very significant as we discuss motion blur.

For anyone who have read the Samples Tips page over at lamrug.org knows that mental ray normally shoots rays roughly in a grid (but with jittering, so it is not exactly a grid) which it subdivides adaptively as needed, and for motion blur, mental ray actually (in the default raytracing case) shoots multiple rays into the same spatial position, but with different temporal positions (effectively rendering the subpixel sample at more than one position in time).




An image from LAmrUG.org


Now, Unified sampling unifies (hence the name) spatial and temporal sampling. Each ray has it's own space AND time sample. And not only that, the convergence of both is adaptive, so you simply set a lower limit on the amount of rays (say, 1) and an upper limit (say, 100) and simply turn a quality knob. This tries to adaptively resolve any noise from any source, be it soft shadows, glossy reflections, or motion blur with the SAME oversampling scheme.

Sounds nice, eh? So it's a pity it wasn't included in the 3ds Max UI, isn't it?

Luckily, the FEATURE is still there, and can be reached via Scripting.

In the Beta team, a set of people generated scripts to solve this issue (there are even several), and here are a few places you can download such scripts:

Arthur Leão and Duncan Howdin cowrote this script (pictured above) which you can download from Arthur's site
at http://dimensao3.com/al/ (file itself here)

It allows you to set the parameters and by doing this improve render times with motion blur and quality of quasi-random effects such as soft shadows and glossy reflecitons more easily than in the past.

These scripts utilize the MaxScript exposure of mental ray "string options". A problem with the string option MaxScript feature is that it the state of string options is NOT saved with the .max file. However, Arthur has solved this isse with a callback in the script ... or somesuch magic, I suck at MaxScript myself... ;)

Thorsten Hartmann (Infinity Vision) wrote another version which he has posted at http://www.infinity-vision.de/blog/unified_sampling which also contains some information and test renders.

Enjoy Unification day!

/Z

10 comments:

Andrew said...

Hi Zap! So this sounds very similar to Vray's DMC sampling. Sounds great. It makes things a ton easier and MotionBlur possible;) Great they've done it. I'll take a look once we get the new Maya up and running.

GustavoEB said...

Hi Zap, I've tested this a little bit and I find confusing to predict what quality is doing, and therefore difficult to optimize my scenes using it. What does it actually do, is it a contrast thing? Why does it go over one and what is it doing when you dial in such values?

Ramy Hanna said...

great tools. Wonder why this was never integrated into an out of box UI for 3dsmax?

David said...

@ GustavoEB

Unified uses different criteria to determine where to place samples. You can get a better idea of what Unified identifies as error by enabling and using the diagnostic renders. When the sampling diagnostic is turned on you will get 3 layers with different information in an EXR format.

If you open with imf_disp you can mouse over the pixels and get actual numbers for samples and time to render the pixel (in seconds). (It helps to lower the exposure setting to something like -5.0 for those 2 layers) The error buffer identifies error in the three different color channels. When you increase the Quality setting it will begin placing more samples in the areas it perceives as having error.

Optimizing should be easier because even a wide spread of samples (1-100) like Zap mentions will be able to handle a large range of rendering noise.

Nishit Patel said...
This comment has been removed by the author.
Nishit Patel said...

hi! zap
I'm Nishit
I'm new here
can u tell me in which software r u writing the shaders?

Unknown said...

Interesting, does using unified sampling change workflows for flickerfree fg?

Rawalanche said...

Do you realize that it actually sucks at practical usage, and in rare situations, where it has a slight advantage over old AA method it pays off a lot more to use rasterizer, right?

Anonymous said...

"great tools. Wonder why this was never integrated into an out of box UI for 3dsmax?"

indeed, I am so disappointed and tired of Autodesk and their integration of mental ray. We started to use Vray, it is just working for what we are doing. Great glossy relf and fast. I don't wanna do research any longer about what could be used by string options and new features are hidden, I wanna work and do great images. Thats it.

myslot said...

เกมสล็อต xo แจกฟรีเครดิต slotxo เล่นเมื่อไหร่ก็ได้เงินจริง

https://www.slot4u.com/slotxo