Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Featured Threads
  inspiration alert!!!
(37 replies)
  Indespensible MaxScripts, Plugins and 3rd Party Tools
(37 replies)
  The allmighty FREE Resources Thread !
(17 replies)
  spam alert!!!
(4886 replies)
  Maxforums member photo gallery index
(114 replies)
  Maxforums Member Tutorials
(89 replies)
  three cheers to maxforums...
(240 replies)
  101 Things you didnt know in Max...
(198 replies)
  A Face tutorial from MDB101 :D
(95 replies) Members Gallery
(516 replies)
(637 replies)
  Dub's Maxscript Tutorial Index
(119 replies)

Maxunderground news unavailable

Friday afternoon science - MentalRay Bucket sizes, and the effect on render times.
show user profile  Nik Clark
Killing some hours on a Friday afternoon, setting up some renders to go over the weekend, I wondered how much the Bucket Size in Mental Ray affects render times.

So I scripted a test and set my machine running with four different scenes, with different types of lighting, materials, etc. The results were interesting.

Mental Ray doesn't necessarily default to the fastest sized bucket. You can often shave a few seconds off a render by changing the bucket size from the default of 32 to another value (usualy 64).

These are the results of the renders of four scenes at different bucket sizes.

This is a typical output of my script (with some tests data, actual renders were longer than this)

Here's the script I used:

Yes, I am bored. Can you tell?

read 856 times
6/12/2015 3:59:46 PM (last edit: 6/12/2015 3:59:46 PM)
show user profile  khamski
How come bucket size affects render time so much?

read 814 times
6/12/2015 5:21:47 PM (last edit: 6/12/2015 5:21:47 PM)
show user profile  FX
Your using them wrong...

buckets affect render time because you can't see what your doing.
read 807 times
6/12/2015 5:41:27 PM (last edit: 6/12/2015 5:41:27 PM)
show user profile  Nik Clark
Ha ha! I think over longer renders, it is more negligible. I am going to guess that it's something to do with Max has to control the buckets of a render, and the bit of code that dishes out the buckets takes a few cycles to do it's thing. There is more too it though. If you have an object that's particularly expensive to render, say something with glass and many samples, that bucket will take longer, in which case it's better to have more than one bucket handling that object (more than one core), so smaller buckets owuld be more beneficial there. But, it kept me busy for half an hour.

read 806 times
6/12/2015 5:41:46 PM (last edit: 6/12/2015 5:42:39 PM)
show user profile  BishBashRoss
Nice work Nik.

How much of this is down to waiting for the last few buckets? did you try different image sizes?

I know Vray now has that cool feature where the buckets get smaller and smaller at the end. I'm guessing Mental Ray is lacking that feature.

read 803 times
6/12/2015 5:42:34 PM (last edit: 6/12/2015 5:42:34 PM)
show user profile  BishBashRoss

read 786 times
6/12/2015 6:24:19 PM (last edit: 6/12/2015 6:24:19 PM)
show user profile  Garp
Out of curiosity, did you try bucket sizes that weren't powers of 2?

read 748 times
6/12/2015 9:43:22 PM (last edit: 6/12/2015 9:43:22 PM)
show user profile  Nanne
Ooh Nik, you're such a nerd ;) haha :D This is very cool :) I did some similar test a while back on a interior scene with photometric lights only (no sun or HDRI from outside) at 1280x720 I think. I was tinkering with the Quality sider, Spatial Contrast, Filter types and bucket size.

Time - Qual. - Filter - Spatial Contrast - Bucket Size
57:59 - 8.0 - Mitchell - 0.01, 0.01, 0.01, 0.01 - Bucket 32
25:41 - 3.0 - Triangle - 0.05, 0.05, 0.05, 0.05 - Bucket 32
24:03 - 3.0 - Triangle - 0.1, 0.05, 0.2, 0.2 - Bucket 32
21:26 - 3.0 - Triangle - 0.1, 0.05, 0.2, 0.2 - Bucket 48
22:01 - 3.0 - Triangle - 0.1, 0.05, 0.2, 0.2 - Bucket 64
22:24 - 3.0 - Triangle - 0.1, 0.05, 0.2, 0.2 - Bucket 128
Note: the first test uses quality 8.0(!) just to compare, but 3.0 was just as good and saved a lot of time!

The shortest time (with no loss of quality) was 21:26 and the only difference is that I switched from a bucket size of 32 to 48 and it shaved of 2½ minutes! :)

Also note the difference between test 2 and 3. The only difference here is the spatial contrast, and it shaved of about 1½ minutes! :) The idea here is that the human eye is most sensitive to green, so the green channel gets the lowest contrast (0.05) to compensate for that in lost render time we can set the red channel to 0.1 and the blue to 0.2 because blue is the colour that the eye is least sensitive to and thus the noise quality is less noticeable for that colour. The alpha channel can also be set to 0.2. This is a trick that comes from Master Zap :)
Here's another example on some other scene (don't remember which one), only the spatial contrast is changed.

Time - Spatial Contrast
18:15 - 0.01, 0.01, 0.01, 0.01
17:33 - 0.1, 0.05, 0.2, 0.2
About 40sec difference.

Filter types also effects rendering time. Mitchell and Lanczoz are the slowest, Triangle is pretty fast and gives almost the same result. Don't remember what scene this was nor the render resolution, but here are the test results.

Time - Filter type - Filter Size - Comment
15:27 - Mitchell - 4, 4 - Looks pretty much like Lanczos, but a bit slower
15:00 - Lanczos - 4, 4 - Looks pretty much like Mitchell but a bit faster
12:20 - Triangle - 2, 2 - Looks pretty much like L and M but the noise pattern is a bitt different
11:48 - Box filter - 1, 1 - Gives some anti-aliasing artifacts in the reflections
11:47 - Gauss - 2, 2 - very unsharp!

Data! It does get more exciting than that! ;) Friday fun for the whole family! :P

Kristoffer Helander
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 744 times
6/12/2015 9:51:45 PM (last edit: 6/12/2015 9:59:08 PM)
show user profile  Nanne
I forgot the mention. I've tried using 48 vs 32 for bucket size in other renderings but the result varies. In some scenes 32 is faster and in other 48 is, don't know why though. Anyway, I usually just leave it at the default (usually 32 these days I think, it was 48 in older versions of Max).

But just for fun, could you try your scenes with a bucket size of 48, Nik? :)

Kristoffer Helander
  :: Works ::   |  :: Resumé ::   |  :: Contact ::   |  :: CG Blog ::   |  :: Links ::     
read 742 times
6/12/2015 9:56:28 PM (last edit: 6/12/2015 9:56:28 PM)
show user profile  khamski
"If you have an object that's particularly expensive to render, say something with glass and many samples, that bucket will take longer, in which case it's better to have more than one bucket handling that object (more than one core)..."

Ps. Something wrong with html in comments. I really struggled here.

read 692 times
6/14/2015 11:31:22 AM (last edit: 6/14/2015 11:37:50 AM)
show user profile  Mr_Stabby
that totally depends on the scene, hardware and the specific bucket.

The bigger the bucket, the less data traffic, means faster. Big buckets also waste more space on inactive data, at some point overflow management and long recursion will outweigh the original benefits. Also buckets are varied in complexity and big buckets take the full brunt while smaller ones mitigate the issue.

read 668 times
6/14/2015 2:27:00 PM (last edit: 6/14/2015 2:27:00 PM)
#Maxforums IRC
Open chat window