HtoA: Denoising AOVs with the Arnold Denoiser


HtoA lets you edit the layer names, and that’s how to generate the variance AOVs for denoising.

  • Add two AOVs with the same name (I used “custom” here), but give the second one a “_variance” layer name (“custom_variance).
  • Change the Pixel Filter to variance.
  • Render some EXRs (in my screenshot below, I should the part of the Arnold log that tells you that the variance AOV was rendered too)
  • In the Arnold Denoiser, put the AOV names in the Light Group AOVs text box.

HtoA and Python 3


If you see messages like this when you try to use HtoA

Syntax error: Missing parentheses in call to 'print'

or

AttributeError: '_Environ' object has no attribute 'has_key'

or

CreateProcess failed

that means the you have the Python 3 version of Houdini installed.

HtoA 5.6.1 and older do not support Python 3 yet, so you need to download and install the Python 2.7 version of Houdini.

You can get the Python 2.7 version of Houdini here: https://www.sidefx.com/download/daily-builds/?production=true

Deselect Python 3 to get the Python 2.7 versions of Houdini

[MtoA] Denoising AOVs with the Arnold Denoiser


To denoise AOVs, you need to add variance AOVs:

  1. Enable Output Denoising AOVs
  2. Add a new output driver to the AOVs, and set the filter to variance
  3. Tell noice to denoise the AOVs: enter the AOV names in the Light Group AOVs text box (or, if you’re using the command-line, add -l flags for each AOV)

When you denoise the AOVs, you’ll see something like this in the Arnold Denoiser log:

C:\Program Files\Autodesk\Arnold\maya2020\bin\noice -i C:/project/images/denoiser_test.0002.exr -o C:/project/images/denoiser_test.0002_denoised.exr -ef 0 -sr 9 -pr 3 -v 0.5 -l diffuse -l direct -l indirect -l specular 

Denoising image C:/project/images/denoiser_test.0002.exr 
------------------------ (1/1)
noice 6.2.0.1 [903992ac] - the Arnold denoiser
Using 48 threads.
Loading images...
Loading file "C:/project/images/denoiser_test.0002.exr".
Using feature AOV 'diffuse_albedo' with filter 'gaussian_filter'
Using feature AOV 'N' with filter 'gaussian_filter'
Using feature AOV 'Z' with filter 'gaussian_filter'
Working with 1 frame at 960x540
Will denoise AOV "RGBA", using associated variance
   Output file will be "C:/project/images/denoiser_test.0002_denoised.exr"
Will denoise AOV "diffuse", using associated variance
   Output file will be "C:/project/images/denoiser_test.0002_denoised.exr"
Will denoise AOV "direct", using associated variance
   Output file will be "C:/project/images/denoiser_test.0002_denoised.exr"
Will denoise AOV "indirect", using associated variance
   Output file will be "C:/project/images/denoiser_test.0002_denoised.exr"
Will denoise AOV "specular", using associated variance
   Output file will be "C:/project/images/denoiser_test.0002_denoised.exr"
Start denoising (patch radius 3, search radius 9, variance 0.5)
Denoising RGBA
Denoising diffuse
Denoising direct
Denoising indirect
Denoising specular
Finished denoising
Saving image C:/project/images/denoiser_test.0002_denoised.exr (960 x 540 x 16)

How to get a list of AOVs and LPEs


Here’s a simple kick trick to get a list of AOVs and LPEs.

The -laovs flag lists all the AOVs in the loaded scene, but if you give kick no input, you’ll get a list of all built-in AOVs defined by Arnold.

For example, on Windows, run kick -laovs -i Nul

On Linux or macOS, run kick -laovs -i /dev/null

kick -laovs -i Nul
Available aovs:
    Type:    Name:                        LPE:
    --------------------------------------------------------------
    VECTOR2  motionvector (~)
    RGBA     RGBA                         C.*
    VECTOR   N (~)
    FLOAT    Z (~)
    RGB      direct                       C[DSV]L
    RGB      indirect                     C[DSV][DSVOB].*
    VECTOR   Pref (~)
    RGB      albedo                       C[DSV]A
    RGB      emission                     C[LO]
    RGB      diffuse_direct               C<RD>L
    RGB      background                   CB
    RGB      denoise_albedo               ((C<TD>A)|(CVA)|(C<RD>A))
    RGB      sss_albedo                   C<TD>A
    RGB      specular_albedo              C<RS[^'coat''sheen']>A
    RGB      diffuse                      C<RD>.*
    FLOAT    cputime (~)
    RGB      diffuse_indirect             C<RD>[DSVOB].*
    RGB      sss_indirect                 C<TD>[DSVOB].*
    RGB      diffuse_albedo               C<RD>A
    RGBA     shadow_matte
    FLOAT    volume_Z (~)
    RGB      specular                     C<RS[^'coat''sheen']>.*
    RGB      coat_direct                  C<RS'coat'>L
    RGB      specular_direct              C<RS[^'coat''sheen']>L
    RGB      specular_indirect            C<RS[^'coat''sheen']>[DSVOB].*
    RGB      volume_direct                CVL
    RGB      coat                         C<RS'coat'>.*
    RGB      coat_indirect                C<RS'coat'>[DSVOB].*
    RGB      coat_albedo                  C<RS'coat'>A
    RGB      sheen                        C<RS'sheen'>.*
    RGB      transmission                 C<TS>.*
    RGB      transmission_direct          C<TS>L
    RGB      transmission_indirect        C<TS>[DSVOB].*
    VECTOR2  AA_offset (~)
    RGB      transmission_albedo          C<TS>A
    VECTOR   P (~)
    RGB      sheen_direct                 C<RS'sheen'>L
    RGB      volume                       CV.*
    RGB      sheen_indirect               C<RS'sheen'>[DSVOB].*
    NODE     shader (~)
    RGB      sheen_albedo                 C<RS'sheen'>A
    RGB      sss                          C<TD>.*
    RGB      sss_direct                   C<TD>L
    RGB      volume_indirect              CV[DSVOB].*
    RGB      volume_albedo                CVA
    FLOAT    A (~)
    FLOAT    ZBack (~)
    RGB      opacity (~)
    RGB      volume_opacity (~)
    FLOAT    raycount (~)
    UINT     ID (~)
    NODE     object (~)
    FLOAT    AA_inv_density (~)
    RGBA     RGBA_denoise (~)
    --------------------------------------------------------------
    (~) No opacity blending

Kicking Bifrost ASS


You can export a Bifrost scene to an Arnold ass file and then render it with kick.

Just use the -l flag (or the ARNOLD_PLUGIN_PATH environment variable) to point to the Arnold plugins that comes with the Bifrost install. For example, on Windows:

kick -v 5 -dp bifrost_aeroColors.ass 
-l "C:\Program Files\Autodesk\Bifrost\Maya2020\2.2.0.2\bifrost\arnold-6.2.0.0"
kick render of a Bifrost graph

In the Arnold log, we see that Arnold loads the procedural nodes for Bifrost:

00:00:00 88MB | loading plugins from C:\Program Files\Autodesk\Bifrost\Maya2020\2.2.0.2\bifrost\arnold-6.2.0.0 …
00:00:00 100MB | arnold_bifrost.dll: bifrost_graph uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_object uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_multires_volume uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_multires_implicit uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_volume uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_points uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_implicit uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_polymesh uses Arnold 6.2.0.0
00:00:00 100MB | arnold_bifrost.dll: bifrost_blocks uses Arnold 6.2.0.0
00:00:00 100MB | loaded 9 plugins from 1 lib(s) in 0:00.06

In other applications, like CINEMA 4D or Houdini or Katana, you can do the same thing by setting the Plugin Search Path.

ERROR: out-of-range shader index


If you see this error in your Arnold log, it most likely means that you have more than 256 per-face shaders. Arnold has a hard limit of 256 shaders that can be assigned to a single object.

[polymesh] /pPlane1/pPlaneShape1: out-of-range shader index (5/3)

You may also see this warning if you have a large number of objects merged into one single object (for example, an Alembic archive that consists of many objects). In some cases, an Alembic archive like that may have more than 256 shaders assigned to the sub-objects.

Tangent space normal maps


The built-in N AOV is in world space. So how to get a tangent-space N AOV?
Like this:

In brief, I read the N AOV, transform the normals from world to tangent space, and then map the normal values to the range 0.5, 1 (I used the range node here, but I could have used Add and Multiply to do the same thing).

Here’s the shader tree. You can save this in a .ass file and import it into Maya or whatever application you use. Then set up an AOV shader to write the custom Ntangent AOV

range
{
 name aiRange1
 input space_transform
 output_min 0.5
}

space_transform
{
 name space_transform
 input read_N_AOV
 type "normal"
 to "tangent"
 tangent 1 0 0
 normal 0 1 0
 normalize on
}

aov_read_rgb
{
 name read_N_AOV
 aov_name "N"
}

aov_write_rgb
{
 name defaultArnoldRenderOptions/aov_write_rgb_Ntangent
 aov_input aiRange1
 aov_name "Ntangent"
}

Denoising AOVs with the Optix imager


The Optix imager can denoise the beauty and any other AOV.

The so-called layer selection tells the imager what AOVs to denoise. For example, if you want to denoise both the beauty and the coat AOVs, enter RGBA or coat in the Layer Selection text box.

Using AOV names with or is an easy way to select multiple AOVs.

You can also use wildcard characters (such as *, ., and []) to select AOVs (this is what is called glob in the docs). For example:

*Selects all AOVs
RGBA_*Selects all light group AOVs for the beauty (for example, RGBA_default, RGBA_key, and so on)
RGBA_light0[135]Selects RGBA_light01, RGBA_light03, and RGBA_light05
RGBA_light0.The period (.) matches any single character, so this selects RGBA_light00 through to RGBA_light09.
RGBA_light0[1-9] does the same thing.

You can even use regular expressions for more complicated selections. But in general, using or and wildcards should be more than enough.