Dopoise | Denoise
A tool to harness RenderMan 25's AI Denoiser and dispatch the workload to the farm with Tractor.
I created this tool in collaboration with Adrien Lhabitant, check out his personnal website : https://www.lhabitantadrien.com/
You can find bellow an article with in-depth technical explanation of our process.
| Introduction
During the creation of our student films, we are facing multiple technical and structural challenges. With our limited computer resources shared among the different productions, we must find solutions to reduce render time and optimize the use of each machine without sacrificing quality.
​
Intrigued by the recent release of the AI denoiser in Renderman 25, we gave it a try and witnessed immediately huge results across our wide range of examples, including :
fur, dense scattering, extreme motion blur, very low sampling and more !
​
Consequently, we considered integrating it into our production pipeline. However, the graphical interface had some limitations and the denoised images outputed as separated exrs were, in our case, obstacles to a production use. Additionally, quality comes at a cost, so we had to consider deploying it with the Tractor dispatcher on our render farm.
| Project Development
Initially, we explored the tool's functionality via the command line rather than the interface wich we had determined un-optimal. We identified the first challenge of providing the right type of each AOV to the denoise algorithm. We also had the need to merge the denoised EXRs of each AOV, which we achieved using the “exrmerge” tool provided by Renderman.
Now that we had a functional workflow, the goal was to achieve a tool capable of handling large amount of frames, layers, custom AOVs & light groups and transfer the workload to the renderfarm.
We automated this lengthy and tedious process using a Python script that handles the entire process for all frames of each layer in a given shot. The process goes as follows :
Actually the major issue comes from the denoiser itself; it tends to generate a "PyRunSimpleString failed" error potentially related to saturated RAM. (reminder : crossframe denoising is more RAM intensive) It’s mostly anoying while denoising locally because the process needs to be restarted from the beginning. Meanwhile on tractor we recommend setting 1 “frame per server” and take advantage of the “max active task” parameter we’ve put in the UI to limit the impact of your job in the renderfarm. This way if a frame fails you can restart it without loosing any previous frame progress.
Despite reducing the problem of denoiser failure by isolating it on Tractor, we still needed to ensure that all images were available the next day. Hence, I developed a script called TJM ([[TJM|Tractor Job Manager]]), which ensures to retry each denoising task that fails.
TJM uses the Tractor API in Python 2.7.
Their is a minor issue hidden later in the production pipeline :
when applying unpremult at the compositing phase, we noticed artefacts appearing, they go away when applying premult. These seems to be due to extremely low values in the alpha channel (around 10e-7).
We use an expression to to get rid of them and haven’t noticed any further problem.
In the alpha section of the expression node : a * (1-step(a, 0.01)) you can adjust the 0.01 threshold to your liking.
| Technical Limitations
First, the user selects the folder containing the images, he then can proceed to select a type for the AOVs he wants to denoise (diffuse, specular…).
The script takes over from here, it sorts the exrs in different folders based on their type : beauty, utilities and cryptomates. It then proceeds to generate either TCL (tractor) or Batch (local) code containing all the denoising and merging instructions and runs them either locally or handing them to the renderfarm.
Meanwhile, the script operates an identification in the shot folder to detect the AOVs using the “exrinfo” tool provided by Renderman. It then detects the light groups if some are presents; therefore no user input is required, resulting in a quite flexible tool.
When the AOV part is done, the user can chose to either denoise locally or on the renderfarm using Tractor, for wich he may adjust the job parameters.
And eventually the user can chose to denoise using crossframe mode or not.