PDA

View Full Version : Adaptive Sampling Info: Old And New



Dave Jerrard
02-03-2013, 06:50 PM
Wow. This forum looks very different from my last visit...

Also, it seems that my adaptive sampling chart & info I posted sometime around my last visit has gone missing. So here it is again...


Antialiasing changed drastically in 9.2, and then again in 11. Each time, this caused a lot of confusion about how it works and how to best use it. This is especially true if you're using Adaptive Sampling. Essentially there are now THREE ways to handle Antialiasing:


AA Level or Minimum Samples: This is a simple numeric value that represents the number of render samples per pixel. In 9.x and 10, this is labeled simply, "Antialiasing"; in LightWave 11, it's called, more correctly, "Minimum Samples". In both cases it's the same thing; the number of samples that will be rendered for each pixel on each Motion Blur Pass. This is much like the old method, that did single samples over multiple passes, but now, those samples are rendered at the same time. To keep things simple, I'll use the term "Minimum Samples" from now on.
Motion Blur Passes: Before 9.2, this was simply called Antialiasing, and was a dropdown of several preset values (and names; Low, Low Enhanced, Medium, etc.) to choose from. In 9.2, this was moved and renamed to Motion Blur Passes (or MBP), but still functions much like it did before, like the old method, where AA is done one pass at a time. (The Classic Camera still uses this method) This is primarily used for scenes that use PhotoReal Motion Blur and deformations, which can get extremely slow when there's a lot, and for volumetrics, which can't move & blur during a single pass render. As before, multiple Motion Blur Passes can be used for AA and DOF as well. Again, this is now a simple numeric value. This has not changed for LW 11.x.
Note: This value frequently effectively works as a multiplier on render times; all the settings above this are done for each Motion Blur Pass. Thus a frame with a Minimum Samples of 3 might take 3 minutes to render but can easily take 9 minutes if Motion Blur Passes are also set to 3. All the samples done in the AA section are multiplied by the number of Motion Blur Passes.
Rule of Thumb: Divide the Minimum and (in LW11.x) Maximum Samples by the number of Motion Blur Passes, and MULTIPLY the Adaptive Sampling Threshold by the MBP.
Adaptive Sampling: This checks the image for high contrast details where aliasing problems will be most noticeable, and then re-renders only those pixels with additional samples to clean them up. Before 9.2, this was generally an evil feature to be avoided as it would tend to miss fine details (if it wasn't rendered in the first pass, it never would be in later passes). In 9.2 and on, the image is rechecked on ever Adaptive Sampling Pass, to see which pixels still need work. If something was missed in the first pass, it's entirely likely that it will have been rendered in a later pass now. The number of passes was determined by the combination of Minimum Samples and the Threshold, and each Adaptive Sampling Pass would render twice as many samples per pixel as the previous pass, so the number of maximum samples doubled each time. As the threshold got smaller, the number of passes would increase and the number of samples could get VERY large. For example, on an image with a Minimum Samples of 1 and a threshold of 0.0001 (insanely low, but frequently used in LW11 examples), LW would render FOURTEEN Adaptive Sampling Passes, which would result in 16,384 (2^14 = 16384) samples per pixel! In 11.x, the number of Adaptive Sampling Passes is now manually determined by the user, and is no longer tied to either the Minimum Samples or the Adaptive Sampling Threshold.
Maximum Samples: This setting is new in LightWave 11, and serves as the upper limit on samples. This ONLY applies when Adaptive Sampling is used. Since 9.2, this value was determined internally, based on the AA level and the threshold. As the Adaptive Sampling Threshold got smaller, more Adaptive Sampling passes (AS Passes from now on) would be applied, and this would increase the maximum samples that would be calculated by larger and larger steps, doubling the number for each additional pass. With a Minimum Samples of 3 and a threshold of 0.03, this upper limit would be 48. Lowering that threshold to 0.02 would double that to 96 samples, and could easily double the render time. Now, in 11.x, you can dial in the maximum you want. Note that this doesn't mean LightWave 11 will always render that many it will frequently finish an image before it reaches that maximum. If the image cleans up before hitting that maximum, the image is considered done and no further passes are done. Lw11 also now only renders a single sample per pixel per Adaptive Sampling Pass. This means you're going to see a lot more AS Passes being rendered, and the image is going to be checked for contrast for each & every one of those passes.


These can all be combined to work together. You can have 50 AA samples AND 20 Motion Blur Passes if you want. This will result in 20 passes of 50 samples each, for an image that has 1000 samples per pixel. The AA samples are done for EACH Motion Blur Pass, so each additional pass adds another set of AA. This includes Adaptive Sampling, which is done at the end of each Motion Blur Pass.

The important point to remember here is that Motion Blur Passes act as a MULTIPLIER for everything in the AA section above, so this will tend to multiply your render times by the number of passes you specify. If you must use multiple passes, you're going to want to reduce the sampling going on for each. A good rule of thumb for this is to;

9.2 to 10.1: Multiply the Adaptive Sampling Threshold by the number of Motion Blur Passes, and just lower the Minimum Samples to 1 (or rarely 2).
or
11.0: Divide the Minimum and Maximum Samples by the number of Motion Blur Passes, and MULTIPLY the Adaptive Sampling Threshold by the MBP.

The reason for changing the threshold is simple; each motion blur pass contributes only a fraction of the final image data. In the case of two passes, each pass only makes up one half of the data. when you figure in how the threshold works, that's effectively halved as well. A threshold of 0.5 is looking for pixels that are more than 50% different than their neighbors, but this is calculated on data that's only going to contribute half of the final image, so it's really working out that you have an effective threshold of 0.25 (half of the final image). By multiplying the threshold, you counter that effect. I'd still make sure it doesn't get any larger than 0.1 or 0.2 though. That adds minimal sampling for some cleanup but won't kill the farm.


If you're only using Motion Blur Passes (MBP) or the Minimum Samples - no Adaptive Sampling - then it's pretty easy to figure out how AA works. More samples means better quality and more time. Say you want to do the old Classic Medium AA. Medium AA did 9 passes. You can set the AA level to 9 and get the same thing, but all rendered in a single pass. Or, you can leave the AA Level set to 1 and increase the MBP to 9. Using the Minimum Samples, all the AA is done at the same time, while MBP does it the old way, one sample pass at a time. These can also be combined. Setting both to 3 will give the same quality as well, doing three passes, with each pass doing 3 samples. Multiply those two values together, and you get 9 again.

Render times will go up proportionately. An image that takes 4 minutes with Minimum Samples of 1 will take 8 minutes if set to 2, or 12 minutes if it's set to 3. The same holds true with MBP. There will be slight time differences, depending on the complexity of the scene. For each MBP, the geometry has to be updated. This included subdivision, deformations, shadow map calculations, etc. All those messages that flash by at the beginning of a render, have to be done at the beginning of each MBP. Obviously, the more passes you render, the more time has to be spent on these pre-render calculations, and that time can add up. If you only use a single pass and just use the AA level alone, then you minimize the time spent on moving geometry. This means that just using a higher Minimum Samples will tend to be slightly faster.

Conversely, deformations, particularly those made through Bones, will take longer if you're using PhotoReal Blur in a single pass, and the greater the deformation, the longer it will take. Bone Deformations tend to be much faster with multiple motion blur passes. See the rule of thumb above.


Adaptive Sampling is a whole new beast now. Every successive pass it does, it re-checks the image for pixels that are over the threshold amount. This means the number of pixels flagged for rendering on each pass can be different. Also, in LightWave 9.2 to 10.1, on each one of these Adaptive passes, the number of samples per pixel DOUBLES, starting with the same number you have the AA set to. The more passes it does, the higher the sampling done on the marked pixels. After a few passes, the sampling number can be quite high. In LW 11, each pass only adds a single sample per pixel, up to the maximum your specified in Maximum Samples.

What is that threshold number? In old LightWaves, before L[6], this number was a value between 0 and 255 and defaulted at 16. The range is consistent with the color space of 24bit images - 8 bits per channel, or 256 levels per channel. When the first render pass was done, the image was analyzed. If the values of two adjacent pixels differed from one another by more than the threshold value, they were considered edges, and were then the only pixels that would take advantage of all future AA passes.

Since L[6], the Threshold is defined in floating point values, where 0 is still black and white is 1 (formerly 255). Rendered pixels can actually have values outside of this range, but they're only useful in image formats that support higher dynamic ranges, like HDR, Cineon, etc.. To convert from the old method to the current, divide the old value by 256. To get the same threshold as the old 16, you would divide 16 by 256, which gives 0.0625. The default of 0.1 (in LightWave 9 & 10) is the equivalent of 25 in 8-bit levels. The default of 0.01 in LW 11 is the equivalent of 2.5 shades.

A simple way to work with this is to just consider it a brightness percentage, because that's what it effectively works out to; 0 is black, 0.5 is gray, or 50%, and 1 is white, or 100%. Color spaces can modify the actual RGBA values, but on a threshold level those differences are negligible; you're usually dealing with variations of less than 5% (a threshold of 0.05), and a color space curve applied to that won't go sending it out of whack since the neighboring pixels will also be skewed similarly.

Higher thresholds means fewer pixels will fall outside the range, so there will be less to render, and the the image will take less time. It also means that more errors can remain in the image - darker edges can still suffer aliasing, and low contrast grain can be left in the renders. Lower values will find more pixels outside the range, and result in longer render times, but higher quality. Threshold values of 0.04 to 0.005 are good, but it's a good idea to start with the large values & dial them down as needed. Anything lower than 0.005 starts dealing with values smaller than the RGB steps and will basically just start wasting time. Usually you shouldn't need to go lower than 0.01

Since Adaptive Sampling checks the image after each render pass, the number of pixels that are outside the threshold can change. Some that were outside the range before may have been antialiased enough that they fall within it, while others might have been refined enough that they're more accurately outside of it. Things like photoreal motion blur, DOF, oversampling, area lights, radiosity or various surface blurring effects - anything that generates random noise or grain - can cause pixels to bounce in and out of the threshold a few times. This means that some details that were missed in the original render pass can be picked up and rendered properly in later adaptive passes. This is different from the previous method that only checked the first pass, which would only see what was actually rendered on that first pass. The would often miss details that fell between the pixels, and since only one check was ever made, anything that was missed would not be rendered. Thin diagonal lines would look like dashed lines in the old method, which is why I called that method "evil".

If you use Adaptive Sampling with a higher Minimum, Samples, you can reduce the amount of work it has to do. Higher Minimum Samples values can generate cleaner images, with less noise for the adaptive passes to work on. This is especially important for 9.2 to 10.1, where each adaptive pass doubles the number of samples per pixel; the less it has to do on the later passes, the better. If it had to do the same number of pixels on every pass, each pass would take twice as long as the previous one. The idea is to generate an evenly dispersed, fine grainy noise in the first render pass, so the AS Passes have something fairly smooth that they can smooth out quicker. If the first pass is too coarse, then the Adaptive Samples will tend to glob up around the harsh points, and the image will look blobby.

As the minimum Samples gets higher, LightWave 9 & 10 will do fewer Adaptive Sampling passes. This leads to a new quirk...

Render time is not always proportional to the Minimum Samples level in LightWave 9.2 to 10.1

In fact, some higher Minimum Samples values, when used with Adaptive Sampling, can actually take less time. The following chart shows how the Adaptive Sampling passes were handled prior in 9.2 to 10.1. All threshold values are rounded to four decimal places, which is all that LightWave will display in the Camera Panel. It can use smaller values than 0.0001, but these will be rounded and only be displayed as 0.0001 or 0.0, but they will still be remembered internally and will be able to add even more passes than shown in the chart. I wouldn't recommend using smaller values than 0.005, as the total number of samples can get extremely high.




He Who Knows He Posted This Before.

Dave Jerrard
02-03-2013, 06:52 PM
Adaptive Sampling Pass Thresholds

AA Level Number of Adaptive Sampling Passes
none 1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 0.9991 0.4998 0.25 0.125 0.0625 0.0313 0.0157 0.0079 0.004 0.002 0.001 0.0005 0.0003 0.0002 0.0001
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384
2 0.4998 0.25 0.125 0.0625 0.0313 0.0157 0.0079 0.004 0.002 0.001 0.0005 0.0003 0.0002 0.0001
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384
3 0.3333 0.1667 0.0834 0.0417 0.0209 0.0105 0.0053 0.0027 0.0014 0.0007 0.0004 0.0002 0.0001
3 6 12 24 48 96 192 384 768 1536 3072 6144 12288
4 0.25 0.125 0.0625 0.0313 0.0157 0.0079 0.004 0.002 0.001 0.0005 0.0003 0.0002 0.0001
4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384
5 0.2 0.1 0.05 0.025 0.0125 0.0063 0.0032 0.0016 0.0008 0.0005 0.0002 0.0001
5 10 20 40 80 160 320 640 1280 2560 5120 10240
6 0.1667 0.0834 0.0417 0.0209 0.0105 0.0053 0.0027 0.0014 0.0007 0.0004 0.0002 0.0001
6 12 24 48 96 192 384 768 1536 3072 6144 12288
7 0.1429 0.0715 0.0358 0.0179 0.009 0.0045 0.0023 0.0012 0.0006 0.0003 0.0002 0.0001
7 14 28 56 112 224 448 896 1792 3584 7168 14336
8 0.125 0.0625 0.0313 0.0157 0.0079 0.004 0.002 0.001 0.0005 0.0003 0.0002 0.0001
8 16 32 64 128 256 512 1024 2048 4096 8192 16384
9 0.1111 0.0556 0.0278 0.0139 0.007 0.0035 0.0018 0.0009 0.0005 0.0003 0.0002 0.0001
9 18 36 72 144 288 576 1152 2304 4608 9216 18432
10 0.1 0.05 0.025 0.0125 0.0063 0.0032 0.0016 0.0008 0.0004 0.0002 0.0001
10 20 40 80 160 320 640 1280 2560 5120 10240
11 0.091 0.0455 0.0228 0.0114 0.0057 0.0029 0.0015 0.0008 0.0004 0.0002 0.0001
11 22 44 88 176 352 704 1408 2816 5632 11264
12 0.0833 0.0417 0.0209 0.0105 0.0053 0.0027 0.0014 0.0007 0.0004 0.0002 0.0001
12 24 48 96 192 384 768 1536 3072 6144 12288
13 0.077 0.0385 0.0193 0.0097 0.0049 0.0025 0.0013 0.0007 0.0004 0.0002 0.0001
13 26 52 104 208 416 832 1664 3328 6656 13312
14 0.0715 0.0358 0.0179 0.009 0.0045 0.0023 0.0012 0.0006 0.0003 0.0002 0.0001
14 28 56 112 224 448 896 1792 3584 7168 14336
15 0.0667 0.0334 0.0167 0.0084 0.0042 0.0021 0.0011 0.0006 0.0003 0.0002 0.0001
15 30 60 120 240 480 960 1920 3840 7680 15360
16 0.0625 0.0313 0.0157 0.0079 0.004 0.002 0.001 0.0005 0.0003 0.0002 0.0001
16 32 64 128 256 512 1024 2048 4096 8192 16384
17 0.0589 0.0295 0.0148 0.0074 0.0037 0.0019 0.001 0.0005 0.0003 0.0002 0.0001
17 34 68 136 272 544 1088 2176 4352 8704 17408
18 0.0556 0.0278 0.0139 0.007 0.0035 0.0018 0.0009 0.0005 0.0003 0.0002 0.0001
18 36 72 144 288 576 1152 2304 4608 9216 18432
19 0.0527 0.0264 0.0132 0.0066 0.0033 0.0017 0.0009 0.0005 0.0003 0.0002 0.0001
19 38 76 152 304 608 1216 2432 4864 9728 19456
20 0.05 0.025 0.0125 0.0064 0.0032 0.0016 0.0008 0.0004 0.0002 0.0001
20 40 80 160 320 640 1280 2560 5120 10240
21 0.0477 0.0239 0.012 0.006 0.003 0.0015 0.0008 0.0004 0.0002 0.0001
21 42 84 168 336 672 1344 2688 5376 10752
22 0.0455 0.0228 0.0114 0.0057 0.0029 0.0015 0.0008 0.0004 0.0002 0.0001
22 44 88 176 352 704 1408 2816 5632 11264
23 0.0435 0.0218 0.0109 0.0055 0.0028 0.0014 0.0007 0.0004 0.0002 0.0001
23 46 92 184 368 736 1472 2944 5888 11776
24 0.0417 0.0209 0.0105 0.0053 0.0027 0.0014 0.0007 0.0004 0.0002 0.0001
24 48 96 192 384 768 1536 3072 6144 12288
25 0.04 0.02 0.01 0.005 0.0025 0.0013 0.0007 0.0004 0.0002 0.0001
25 50 100 200 400 800 1600 3200 6400 12800
26 0.0385 0.0193 0.0097 0.0049 0.0025 0.0013 0.0007 0.0004 0.0002 0.0001
26 52 104 208 416 832 1664 3328 6656 13312
27 0.0371 0.0186 0.0093 0.0047 0.0024 0.0012 0.0006 0.0003 0.0002 0.0001
27 54 108 216 432 864 1728 3456 6912 13824
28 0.0358 0.0179 0.009 0.0045 0.0023 0.0012 0.0006 0.0003 0.0002 0.0001
28 56 112 224 448 896 1792 3584 7168 14336
29 0.0345 0.0173 0.0087 0.0043 0.0022 0.0011 0.0006 0.0003 0.0002 0.0001
29 58 116 232 464 928 1856 3712 7424 14848
30 0.0334 0.0167 0.0084 0.0042 0.0021 0.0011 0.0006 0.0003 0.0002 0.0001
30 60 120 240 480 960 1920 3840 7680 15360
31 0.0323 0.0162 0.0081 0.0041 0.0021 0.0011 0.0006 0.0003 0.0002 0.0001
31 62 124 248 496 992 1984 3968 9736 15872
32 0.0313 0.0157 0.008 0.004 0.002 0.001 0.0005 0.0003 0.0002 0.0001
32 64 128 256 512 1024 2048 4096 8192 16384
33 0.0304 0.0152 0.0076 0.0038 0.0019 0.001 0.0005 0.0003 0.0002 0.0001
33 66 132 264 528 1056 2112 4224 8448 16896
34 0.0295 0.0148 0.0074 0.0037 0.0019 0.001 0.0005 0.0003 0.0002 0.0001
34 68 136 272 544 1088 2176 4352 8704 17408
35 0.0286 0.0143 0.0072 0.0036 0.0018 0.0009 0.0005 0.0003 0.0002 0.0001
35 70 140 280 560 1120 2240 4480 8960 17920
36 0.0278 0.014 0.007 0.0035 0.0018 0.0009 0.0005 0.0003 0.0002 0.0001
36 72 144 288 576 1152 2304 4608 9216 18432
37 0.0271 0.0136 0.0068 0.0034 0.0017 0.0009 0.0005 0.0003 0.0002 0.0001
37 74 148 296 592 1184 2368 4736 9472 18944
38 0.0264 0.0132 0.0066 0.0033 0.0017 0.0009 0.0005 0.0003 0.0002 0.0001
38 76 152 304 608 1216 2432 4864 9728 19456
39 0.0257 0.0129 0.0065 0.0033 0.0017 0.0009 0.0005 0.0003 0.0002 0.0001
39 78 156 312 624 1248 2496 4992 9984 19968
40 0.025 0.0125 0.0063 0.0032 0.0016 0.0008 0.0004 0.0002 0.0001
40 80 160 320 640 1280 2560 5120 10240
41 0.0244 0.0122 0.0061 0.0031 0.0016 0.0008 0.0004 0.0002 0.0001
41 82 164 328 656 1312 2624 5248 10496
42 0.0239 0.012 0.006 0.003 0.0015 0.0008 0.0004 0.0002 0.0001
42 84 168 336 672 1344 2688 5376 10752
43 0.0233 0.0118 0.0059 0.003 0.0015 0.0008 0.0004 0.0002 0.0001
43 86 172 344 688 1376 2752 5504 11008
44 0.0228 0.0114 0.0057 0.0029 0.0015 0.0008 0.0004 0.0002 0.0001
44 88 176 352 704 1408 2816 5632 11264
45 0.0223 0.0112 0.0056 0.0028 0.0014 0.0007 0.0004 0.0002 0.0001
45 90 180 360 720 1440 2880 5760 11520
46 0.0218 0.0109 0.0055 0.0028 0.0014 0.0007 0.0004 0.0002 0.0001
46 92 184 368 736 1472 2944 5888 11776
47 0.0213 0.0107 0.0054 0.0027 0.0014 0.0007 0.0004 0.0002 0.0001
47 94 188 376 752 1504 3008 6016 12032
48 0.0209 0.0105 0.0053 0.0027 0.0014 0.0007 0.0004 0.0002 0.0001
48 96 192 384 768 1536 3072 6144 12288
49 0.0205 0.0103 0.0052 0.0026 0.0013 0.0007 0.0004 0.0002 0.0001
49 98 196 392 784 1568 3136 6272 12544
50 0.02 0.01 0.005 0.0025 0.0013 0.0007 0.0004 0.0002 0.0001
50 100 200 400 800 1600 3200 6400 12800


To keep this relatively clean I didn't put ranges in each column. Instead, each column lists the minimum threshold value for each step. The number under that is the maximum number of samples that number of passes will generate for that threshold. To find where your threshold value fits, locate the row that matches your Minimum Samples, then scan that row, looking for the first entry that matches, or is smaller than, your Threshold setting. For example, the red colored entries match a threshold of 0.03, while the green ones match a threshold of 0.01. Note that as the Minimum Samples value increases, fewer passes are added, and it's possible for there to be no Adaptive Sampling Passes done at all if the value is high enough. In the above chart, when the samples are set to 34 or higher, a Threshold setting of 0.03 or larger will not have any Adaptive Sampling applied. While it's not shown above, an Minimum Samples of 100 or more, even with a threshold of 0.01 will not get any additional sampling, though smaller thresholds will.

As you can see by looking at the right side of the chart, one pass is dropped at increasingly larger intervals. At most intervals, the maximum samples also decreases for a given threshold. For example following the red values for a threshold of 0.03, you can see the maximum samples is 64 when the minimum is set to 1 or 2, but drops to 48 when the minimum is 3. In fact, the maximum amount for a threshold of 0.03 ranges from 34 to 66 samples.

LightWave 11 no longer doubles the samples on each Adaptive Sampling Pass. It only does one sample per pixel for each pass, but does a lot more passes; one pass for each sample above the Minimum Samples. It also does a lot more edge detection - once per pass - since it still checks the image before each pass. With large images, this can add some time about 6 minutes can be added to a 16k x 8k image. The number of Adaptive Sampling Passes it does is entirely up to the user; this is the Maximum Samples setting. As before, LW will render the initial pass using the Minimum Samples, and from there, it will render any AS passes it needs until it determines the image is done, or it has reached the maximum. This lets you add as many AS passes as you need to get the quality you want, with any threshold or Minimum Samples. The maximum number of samples is no longer defined by the threshold in any way, and you no longer have to double the samples or render time to bump up the quality a bit more.


He Who Hates That Character Limit.

OFF
02-03-2013, 09:11 PM
This is a wonderful article, thank you!

Soth
02-04-2013, 02:04 AM
great stuff, thank you for sharing!

50one
02-04-2013, 02:24 AM
Thanks for posting, lots of useful info!

Hail
02-04-2013, 03:15 AM
Very insightful! Thanks Dave.

daforum
02-04-2013, 03:43 AM
Thank you Dave. This is great reference :)

Can you also explain how Oversampling works aswell?

daforum
02-04-2013, 03:45 AM
EDIT: Double post so deleted!!

PeT
02-04-2013, 05:00 AM
merci @ dave !

GraphXs
02-04-2013, 04:07 PM
Thank you!

tburbage
02-04-2013, 06:41 PM
Funny, Dave, I came looking for your earlier posts just over the weekend. Thanks for re-posting.

He who wishes you might consider videos or book update to the great "LightWave Applied" sections on shading and rendering including nodal now. :]

JamesCurtis
02-04-2013, 11:01 PM
What LW needs are some Presets that would at least give one a jumping off point to start out from. I've been racking my brain trying to come up with a good setting to get a project that has over 7000 frames [21 scenes] to render for a trade show video [1280 x 720 HD] for a client.

BTW, are there any good renderfarm places that can do LW scenes and have or can use the plugins I'm using? I'm in the US.

m.d.
02-04-2013, 11:10 PM
Garagefarm

vncnt
02-04-2013, 11:35 PM
What LW needs are some Presets that would at least give one a jumping off point to start out from.

Do we have some script examples that demonstrate how to set render quality related parameters?
A listbox and Load/Save button maybe.
That could be used as a personale preset system.

pablogrca1
02-05-2013, 04:13 AM
Thanks Dave!

evolross
02-14-2013, 07:31 PM
Awesome, hyper-detailed, write up. Thank you. :bowdown: And yes... let's hear about oversampling! One question...


...Color spaces can modify the actual RGBA values, but on a threshold level those differences are negligible; you're usually dealing with variations of less than 5% (a threshold of 0.05), and a color space curve applied to that won't go sending it out of whack since the neighboring pixels will also be skewed similarly....

So does this answer the question that was going around that AA/AS was screwed up in LW10 when using linear workflow? Because of it working on linear colors versus sRGB colors? I remember a lot of debate about that, but I honestly can't remember the details. But I'm curious as currently at my place of work, we render in LW 11.0.2 using linear workflow but save our output in sRGB space because that's supposed to make AA better and/or more correct. I'm not sure I understand it, but your above comment makes it sound like this is a non-issue. Or am I not understanding correctly? In the past when using linear-workflow, I've always just saved to linear EXR and never seemed to notice any AA problems.

Celshader
02-14-2013, 07:43 PM
He who wishes you might consider videos or book update to the great "LightWave Applied" sections on shading and rendering including nodal now. :]

If you have access to the LightWave 11.5 content, open up the BenchmarkMarbles (http://forums.newtek.com/showthread.php?133251-11-5-s-BenchmarkMarbles-lws-share-your-machine-s-render-time-here) scene and look through Dave Jerrard's node networks on each surface. Dave wrote descriptive comments on every single node in each surface's Node Editor. Click each node to read its comment at the bottom of the Node Editor.

BokadCastle
02-14-2013, 09:14 PM
must have been a late night -
"This inverst the Checkerboard output so the bumps of the 1st image only appear int eh opposite quare of the second. Without this, they'd blend togething in the same checks."
Node editor - Ground

m.d.
02-15-2013, 02:05 AM
AFAIK
Oversample will fire samples outside the pixel boundary to the level you set....softening the transition between neighbouring pixels and speeding up the AS....
It will usually speed up render time at the cost of loss of detail.....

Riff_Masteroff
02-15-2013, 02:11 AM
And I thought Dave did not use LW anymore.

The BenchmarkMarbles.scn and the related thread here on NT forums will be of much use to me . . . . . soon. I want to compare my current XP64 / Intel QX6850 / LW11.5 with a near future Win7-64 / Intel I7-3970X / LW11.5. These workstations are of the same type: high end consumer cpu / internal RAID 5 driven by add-on card / decent amount of RAM / decent vid card. . . . . . separated by 5 1/2 years of tech advances. I will post my results on the appropriate thread soon enough.

Tnx Dave and Jen.

Dave Jerrard
02-18-2013, 03:48 AM
Awesome, hyper-detailed, write up. Thank you. :bowdown: And yes... let's hear about oversampling!

No sir... I don't like it!


Just kidding. :D

Oversampling allows the sample pattern for the current pixel to spread out into adjacent pixels. With the Classic pattern, which is a disc of samples, the corners of the pixel were not rendered, so details that my be in this area would be missed during a render. That sampling pattern is really full of holes. Think of a bunch of discs in a box; even packed as tightly as possible, there's still a lot of empty space between them. In a grid arrangement, that empty space works out to about 30% of the total area! That's a lot of non-rendered stuff that could cause weird artifacts. But if you make those discs overlap by making them bigger, those holes can be closed up. Also, by taking samples from just outside the current pixel, you get a slight softening or blurring of the image, but at a subpixel level. This is similar (thought not identical) to what happens when you scale an image down in an image editor; information from adjacent pixels is blended with the current pixel. You get a slightly softer, less CG-looking image than you normally would. I kind of mimics what happens with film, where light hitting film scatters through the emulsion slightly, so no matter how sharply focused the image is, every edge is very slightly blurred. This also frequently has the effect of reducing moire patterns in a render.

The numeric value is how many pixels the sampling pattern can cover outside of the current one. A value of 1.0 will mean that each pixel being rendered is actually being sampled from NINE pixels, so the eight surrounding pixels are also basically considered the same pixel as the one actually being rendered. The weighting of these is lower though, otherwise they would supply eight times more info than the pixel in the middle (except in the case of the Classic pattern again, which would be a bit lower due to the disc shaped pattern. The other patterns all render a square shaped pattern, so all nine pixels would entirely covered. A value of 2 would spread the samples over the next two pixels in all directions, so you'd be rendering 25 pixels. A value of 0.5 will spread the pattern 50% into the neighboring pixels. In this case, the four pixels to the sides of the current one would have samples taken from only the nearest half, while the four diagonal ones would have samples taken from the nearest quarter. Imagine a grid, and color in one square. Then overlay another square that's larger, by twice the oversampling value (0.5 on each side would make a square that's twice as big), centered on the colored one, and you'll get an idea of how the coverage works. With values that are whole numbers, that coverage encompasses full adjacent pixels, while other values will provide partial coverage to the outermost pixels.

Note that as the value increases, the number of samples falling within the actual current pixel is reduced; a value of 1 (assuming a non-Classic pattern) means that that it's only getting 1/9th of the total samples, and since Oversampling uses a simple triangle weighting method (the importance of each sample drops off in a linear fashion from the center of the pattern to the edge), each covered pixel is actually loosing a fair amount of info, so you may actually have to render more to compensate. Adaptive Sampling will usually cover this automatically for you, if you have enough AS passes.





AFAIK
Oversample will fire samples outside the pixel boundary to the level you set....softening the transition between neighbouring pixels and speeding up the AS....
It will usually speed up render time at the cost of loss of detail.....

Not necessarily. It can add more time, due to the additional noise it can generate around edges. So, instead of just working with a single sharp edge, it would now be working with a thin gradient that has more pixels that fall outside the AS threshold.


Problems with Oversampling:

The entire image gets blurred. The larger the Oversampling amount, the more blur you get. Too much, and the image starts to break up.

Can actually add time to a render.

Best used with Box or Classic Reconstruction Filters. All others do edge enhancement or their own blurring effects. Gaussian does its own version of oversampling.

It can also add in new moire patterns! If the coverage area for each pixel overlaps the coverage of the next pixel, you can get secondary moire patterns. A value of 0.5 or less will not overlap, and probably gives the best results. Smaller values will leave a gap between the coverage areas while anything larger will create a grid of higher sampling areas. On a checkerboard, you'll see larger & larger, though slightly softer, moire patterns occur at




So does this answer the question that was going around that AA/AS was screwed up in LW10 when using linear workflow? Because of it working on linear colors versus sRGB colors? I remember a lot of debate about that, but I honestly can't remember the details. But I'm curious as currently at my place of work, we render in LW 11.0.2 using linear workflow but save our output in sRGB space because that's supposed to make AA better and/or more correct. I'm not sure I understand it, but your above comment makes it sound like this is a non-issue. Or am I not understanding correctly? In the past when using linear-workflow, I've always just saved to linear EXR and never seemed to notice any AA problems.

I haven't noticed a difference in Adaptive Sampling results between 9.6 and the 10.x versions. What can happen when you covert the image to sRGB or other color spaces that brighten the image is that since the image is brighter, you can more easily see grain in the image. If this becomes an issue, then increase your Minimum Samples in 10.x to see if that helps. If you're going to push the image in post a lot, then you'll want to use a smaller threshold, and more samples. You don't want to jump to a lower threshold that will double your maximum samples right away; try speedier options first. If you really want to lower the threshold, then use that sampling chart I posted earlier to see where Layout's going to add a new pass, and try something slightly higher, so you get the benefit of a smaller threshold without triggering another pass. Also check your surfaces for the number of samples; nodes that use blurring for Reflection or Refraction, or that do any SSS effects all have a Samples setting. The lower these are, the faster the render, but again, they can be noisy, but these usually clean up quite fast. I tend to stick with 1 for these, and only increase that if it's absolutely necessary. Remember, if you increase this, you increase it for EVERY camera sample as well; it will slow down the rendering of every pixel. The same goes with light quality. In 9.6 and 10.x I tend to use a quality of 2. This number is actually squared internally, so the true number of samples this uses is 4. Occasionally I'll use a value of 1 here, mainly for smaller area-type lights, and sunlight, which create sharper shadows. For fluorescent and other extra-soft lights, I'll stick with a quality of 2. If a light is still rendering noisy, then I'll bump that light up to 3 or higher. In 11, the number of samples for surfaces and lights has been moved, taking a lot of control out of our hands. Luckily, since LW11's new Adaptive Sampling checked the image on EVERY pass instead of doubling the samples, you can see a good time savings here. You can lower the threshold and only see a marginal increase in render times, and yet get a fairly good boost in quality. I generally use a Min/Max of 3/48 with a threshold of 0.01, and have found very little reason to use more samples, except in extreme cases like the Benchmark Marbles, which is lit entirely by Monte Carlo radiosity and an HDRI environment. It stills look pretty good with only 48 samples, but there's a definite quality boost with double that.




must have been a late night -
"This inverst the Checkerboard output so the bumps of the 1st image only appear int eh opposite quare of the second. Without this, they'd blend togething in the same checks."
Node editor - Ground

Just a creatively rebellious keyboard. 8~


He Who Thinks That Node Editor Could Use A Spell Checker.

tburbage
02-23-2013, 03:36 PM
If you have access to the LightWave 11.5 content, open up the BenchmarkMarbles (http://forums.newtek.com/showthread.php?133251-11-5-s-BenchmarkMarbles-lws-share-your-machine-s-render-time-here) scene and look through Dave Jerrard's node networks on each surface. Dave wrote descriptive comments on every single node in each surface's Node Editor. Click each node to read its comment at the bottom of the Node Editor.
I'm looking through these over the weekend.

I never would have noticed the comments if you hadn't mentioned it. BTW, is there a way to apply comments to the nodes via the UI? I looked at an exported .nodes file in Emacs and see the Comment field, so I see how one might do it that way...

RebelHill
02-23-2013, 03:56 PM
is there a way to apply comments to the nodes via the UI?

Type in in the same place you read in... in the text line at bottom of the editor... http://www.youtube.com/watch?v=7BV73Y4-NDE&list=PL1C4072533A16B807&index=2

evolross
02-27-2013, 12:51 PM
So does this answer the question that was going around that AA/AS was screwed up in LW10 when using linear workflow? Because of it working on linear colors versus sRGB colors? I remember a lot of debate about that, but I honestly can't remember the details. But I'm curious as currently at my place of work, we render in LW 11.0.2 using linear workflow but save our output in sRGB space because that's supposed to make AA better and/or more correct. I'm not sure I understand it, but your above comment makes it sound like this is a non-issue. Or am I not understanding correctly? In the past when using linear-workflow, I've always just saved to linear EXR and never seemed to notice any AA problems.
This is a non-issue now with 11.5, there is a bug in 11.0.2 (and likely all earlier versions) where changing just the Output Color Space in the Color Space settings would actually cause Lightwave's renderer to anti-alias your image's pixels in whatever Output Color Space you select (e.g. linear or sRGB). So if you set Output Color Space to linear, the renderer, with the same AA/AS settings, would render a less smooth, grainier image. I'm not exactly sure why, but the AS would work on more of the image and when you lifted the image up to sRGB you could see much more grain in falloff areas. With Output Color Space set to sRGB, the renderer's AA would work on pixels in sRGB space, which would render a much smoother, less grainy result in the same amount of time. So if you wanted to save files in linear color space (as you should if you're using EXR and any linear compositing package (e.g. Nuke)), you'd have to crank the AA/AS up higher to get the same quality if you saved in sRGB (and hence have longer render times). This was why we set all of our renders' Output Color Space to sRGB, you could get better quality in less time. We just saved in a format (e.g. EXR, TIFF_FP) where we could convert it back to linear for compositing. In 11.0.2, that's how it works (and obviously wrong). :stumped: You could really notice it in grainer images with light falloff like this one:

112013

If you're curious, create a little test scene like this and give it a try in 11.0.2 (or earlier versions). Set up the scene with good AA with the Output Color Space set to sRGB, then set ONLY the Output Color Space to linear (change nothing else) and watch it affect your render quality when you lift the linear render back up to sRGB. I don't have 11.0.2 at home anymore so I can't demonstrate.

Fortunately it's been fixed in 11.0.3 and in 11.5. Output Color Space does nothing except what it should: set the color space for a saved file using F10. The renders look identical now, as they should. And I assume AA is always occurring on the pixels in the linear color space.

Did anyone else ever notice this?

Tobian
02-27-2013, 05:43 PM
It's not a 'bug' so much as a design choice I am not a fan of :D Basically the 'output colourspace' is what is used by LW to modify the threshold of the difference sensitivity for adaptive sampling. If you render in Linear, but display using sRGB, then pixels close to black get pulled apart more: Point in case if you add an ambient light setting of 5% that translates to about ~25% added 'light' once you add the sRGB profile, even 1% adds about ~5% 'brightness' which is why it's really best to set ambient light to 0. Likewise when you set your AS to 0.01 that's basically akin to saying 1% difference between neighbouring pixels, which optically is hard to distinguish, however, when the gamma curve is applied, that becomes ~5%, which transforms visually indistinguishable grain into horrible noise.

So if you are working with linear work-flow, and use the sRGB profile, then you need to set your 'output colourspace' to sRGB also, and ideally set your threshold to below 0.01 (I usually have mine set to between 0.008 - 0.002) as that only covers 100 'steps' and most displays show 256 steps of luminance. Ideally they should have an 'adaptive sampling threshold colour space' dropdown in either the CS settings, or in the AS settings.

ivanze
03-03-2013, 08:31 PM
What I would like to know is how to get the antialias you get with the classic camera with the perspective camera. I think the Classic camera antialias looks better and I've been trying to get it with the perspective camera but couldn't. Besides, sometimes the classic camera is faster with some scenes.