Blender Git Commits

Blender Git "temp-cycles-denoising" branch commits.

Page: 14 / 17

July 24, 2016, 01:02 (GMT)
Merge remote-tracking branch 'origin/master' into soc-2016-cycles_denoising

Conflicts:
intern/cycles/kernel/kernel_types.h
July 24, 2016, 00:54 (GMT)
Cycles: Also prefilter and use the shadow feature pass with CUDA
July 24, 2016, 00:51 (GMT)
Cycles: Use the prefiltered shadow feature for denoising

This commit finally adds the prefiltered shadow feature to the main denoising algorithm.
Doing so improves detail preservation a lot: Although the main focus are sharp shadow edges, it actually also helps for Ambient-Occlusion-like and geometric details.

The only issue is that some geometric edges might be a bit noisier after denoising, but that will be fixed in the future by downweighting the shadow feature
when the geometric changes (normals and depth features) are strong.
July 24, 2016, 00:37 (GMT)
Cycles: Prefilter the shadow feature passes

The previous commit already generates the features, but they're quite noisy, which is unacceptable for a LWR feature since it leads to noise in the result.

The filtering algorithm is:
1. filter_divide_shadow:
- Divide the R and G channels of both passes to get two noisy shadow passes
- Scale the B channels and combine them to get the approximate Sample Variance
- Compute the squared difference of the A and B divided passes to get the correct, but also noisy, Buffer Variance
- Compute the squared difference of the A and B Sample Variances to get the variance of the Sample Variance estimate
2. filter_non_local_means:
- Smooth the Buffer Variance using Non-Local Means with weights derived from the Sample Variance pass
3. filter_non_local_means:
- Smooth the A and B shadow passes using Non-Local Means with weights derived from the other pass (B to smooth A, A to smooth B) and from the smooth buffer variance.
4. filter_combine_halves:
- Compute the squared difference of the A and B smoothed shadow passes to estimate the residual variance in the channels.
5. filter_non_local_means:
- Smooth the two passes again using each other and the residual variance for weights.
6. filter_combine_halves:
- Average the two double-smoothed passes to obtain the final shadow feature used for the LWR algorithm.

Although the algorithm might sound rather slow, that's not the case. This can be seen by reducing the half window: Doing so reduces the time LWR takes, but the prefiltering stays the same. So, since the time used can be reduced drastically with the half window, prefiltering can't be the bottleneck.
Also, the amount of repeated smoothing sounds like it destroys fine details. However, that is not the case: Due to taking variance into account and the remarkable quality of the NLM filter, details that only span a couple of pixels are still preserved without blurring.

The final feature isn't used yet, that will be added in the next commit.
July 24, 2016, 00:29 (GMT)
Cycles: Generate and fill the Shadow feature passes

This commit makes the path tracing kernel generate the needed data for the shadow passes and fill them.

The approach used here is quite similar to a shadowcatcher:
The R channel of the passes records the total energy of direct light queries, no matter whether they were shadowed or not.
The G channel records the amount of energy that actually was unoccluded. Therefore, dividing G by R produces a accurate pass containing the amount of shadowing (between zero and one, since G can never be larger than R).
The B channel contains an approximation of the variance of the shadow info.
However, since Var[E[Unoccluded]/E[Full]] (which is what would be needed) is impossible to compute analytically from the samples, Var[Unoccluded/Full] is used instead (Variance of the individual ratios at each sample, instead of the variance of the ratio of the mean values after sampling).
That's both biased and actually might not even be close, it still is of use in prefiltering: The correct variance can be estimated (with a lot of noise) from the difference of the A and B passes, and the approximation in the B channel can be used for the weights used to prefilter the noisy, but correct variance.
July 24, 2016, 00:29 (GMT)
Cycles: Add two shadow feature passes

These two passes will both hold the same feature, but one will be filled with data from even samples
and the other with data from odd samples. That allows to estimate buffer variance and prefilter it better later on.
July 24, 2016, 00:26 (GMT)
Cycles: Fix combined feature bandwidth calculation

As explained in the code, the bandwidth variables actually store the inverse of the bandwidth
to save a couple of divides. However, if the bandwidth is to be multiplied with a factor, that means
that the variable must be divided by that factor, which was not done currently.
July 24, 2016, 00:24 (GMT)
Cycles: Tweak order of denoising feature vector to improve quality of results

This commit reorders the denoising features: Instead of "Normals, Texture, Depth, Screen position"
the order now is "Screen position, Depth, Normals, Texture" like in the old demo code, which significantly
improves result quality.
July 24, 2016, 00:21 (GMT)
Cycles: Add temporary debugging environment variable, fix debug file extensions

As explained previously, CPUs currently get the out-of-tile pixels for denoising
from neighbor tiles, while GPUs just render bigger tiles internally.
However, implementation differences can make the GPU version (aka "overscan" rendering)
fail while the CPU code works.

Therefore, this commit adds a environment variable check for whether CPU_OVERSCAN is defined,
and enables the already-present CPU single-tile overscan mode for easier debugging.
Note that this has no benefits at all for regular use and will be removed later!
July 24, 2016, 00:20 (GMT)
Cycles: Fix Denoising feature pass generation when using OSL
July 24, 2016, 00:20 (GMT)
Cycles: Fix border rendering once again with Denoising
July 19, 2016, 11:29 (GMT)
Fix playerstubs
July 18, 2016, 18:37 (GMT)
Merge remote-tracking branch 'origin/master' into soc-2016-cycles_denoising
July 18, 2016, 17:48 (GMT)
Cycles: Fix NaN smooth normals
July 18, 2016, 17:47 (GMT)
Render API: Preserve extended passes when using bordered rendering
July 11, 2016, 20:46 (GMT)
Merge remote-tracking branch 'origin/master' into soc-2016-cycles_denoising

Conflicts:
intern/cycles/kernel/kernel_types.h
July 11, 2016, 20:41 (GMT)
Cycles/Render API: Implement interactive updating while denoising

The tile highlighting is still a bit random and the progress bar isn't showing either,
but the basic live update works.
To avoid lots of duplicated code, editors/render and editors/space_image now share two functions.
July 11, 2016, 17:37 (GMT)
Cycles: Fix Memory leak when denoising renderred images
July 11, 2016, 17:36 (GMT)
Render API: Implement the denoising process as a job to keep the UI responsive
July 11, 2016, 16:25 (GMT)
Cycles: Support denoising after rendering on CUDA
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021