chunky
chunky copied to clipboard
Selective sampling
Let's say I have a large render that's mostly clean, like the following one:
Where most of the noise is concentrated in a small area of the image because of the high density of emitters compared to the rest of the scene. It will probably take another 10-40k SPP to clean that noise up. At 1920x1080, that could take a while, considering the given render is currently at 13k SPP after about five hours.
Would it be possible to select only that area of the image to continue rendering?
If I understand path tracing correctly, the sampling is based on pixels, so it should be as simple as bounding further sampling to the selected area.
With a reduced sampling area, it should be as clean as the rest of the image in a lot less time than it would have taken sampling the image as a whole, with the render time shortened roughly proportionally by how much smaller the selected area is compared to the canvas.
I've done similar things by doing multiple renders with different camera angles, then stitching them together in GIMP. This would be waaaay more convenient.
The image is split into tiles based on the tile width setting (I think default is 8x8 pixels). The tiles are then processed one by one as "jobs" by the render worker threads. It would be relatively simple to exclude certain tiles from the rendering, the problem is only to implement this in the UI in a convenient manner.
Another approach is to try and exclude areas of the image that we know have already converged. The sky is a good example. The sky color can be determined immediately and does not require further rendering yet the path tracing algorithm is fair, and will continue rendering the sky. One idea would be to mark pixels that are known to contain only sky samples and then skip taking samples for those pixels.
How hard would it be to implement a noise detection algorithm?
For the UI, I was just thinking a button in the render controls enables the user to drag a selection box across the render preview, and then that selection box becomes the bounds for the rendering.
All currently available research I have found points to noise detection being impractical.
How about identifying possible problem areas, like high concentrations of emitters?
It's usually not noisiest close to emitters - rather a distance from them. Very difficult to estimate.
So manual control would be best, then.
I'm thinking a section on the Advanced tab titled "Selective Sampling", "Bounded Sampling" or "Targeted Sampling".
A checkbox to enable it.
A button labeled "Select Sampling Area". When clicked, it opens the preview if it's not already open. A dialog appears, instructing the user what to do:
Please drag a selection across the preview for targeted sampling.
After the user clicks OK, the dialog disappears and the preview window is focused. The user can then click and drag to create a selection box across the preview. Another dialog appears, saying:
Begin sampling selected area?
With buttons labeled "Ok" and "Redo". If the user clicks "Ok", the dialog disappears and the area is set. If the user clicks "Redo", then the previous dialog reappears and they can repeat the procedure.
The render manager would receive the selected area's dimensions, and bound each jobId
to ensure that its tile would at least partially fall within the bounds of the area.
Maybe to show the selected area on the preview while it's rendering, everything else could be masked out by a semi-transparent color, as an option.
Yeah I was also thinking of being able to select it myself. I understand that rendering algorithms are tricky. I was also considering literally changing the camera view and selecting rectangular areas with greater noise to render better, but that seems quite complicated haha
Honestly it might be easier if we had a it would solve a lot of issues cause then we could sample only the emitters which would help a lot, cause we could start out by sampling everything but the emitters then switch to emitters only and set another SPP target.
Easiest way would be to do it the same way the denoiser works, have your skylight renderer, sunlight renderer, and emitter renderer; then you can set your target for each layer to save time rendering.
But if you wanted to go the extra mile, being able to select individual emitters and turn them off would be better, because then we could actually fix problem spots a little easier.
I believe that lens shift would be a somewhat complicated way to achieve this result, by narrowing the canvas to be one specific area of the larger canvas. Then only the pixels in the new smaller canvas are being sampled.