Using V-Ray denoiser tool (vdenoise.exe) with send to scripts + Backburner submission.

General Idea.

This is going to be quick tip for anyone who would love to easily denoise sequence of exr files with vdenoise.exe without typing in commands manually. This workflow could also be used for number of different tools or scripts like encoding video with ffmpeg or converting exr sequence to mov using DJV.

The trick is to use windows send to scripts. If you don’t know it yet, in Windows you can create custom .bat files that will run commands from under right mouse button’s send to menu. This is very helpful if you want to automate some file processing tasks and save a lot of time in the process.

Denoising sequence of files locally.

Denoising after render is extremely helpful as this way vdenoise.exe can use neighboring frames for improved results. Below is example of script that will convert sequence of layered .exr files from V-Ray. It will only work if you setup render with denoiser render element.

Basic Script will go like this:
@echo off
set input=%1
set denoiser_input=%input:~0,-8%????.exr
"C:\Program Files\Chaos Group\V-Ray\3dsmax 2016 for x64\tools\vdenoise.exe" -inputFile="%denoiser_input%" -useGPU=2 -display=0
pause

To use this script just go to run (windows+R) type in this command below and press Enter. shell:sendto
This will open up folder containing all your send to scripts. Just create one called “denoise_sequence.bat” and copy the content of above’s basic script. When naming the file remember that windows hides file extension by default (https://support.microsoft.com/en-us/kb/865219)

Also you may need to change path to vdenoise.exe depending on your V-Ray version and installation directory. I also added -useGPU=2 to use all available GPUs in given workstation and -display=0 to not show denoising window. Feel free to change those or add more options.

Once you’ve done this go and test it out by running on an sequence that you want to denoise RMB->Send to -> denoise_sequence . Doing this will popup command window where you can track progress of the denoising.

s5eb90b4b-50b7-434d-aca9-2c40c16059ecM

Also here is a little updated version of the script that will work with spaces in filenames and also with vrimg files:

@echo off
set input=%~f1
IF %~x1==.exr (set denoiser_input=%input:~0,-8%????.exr)
IF %~x1==.vrimg (set denoiser_input=%input:~0,-10%????.vrimg)
"C:\Program Files\Chaos Group\V-Ray\3dsmax 2016 for x64\tools\vdenoise.exe" -inputFile="%denoiser_input%" -useGPU=2 -display=0
pause

Denoising using Backburner.

Now once you know how to do that, lets write a little bit more complex script that will add sequence for denoising as Backburner Job. I will assume you know what Backburner is and it’s correctly setup in your network.

Script goes like this:

@echo off
set input=%1
set filename=%~n1
set denoiser_input=%input:~0,-8%????.exr
set jobname=%filename:~0,-5%
"C:\Program Files (x86)\Autodesk\Backburner\cmdjob.exe" -jobname:%jobname% -manager:Manager_IP_address -numTasks:2000 "C:\Program Files\Chaos Group\V-Ray\3dsmax 2016 for x64\tools\vdenoise.exe" -inputFile="%denoiser_input%" -useGPU=2 -display=0 -frames=%%%tn
pause

Modify paths to executable if needed and specify correct manager_IP_address.

This one will call out cmdjob.exe and create job with 2000 tasks of which every single one will try to denoise frame corresponding to task number. You may change this to higher number for different sequence ranges than 0-2000 or you could write something smarter that will actually find out what is the range of sequence and create exact number of tasks.

sd6e87cde-0535-461e-b695-2c77db788e95J

Those 2 little scripts can easily be modified to fit your workflow. Check what kind of options are available in cmdjob.exe or vdenoise.exe by trying to run it from CMD.

Featured image is still frame from one of the latest videos we’ve produced with the help of denoiser. https://www.instagram.com/p/BHuWcRmD8gf/?taken-by=dabarti_cgi

Have Fun!

You might also enjoy!

Software

Dabarti Capture Released!

I’m very proud to announce that Dabarti Capture,  a new command line tool for creating normal, albedo and displacement maps from multiple photographs. Check it out https://dabarti.com/capture/

Read More »