Compositing Aware Adaptive Sampling (incl. proposed algorithm)
I do a lot of compositing where large chunks of the scene might be masked out entirely for portions of the animation
EX: 3 render layers, one of the outside of a machine, one of the inside with different lighting, a BW mask layer, and then an animated composite to mix between the two, creating an x-ray effect
This means that for say, 50% of the shot, a massive chunk of the outside render layer isn't even being used, but is sucking up render time anyways.
While this is kind of a moonshot, I was thinking there's probably a way to predict the amount of samples needed based on composing by doing the following:
- Do a pre-pass, with a low amount of samples like 2 or 3. Probably a good idea to let the user define this.
- Run the pre-pass through compositing. Measure the amount each layer contributes to the final image, and build up a 2D value map between 0-1, where 0 means that pixel contributes nothing, and 1 meaning that pixel is 100 percent visible
- Actually render all render layers, but multiply the samples required for that pixel by the value in that layer's value map from step #2. A UI slider called "Influence," can lerp between the value map samples and 100% of the original samples, allowing the user to fix any edge cases where this might not work that well.
This should result in pixels that will ultimately be masked out not being sampled at all, while pixels that are visible get full sampling. Any pixel in between will have reduced sampling which should save time.
0 Comments