Regarding the 3DLight Engine and Render Settings

wancowwancow Posts: 2,708
edited December 1969 in Daz Studio Discussion

Okay, mostly I'm concerned with the Shading Rate. A Lower shading rate severely jacks up the render time, but what does it actually DO?

Also, I know someone out there knows exactly what all the advanced settings do. I know, for instance, that Ray Trace Depth has a lot to do with transparency and reflections. If someone could run down what each of these settings do, and whatever effect they have on render time, that would be very helpful, I think.


  • adamr001adamr001 Posts: 1,322
    edited December 1969

    From my tutorials and freebies index:

    Advanced Render Settings and what they do discussion.

  • wowiewowie Posts: 1,916
    edited December 1969

    This is taken from 3Delight for Maya documentation, but should also be applicable to DS.

    ` Shading Rate'
    Controls how finely the geometry is tessellated prior to shading. 3DELIGHT adaptively tessellates each primitive into very tiny elements called micro-polygons, those elements are then shaded and sampled. Usually, the size of one such micro-polygon is one screen pixel and this corresponds to a shading rate of 1.0. A shading rate of 4.0 will produce micro-polygons that cover approximately an area of 2x2 pixels and a shading rate of 0.5 will give two micro-polygons per pixel.

    The value for Ray Trace Depth simply sets how often ray/light bounce of an object/polygon.

    On a side note, looking at those docs really give a glimpse of what kind of features/options DS users are missing out.

  • adamr001adamr001 Posts: 1,322
    edited December 1969

    From the other thread I linked too:

    adamr001 said:

    One of the things I didn't point out in the earlier portion of the thread, could stand some light shined on it.

    Let's talk about what shading rate and pixel samples actually mean.

    Unfortunately, I cannot really speak about one without speaking about the other as they're so intertwined that they're inseparable as far as I am concerned.

    But here's a stab a separating them anyway:
    Shading Rate - How many times to sample a given area for determining the color of a given pixel.
    Pixel Samples - Number of Pixels to traverse away from the current pixel when sampling color for shading rate.

    So now to talk about them together... Examples are easier so here we go!

    Consider a Shading Rate value of 1.00. The DS3 Default value. At this value you're comparing 1 pixel at a time to each pixel in the pixel sample width X and Y values to determine it's color. So if you have a pixel sample width of X=6 and Y=6, you're going to sample +6 pixels on the X axis, -6 pixels on the X axis, +6 pixels on Y and of course, -6 pixels on Y. So at a shading rate of 1.00 each pixel is sampled 24 times (given a pixel sample width of 6x6) to determine it's color.

    So now, let's talk about Shading Rate values of LESS than 1. Effectively, what you do is some math. It really translates to sampling the same area of pixels nearby over and over again to determine the color of the active pixel. So let's take my recommended "best" setting for shading rate of 0.20.

    The math goes like this: (Shading Rate * Pixel Sample X Value * 2) + (Shading Rate * Pixel Sample Y Value * 2)

    When you're under a value of one though, you have to divide 1 by that value... so

    At 0.20 the math works like this:
    1 / 0.20 = 5
    (5 * Pixel Filter Width X Value * 2) + (5 * Pixel Filter Width Y Value * 2)

    So given a Pixel Sample Width of 6x6 again, that would be
    (5 * 6 * 2) + (5 * 6 * 2) = 120. So that single pixel is compared against it's neighbors 120 times. That's quite a jump over the 24 comparisons it does by default.

    So if you use the absolute best shading rate DAZ Studio can do (0.010), the math works out like this:

    1 / 0.010 = 100
    (100 * 6 * 2) + (100 * 6 * 2) = 2400

    Yes, two THOUSAND four hundred samples per pixel. If you're doing a 1000x1000 pixel render, well, the math adds up. (2 billion, 400 million samples must be taken at 0.010 vs. 120 million at 0.20).

    The odds of the color changing over 0.20 are pretty slim, but it might make some tiny difference. It's also pretty clear why lowering the shading rate is a direct line to how long it takes something to render.

    NOW, that said, there ARE reasons to use lower shading rates. Extreme displacement detail is the #1 reason to do so. This is because with extremely fine displacement, especially if it's a strong value, the pixel sample may not reach an area of the render where displacement is occurring and thus the detail is lost. This is easily seen using Pen's Fur Shader. For most products though, it's really quite overkill (imo) to set the shading rate value that small.

    It also, using the text above, should be clear why an increase Pixel Samples is required to handle depth of field. Depth of Field introduces blur and blur clearly affects color and position. A larger field of pixels is needed to create a smooth blur, thus my recommendation of upping the pixel samples for DoF renders.

    Such is my, more technical, understanding of Shading Rate and Pixel Samples.

    Pixel Filter Width would work in a similar fashion to Pixel Samples, but applies only to the type of Pixel Filter that is being applied.

    Oh, and for shading rates GREATER than one, what you're doing is comparing an area against the pixel filter. So to handle the math involved in that, divide 1 by that value. So a shading rate of 4.00 (again keep pixel samples at 6x6) the math works like this:
    1/4 = .25
    (.25 * 6 * 2) + (.25 * 6 * 2) = 6

  • wancowwancow Posts: 2,708
    edited December 1969

    WAIT a minute!

    The way Shading Rate is described sounds a whole HELL of a lot like the way the Poser render engine has it's claimed Subdivision Surfaces!

    So, basically what you're telling me is this: when I have a really detailed displacement map, the shading rate will absolutely affect it...


  • wancowwancow Posts: 2,708
    edited December 1969

    wowie said:

    The value for Ray Trace Depth simply sets how often ray/light bounce of an object/polygon.

    I was under the impression ray trace depth also affected how deep rays would go through transparency layers. Such as layered hair, or somesuch.
  • MattymanxMattymanx Posts: 6,345
    edited December 1969

    Raytrace bounce affects reflections as well as raytraced shadows.

  • Richard HaseltineRichard Haseltine Posts: 64,526
    edited December 1969

    wancow said:
    wowie said:

    The value for Ray Trace Depth simply sets how often ray/light bounce of an object/polygon.

    I was under the impression ray trace depth also affected how deep rays would go through transparency layers. Such as layered hair, or somesuch.

    Only if there's refraction or reflection applied to the surface - if not, a transmapped surface doesn't use a bounce (fortunately or we'd need to set the value high to render most hair).

  • wancowwancow Posts: 2,708
    edited December 1969

    Okay... for the first time I did a full sized render, 1600 pixels tall, that rendered in FIVE MINUTES!

    Good grief, that has NEVER HAPPENED to me before. So I'm talking with a programmer friend and he's telling me about floating point operations (as opposed to Integer Operations) and that I need to figure out which that one setting, or two, were those that made this render go so fast...

    Here's the image:

    My render settings were as follows:

    Bucket Size: 8
    Ray Trace Depth: 4
    Pixel Samples X: 4
    Pixel Samples Y: 4
    Shadow Samples: 16
    Gain: 1
    Gamma: 1
    Shading Rate: 0.5
    Pixel Filter: sinc
    Pixel Filter Width X: 6
    Pixel Filter Width Y: 6

    Why, oh why did this render not take the normal TWO HOURS? I dunno... not the first CLUE!

  • LoaarLoaar Posts: 0
    edited December 1969

    The only thing in that render that would take longer than 5 minutes is the hair. Did you do something different with the hair?

    The render settings do make a difference, but lighting settings and hair slow my renders down much more than even major changes to the render settings.

  • wancowwancow Posts: 2,708
    edited December 1969

    Other than use the LIE to make that hair colour, not a durn thing!

Sign In or Register to comment.