Layered Shaders
From K-3D
Overview
Layered shaders are a non-standard (not part of RenderMan) feature in Aqsis, that allows you to create shader networks that combine the outputs of individual shaders within a single gprim. Without layered shaders (and with-or-without visual tools to generate shaders), you get a combinatorial explosion of specialized shaders, e.g: textured_matte, textured_plastic, textured_metal, textured_matte_with_decal, textured_plastic_with_decal, textured_metal_with_decal, and-so-on ...
With layers you could combine any of "texture", "decal", "matte", "plastic", and "metal" shaders to create the above list, plus more.
The devil is in the details, of course ... developing the right collection of components, with a reasonable level of granularity, is an interesting challenge. As a practical matter, you have to have shaders that are written with layers in-mind.
One method is shown here Shader_Anatomy
Interface
- Substitute AqsisSurfaceShaderLayer for RenderManSurfaceShader in a RenderManMaterial node.
- Pick a shader in the AqsisSurfaceShaderLayer node.
- Modify arguments normally.
- Create additional AqsisSurfaceShaderLayer nodes as-needed.
- Make connections between layers using user properties of type "Aqsis Shader Layer" or "Aqsis Displacement Layer".
- The Aqsis shader layer properties allow you to select: another layer, the name of the output variable in the other layer, and the name of the input variable in the current layer.
Future
Shader layers are actually more than just layers - they can form a shader *tree*, which is why the UI works the way it does - each layer is an instance of an AqsisSurfaceShaderLayer node. You then add user properties to make the connections between nodes. Doing this with the Node Properties panel is painful, particularly since you have to know which shader arguments need to be connected, and enter them manually. Presumably there will be a more specialized UI for editing shader trees in the future.

