CGTalk > General Techniques > Lighting and Shaders
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 03-06-2013, 09:13 PM   #1
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

VRay DMC Sampler Calculator

I shared this over at the Chaos Group forums, but thought I'd do so here as well!

I tired my hand at coding a VRay DMC Calculator - which can be used to see the exact Max/Min Secondary Samples your render will take depending on your settings. It also can be used as a tool to help understand how the Image Sampler is connected to the DMC Sampler.

VRay DMC Sampler Calculator

Let me know if you run into any bugs or any problems with the formulas, or have ideas to improve it.
Hope it helps! Enjoy!
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com
 
Old 03-07-2013, 02:46 AM   #2
Panupat
Expert
 
Panupat's Avatar
portfolio
Panupat Chong
Thailand
 
Join Date: Feb 2004
Posts: 1,942
Thanks for sharing

A little question. Leaving everything at default, setting A to 4 actually gives me more G than setting A to 8, is that correct?

Last edited by Panupat : 03-07-2013 at 02:57 AM.
 
Old 03-07-2013, 05:06 AM   #3
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

Yes, this is correct as you can see from the formula under 'G'.
As you raise your primary samples, secondary samples (per primary sample) decreases.
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com
 
Old 03-07-2013, 05:10 AM   #4
Panupat
Expert
 
Panupat's Avatar
portfolio
Panupat Chong
Thailand
 
Join Date: Feb 2004
Posts: 1,942
ah.. thanks for clarifying. So i've been wrong about this the whole time o_O
 
Old 03-21-2013, 11:53 PM   #5
InTerceptoV
MentalMan
 
InTerceptoV's Avatar
portfolio
Toni Bratincevic
Irvine,
 
Join Date: Jul 2004
Posts: 1,002

Akin, I think formula in your calc can be tweaked.
Min samples (for secondaries-adaptive tab) applies only when you have secondary rays per primary sample that are higher than Min samples (adaptive tab), otherwise it uses lower number of secondary rays than Min samples defined in adaptive tab.
Adaptive method also works only if secondary rays per primary sample are higher than Minimum samples (adaptive tab), otherwise you can just ignore it.

(F * E)2 / A needs to be (F* E/A)2

So for DMC max subdivs of 4 and Local subdivs (material) of 8 you get 2 subdivs per eye sample for glossy stuff, which means 4 samples of glossy reflections,shadows etc.

Hope this helps!
 
Old 03-22-2013, 06:22 PM   #6
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

Thanks for your feedback Toni - (I really love your work by the way!)

Quote:
Originally Posted by InTerceptoV
Min samples (for secondaries-adaptive tab) applies only when you have secondary rays per primary sample that are higher than Min samples (adaptive tab), otherwise it uses lower number of secondary rays than Min samples defined in adaptive tab.
Adaptive method also works only if secondary rays per primary sample are higher than Minimum samples (adaptive tab), otherwise you can just ignore it.

Can you clarify what you mean here? The information I'm using for how the min samples value overrides other values comes from this post by a chaosgroup representative: http://www.chaosgroup.com/forums/vb...0748#post550748

Quote:
(F * E)2 / A needs to be (F* E/A)2

So you're saying that the Primary Subdivisions value divides the Secondary Subdivisions value, and not the Secondary Samples value? Is there any documentation where I can see that? (Where did you go for information when writing your fantastic article on the DMC sampler?)
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com
 
Old 03-23-2013, 02:13 AM   #7
Panupat
Expert
 
Panupat's Avatar
portfolio
Panupat Chong
Thailand
 
Join Date: Feb 2004
Posts: 1,942
Aren't those 2 equations the same?
 
Old 03-23-2013, 02:22 AM   #8
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

Quote:
Originally Posted by Panupat
Aren't those 2 equations the same?

The "2" after them is supposed to be an exponent.
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com
 
Old 03-23-2013, 05:37 AM   #9
InTerceptoV
MentalMan
 
InTerceptoV's Avatar
portfolio
Toni Bratincevic
Irvine,
 
Join Date: Jul 2004
Posts: 1,002

Quote:
Originally Posted by RockinAkin
Thanks for your feedback Toni - (I really love your work by the way!)


Can you clarify what you mean here? The information I'm using for how the min samples value overrides other values comes from this post by a chaosgroup representative: http://www.chaosgroup.com/forums/vb...0748#post550748


Try this ... set Image sampler to DMC Min 1 Max 100. Unlock Clr thresh and set it to 100 so we eliminate any image sampling, there will be only 1 eye ray per sample. This is so we can test Min Samples in V-Ray::: DMC Sampler settings. Now put in material glossy reflection subdiv to 10, unlock highl glossiness and set it to 1 so there is no fake specular. Then in Settings > VRayDMCsampler > Min Samples set to 1, render. Set it to 50 and render again ... you get exactly same image which means that if you put DMC Image sampler to Max 50 you are overriding even Min samples value in that tab. I attached image so check my scene. This was hardest part for me to understand about DMC sampler so do a lot of tests it will help you. In this scene there is just simple plane with reflection and superbright small light to get noisy reflection.

Quote:
Originally Posted by RockinAkin
So you're saying that the Primary Subdivisions value divides the Secondary Subdivisions value, and not the Secondary Samples value? Is there any documentation where I can see that? (Where did you go for information when writing your fantastic article on the DMC sampler?)


That is correct. Subidvs are divided and then when you get final subdiv value for secondary rays you square it and you get maximum number of samples that could be cast (second samples). There wasn't any documentation about DMC, but I read a lot of Siggraph papers about DMC sampling methods and did a lot of reverse engineering while I was at Blur with a lot of testing and this is how it behaved.
Attached Images
File Type: jpg vray.jpg (97.4 KB, 55 views)
 
Old 03-25-2013, 06:42 AM   #10
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

Quote:
Originally Posted by InTerceptoV
Try this ... set Image sampler to DMC Min 1 Max 100. Unlock Clr thresh and set it to 100 so we eliminate any image sampling, there will be only 1 eye ray per sample. This is so we can test Min Samples in V-Ray::: DMC Sampler settings. Now put in material glossy reflection subdiv to 10, unlock highl glossiness and set it to 1 so there is no fake specular. Then in Settings > VRayDMCsampler > Min Samples set to 1, render. Set it to 50 and render again ... you get exactly same image which means that if you put DMC Image sampler to Max 50 you are overriding even Min samples value in that tab. I attached image so check my scene. This was hardest part for me to understand about DMC sampler so do a lot of tests it will help you. In this scene there is just simple plane with reflection and superbright small light to get noisy reflection.

This is really interesting! I recreated this test and confirmed what you've found. It seems counter-intuitive to what the expected purpose of the Min Samples - to set a safety net of minimum samples taken to get a good result.

Let me ask you this - I'm not sure I understand exactly how and when the Min Samples value comes into effect now. What would the math behind it be / How would it fit into the calculators formula?

Thanks again for your great feedback Toni!
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com
 
Old 03-25-2013, 05:32 PM   #11
InTerceptoV
MentalMan
 
InTerceptoV's Avatar
portfolio
Toni Bratincevic
Irvine,
 
Join Date: Jul 2004
Posts: 1,002

Min samples has some effect only in cases where there is a lot of samples to be cast as secondary rays (glossy). So for example, after DMC subdivision formula if 5 subdivs are still left for secondary rays (glossy), then VRay will cast 8 Min samples after which adaptive setup will take over, which means based on adaptiveness Min samples will serve as minimum samples cast (if adaptive is 1 for example) or if adaptive is set to 0.5 (50percent fixed 50percent adaptive) which means 12 non adaptive samples will be cast so Min samples won't play any role.

If DMC Min is 1 and Max is 1 then adaptiveness is 1 to 1, what you set is what you get. But Since Max DMC subdivides everything, at one point you will get secondary samples lower than Min samples and at that point you can ignore Min samples.

Confusing?
 
Old 03-25-2013, 07:09 PM   #12
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

Quote:
Originally Posted by InTerceptoV
Confusing?

Yes, very! But I think I've got it!
So 'Min Samples' is better thought of as 'Adaptive Min Samples' (as it is actually labeled in Maya, but not in 3ds Max).

So using your example:
If after the DMC subdivision formula we're left with 100 max secondary samples, and adaptiveness is set to 1.0, this results in 0 fixed samples - which is lower than the default Min Samples value of 8, so Min Samples takes effect and fires 8 samples before the remaining 92 samples are fired one by one to meet the noise threshold.

If with those same 100 max secondary samples adaptiveness is set to 0.5, this results in 50 fixed samples, which is larger than the default Min Samples value of 8, so Min Samples has no effect, and the remaining 50 samples are fired one by one to meet the noise threshold.

But in a case when the max secondary samples is very low, it sets the ceiling for number of adaptive samples to be taken, and the Min samples value has no effect.
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com

Last edited by RockinAkin : 03-25-2013 at 07:19 PM.
 
Old 03-25-2013, 08:01 PM   #13
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

Which is another way of saying:

Max Secondary Samples sets the ceiling of Min Samples which sets the floor of # of Fixed Adaptive Samples

Sounds correct?
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com
 
Old 03-25-2013, 08:21 PM   #14
Panupat
Expert
 
Panupat's Avatar
portfolio
Panupat Chong
Thailand
 
Join Date: Feb 2004
Posts: 1,942
I'm sorry but I'm confused Would you mind explaining some basics for me please?

What is the Adaptive DMC doing in the image sampler? When you say secondary rays, do you mean this one?

Is the DMC sampler for primary rays?
 
Old 03-25-2013, 08:29 PM   #15
RockinAkin
DivideByZero
 
RockinAkin's Avatar
portfolio
Akin Bilgic
Modeler / Generalist TD
USA
 
Join Date: Mar 2002
Posts: 2,644

Quote:
Originally Posted by Panupat
I'm sorry but I'm confused Would you mind explaining some basics for me please?

What is the Adaptive DMC doing in the image sampler? When you say secondary rays, do you mean this one?

Is the DMC sampler for primary rays?

Primary Rays = Image Sampler (AKA Antialiasing, or the Adaptive DMC Sampler in this case)
Secondary Rays = DMC Sampler (AKA the sampler that calculates all glossy values for Lights, Materials, DoF, etc)

If you haven't already, I'd recommend reading Toni's excellent article on it here:
http://interstation3d.com/tutorials...tyfing_dmc.html
__________________

AKIN BILGIC
Modeler / Generalist TD
CGGallery.com
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:05 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.