[mtoa] The case of the layeredTexture and Arnold 5 closures


In this case, the question was “why doesn’t layeredTexture work in Arnold 5?”

layeredTexture

This is a common question/problem with Arnold 5: shaders plugged into color slots.

In Arnold 5, shaders like Standard Surface (and Lambert too) don’t return colors. So in general, you can’t plug them into color parameters. And Blinns are translated into Standard Shaders by MtoA, so you can’t plug a Blinn into a color either.

Instead of a layeredTexture, you can use a layeredShader. It knows how to handle shaders that don’t return colors. Or you could use the Arnold aiMix shader.

layeredShader

So, if these shaders don’t return colors, what do they return?

Closures. They return closures.

closure is not a color, it’s a bundle of data that tells Arnold how the surface (or volume) scatters light. Arnold takes care of all the ray tracing and light sampling, and then uses the closure to figure out the surface color.

 

From Master Zap:

“The addition of “closures” is a complete godsend. This relegates the work of rendering to the renderer, as it should be. No longer are material shaders little dumb raytracers that count lights and shoot reflection rays. A material shader returns mix of BxDF closures, and the renderer itself takes care of doing “the right thing” with them”.

From the Arnold 5 release notes:

Closures: a new closure parameter type has been added, which shaders can output instead of final colors. There are BSDF, BSSRDF, emission, matte, transparency and volume closures. See the API documentation and examples for more details on how to use these. Linking a color to a closure parameter will automatically create an emission closure with that color. A closure parameter however can’t be linked or converted to a color, as the integrator only computes lighting after shader evaluation.

 

[FAQ] Can I transfer Arnold shaders to another app?


For example, can I transfer Arnold shaders from 3ds Max to Maya? Or from Houdini to Maya?

The answer is no. The Arnold plugins don’t include code for reading shader nodes from an ASS file and creating shader trees inside the host application (eg Maya, Houdini, or Cinema 4D).

You can use ASS files to take shapes and shaders from one app and render them in another app, but those shapes and shaders are never created inside the other app.

An MtoA Standin (aka an Arnold Procedural in HtoA and C4DtoA) references an ASS file, and passes that on to Arnold at render time.

standins

The ASS file contains Arnold nodes (shapes and shaders). Those Arnold nodes are not created inside the 3D application.

Instead, the standin node is translated to an Arnold procedural node, and at render time, that procedural node is expanded, and all the Arnold shapes and shaders are created inside the Arnold scene.

[SItoA] Installing the alShaders in Softimage


Here’s how to install third-party, SPDL-based shaders, like alShaders, so that you can use them with SItoA. You could install them in a separate workgroup, but for simplicity I’m going to show how to install them in the SItoA workgroup.

In these instructions, $AL_SHADERS is the location where you extracted the alShaders download. For example, C:\solidangle\alShaders\alShaders-win-0.4.0b18-ai4.2.0.6.

$SITOA_WORKGROUP is the SItoA workgroup location. For example, C:\Users\StephenBlair\softimage\workgroups\sita-3.3.0-2014.

  1. Copy the alShader DLLs from
    $AL_SHADERS\bin
    to
    $SITOA_WORKGROUP\Addons\SItoA\Application\Plugins\bin\nt-x86-64

  2. Create a spdl folder in your Addons\SItoA\Application folder:
    $SITOA_WORKGROUP\Addons\SItoA\Application\spdl

  3. Copy the alShader spdl files from
    $AL_SHADERS\spdl
    to
    $SITOA_WORKGROUP\Addons\SItoA\Application\spdl

  4. Restart Softimage. The alShaders should show up in the Render Tree preset manager, and assuming that your version of alShaders is compatible with your SItoA, they’ll work in a render too.
    als_shaders

Tip Don’t create an alShader from the Arnold > DLL Shaders menu; it won’t pick up the SPDL and you’ll get a raw PPG (and a raw render tree node too).

[MtoA] Installing the BA shaders in Maya


You can use the BA shaders in Maya with MtoA. The BA shaders are Arnold shaders, so you can use them anywhere that you use Arnold.

Here’s how:

  • Download the Maya mental ray package of the BA shaders. For example, for Maya 2014, the most recent version is
    >>>v25.01.09 Maya 2014 mentalRay
  • Extract the archive. For example, you could extract the archive to a C:\solidangle\BA folder.
  • Set MAYA_SCRIPT_PATH to point to the scripts\AEtemplates folder. For example:
    set MAYA_SCRIPT_PATH=C:\solidangle\BA\140219__baEssential_25.01.09___Maya_2014_MRay\scripts\AETemplates
  • Download the Arnold shaders. For example, for Maya 2014, the most recent version is >>>v25.01.09 Arnold 4.1 (mentalRay addon required for UI)
  • Extract the archive, and set ARNOLD_PLUGIN_PATH to point to the Arnold\win64 folder. For example:
    set ARNOLD_PLUGIN_PATH=C:\solidangle\BA\140219__baEssential_25.01.09___All_Arnold_4_1_3\Arnold\win64
  • Start Maya. The BA shaders should be available, and the AE should look “nice” for the BA shaders.

[MtoA] [SItoA] Distance between shading with Vector State


SItoA includes Arnold versions of the Softimage Vector State and Vector Scalar shaders, which you can use to do build a “distance between” shading network.

Vector State can get you the origin point of a ray and its intersection point, and Vector Scalar can get the distance between those two points.

vector_state_sitoa

You can even use these shaders in Maya (since they are just Arnold shaders). Just put sitoa_shaders somewhere in the ARNOLD_PLUGIN_PATH, and MtoA will load them. The shader UI in the Attribute Editor will be very basic (for example, integer input fields instead of drop-down lists), but you can use the shaders.

vector_state_mtoa