Here are the various surface component shaders currently implemented in the layering package:
The diffuse reflection component is very similar to the mia_material diffuse shading, as well as the diffuse elemental component defined in MDL. It has an Oren-Nayer roughness parameter for spreading the light more evenly. These are the parameters:
"mila_diffuse_reflection" (
color "tint" default 1 1 1,
scalar "roughness" default 0,
scalar "quality" default 1.0, #: min 0 softmax 2.0
scalar "direct" default 1.0,
scalar "indirect" default 1.0
)
The glossy reflection component is similar to the mia_material reflection shading, as well as the glossy elemental BSDF found in NVIDIA Material Description Language (MDL). In fact, this glossy reflection component adopts the use of roughness, which MDL uses, rather than glossiness used by the mia_material. In particular, we also provide a simple specular reflection component separately below for perfectly smooth surface components requiring mirror-like reflections. These are the parameters:
"mila_glossy_reflection" (
color "tint" default 1 1 1,
scalar "roughness" default 0.0, #: min 0.0 max 1.0
scalar "quality" default 1.0, #: min 0.0 softmax 2.0
scalar "anisotropy" default 1.0,
scalar "aniso_angle" default 0,
integer "aniso_channel" default -1,
boolean "use_max_dist" default off,
scalar "max_dist" default 0.0,
boolean "use_max_dist_color" default off,
color "max_dist_color" default 0 0 0,
scalar "direct" default 1.0,
scalar "indirect" default 1.0
)
The specular reflection component provides mirror-like reflection. It is similar to the mia_material reflection shading when that glossiness is set to 1. It also relates to the specular elemental BSDF used in MDL. These are the parameters:
"mila_specular_reflection" (
color "tint" default 1 1 1,
boolean "use_max_dist" default off,
scalar "max_dist" default 0.0,
boolean "use_max_dist_color" default off,
color "max_dist_color" default 0 0 0,
scalar "direct" default 1.0,
scalar "indirect" default 1.0
)
Implemented as basically the same as the mia_material refractive part - as before, the Architectural library documentation will fill in any gaps.
"mila_glossy_transmission" (
color "tint" default 1 1 1,
scalar "roughness" default 0.0, #: min 0.0 max 1.0
scalar "quality" default 1.0, #: min 0.0 softmax 2.0
scalar "ior" default 1.2,
scalar "anisotropy" default 1.0,
scalar "aniso_angle" default 0,
integer "aniso_channel" default -1,
boolean "use_max_dist" default off,
scalar "max_dist" default 0.0,
boolean "use_max_dist_color" default off,
color "max_dist_color" default 0 0 0,
scalar "direct" default 1.0,
scalar "indirect" default 1.0
)
Implemented as basically the same as the mia_material refractive part - as before, the Architectural library documentation will fill in any gaps.
"mila_specular_transmission" (
color "tint" default 1 1 1,
scalar "ior" default 1.2,
boolean "use_max_dist" default off,
scalar "max_dist" default 0.0,
boolean "use_max_dist_color" default off,
color "max_dist_color" default 0 0 0,
scalar "direct" default 1.0,
scalar "indirect" default 1.0
)
Transparency (not refraction, but "straight through" transparency)
"mila_transparency" (
color "transparency" default 1 1 1
)
It is important to understand the conceptual difference of transparency and refraction in the layering shaders.
There is also a very important technical difference in that while transmission is implemented by the actual mila_glossy_transmission shader, transparency is implemented by the mila_material (root) node (as discussed on the framebuffers page), and is really propagated around the shade tree as meta-information.
This, however, matters little to the end user. From an end-user perspective, the important difference is that transparency is used for any time you want rays to go straight through, which can be used for:
For example, creating a solid glass sphere means applying a fresnel-weighted specular reflection component layered on top of a refracting specular transmission component. To create an "empty" glass sphere (think helicopter canopy or soap-bubble), apply a similar fresnel-weighed reflection component on top of a transparent component. The distinction between these two are similar to using the thin_walled parameter in mia_material

Implemented as basically the same as the mia_material translucency
"mila_diffuse_transmission" (
color "tint" default 1 1 1,
scalar "roughness" default 0,
scalar "quality" default 1.0, #: min 0 softmax 2.0
scalar "direct" default 1.0,
scalar "indirect" default 1.0
)
This is a very simple shader which only does diffuse transmission on a face, and is hence only really useful on "thin" geometry, allowing light from the backside to shine through.
Allows an additional color to be added to the shading, as if the surface was emissive
"mila_emission" (
color "tint" default 1 1 1,
scalar "intensity" default 10
)
This is a very simple shader which only adds a constant value - but in a combinable fashion. Beyond that is does nothing complex, and any "emitted" light will only be picked up if FG is on.
This is a new implementation of sub-surface scattering, similar in the rendered appearance to the misss_fast_shader2 but without the use of lightmapping.
The use of lightmapping in the old SSS shaders has become an issue for several reasons:This subsurface scattering (SSS) shader uses a "lazy evaluation" technique, where light is stored (cached) temporarily in a refillable buffer accessible to all cores at rendering time. So even in cases where the same light needs to be computed twice (due to buffer size overruns), it can be done in parallel on multiple cores. So while the old SSS shaders with the precomputed lightmap may potentially be faster after the lightmap had been computed, these new SSS shaders (which compute the same information on-the-fly) often win overall, since all the cores can be used properly.
Due to this, all parameters live on a single shaders, rather than being split up into the lightmapping and shading phase, as was done with the old misss_fast* shaders.
In most cases, this shader is the preferred way to do SSS now, and one should generally migrate away from the old misss_fast* shader set if one wants to do efficient layering, and especially for skin rendering. More on this in the tutorial page.
"mila_scatter" (
color "front_tint" default 1.0 1.0 1.0,
scalar "front_weight" default 1.0,
vector "front_radius" default 20 10 5,
color "front_radius_mod" default 1 1 1,
color "back_tint" default 1.0 1.0 1.0,
scalar "back_weight" default 1.0,
vector "back_radius" default 20 10 5,
color "back_radius_mod" default 1 1 1,
scalar "back_depth", # unassigned (zero) means "same as radius"
scalar "sampling_radius_mult" default 2.0,
scalar "light_storage_gamma" default 0.75,
scalar "scale_conversion" default 1.0,
integer "resolution" default 2,
scalar "quality" default 1.0,
scalar "direct" default 1.0,
scalar "indirect" default 1.0
)
The new shader still uses the same division into "front" and "back" as the old misss_fast* shaders (see
the manual for the "subsurface" library for more information about "front" vs. "back"). However, in most day-to-day cases, one would set these to the same values, since the colorization of the scattering is now done
with the per-color scatter radii, so that red automatically scatters further, for example. This means that rather than making the "back" scattering red manually, this happens by itself.<&p>
This also means that the shader still inherently work in a screen based coordinate space. And while the new parameters are much closer to how "physical" scattering works, the shader is still a bit of a "trick" and does not claim to be absolutely physically accurate - rather to be extremely visually convincing.
These are the parameters:
&p>