Toon Host

 
 
 

| Paint | Ink | Seams | Transparency | Reflection | Render Tree Usage

Category: Toon

Shader Family: Surface Material

Output: Color

This shader is a material host for Toon-rendered ink contours. By itself, it is of little use, as it does no surface illumination computation of its own. However, used in conjunction with the lens shader Toon Ink Lens, this shader is able to modify or override global ink properties on a per-material basis. This shader is also required for proper rendering of secondary ray contours (contours which appear in reflections or through transparent surfaces). Though it is certainly possible to render ink contours using only the Toon Ink Lens shader, this material host is useful for finer control over their attributes.

Because this shader does no surface illumination calculations, by itself it is only able to color surfaces a constant color. Using the Render Tree interface or a Phenomenon constructed using this shader though, it is possible to render ink in conjunction with any surface texturing scheme or illumination model normally at one's disposal.

This shader also functions as a shadow shader, computing shadow color based on transparency.

Name

The shader's name. Enter any name you like, or leave the default.

Paint

The surface color returned by the shader. This is typically where one might connect the Toon_Paint node output.

Color

Specify color. Use this parameter in a Render Tree shader graph as the input from any material-shading node. This will become the surface-color underlying the contours.

Ink

Control over per-material ink attributes.

Bypass

Bypass contour rendering for the current surface.

Back Cull

Do not render contours detected on back-facing surfaces (i.e., surfaces whose normals face away from the camera or incoming secondary ray).

Boundaries

Local control over what ink is visible. This allows hiding ink where contours are detected around an object (silhouette) or inside the object's shape (interior). These controls act in concert with Toon_Ink_Lens' Sampling controls.

Silhouette

Ink around an object's silhouette (where the object is visible against the environment or another object).

Interior

Ink drawn in the interior of an object.

Override

Overrides global contour attributes (set using the Toon Ink Lens shader).

Enable

Enables this group of parameters.

Color

Contour color. This overrides the color and alpha set for ink in the Toon Ink Lens shader.

Compositing

Choose from the available transfer modes to specify how to composite ink onto the underlying surfaces. This overrides the Compositing set in the Toon Ink Lens shader. The following modes are available:

  • Normal. This is the default. It simply takes the foreground.

  • Add. The foreground is added to the background. Thus, no foreground will be visible if the foreground is black. This is useful for compositing such that the foreground appears to glow.

  • Multiply. Multiplies the foreground by the background. The result is always a color darker than either original foreground or background, much like the result of two overhead transparencies stacked and projected from a single projector.

  • Screen. The inverses of the two color values are multiplied. The result is a foreground brighter than either the original foreground or background.

  • Overlay. Either multiplies or screens, depending on the value of the background underneath. The overall result is that the background is not replaced by the foreground, but is mixed with it, while weighted by the value of the original background.

  • Lighten. Compares the values of the foreground and background and chooses the lighter of the two. The overall result is that the foreground can never do anything except make the background lighter.

  • Darken. Compares the values of the foreground and background and chooses the darker of the two. The overall result is that the foreground can never do anything except make the background darker.

  • Difference. The foreground is subtracted from the background, producing an inverted color effect.

  • Hue. Uses the luminance and saturation of the background and the hue of the foreground.

  • Saturation. Uses the hue and luminance of the background and the saturation of the foreground.

  • Value. Uses the hue and saturation of the background and the luminance (value) of the foreground.

  • Soft Light. If the value of the foreground is greater/less than 50% gray, the underlying background is lightened/darkened by the foreground. This is similar to shining a diffuse light on the image.

  • Hard Light. If the value of the foreground is greater/less than 50% gray, the background is screened/multiplied by the foreground. This is similar to shining a harsh light on the image.

  • Exclusion. Similar (though not identical) to Difference mode.

Modify

Modify global contour attributes (set using the Toon Ink Lens shader). A setting of 1 for any of these parameters has no effect.

Spread

Modify ink spread local to the current material. This is a simple scaling factor applied to the global ink spread (a value of 0.5 will decrease the ink spread to half its original value, for example).

Direction Threshold

Modify the direction threshold used for contour detection. This is a simple scaling factor (a value of 2 will increase the threshold angle to twice its original value, for example).

Seams

Grouping to hide (blend) or reveal (unblend) ink contours where they would normally be visible (or, conversely, hidden).

Blend

Grouping to hide (blend) ink contours where they would normally be visible.

Occlusion Distance

Blending is only allowed where the surface samples do not exceed this distance (in system units) from each other. This allows contours between surfaces to be hidden where two surfaces are joined, for example, but not where they simply occlude each other. The greater of two samples' Occlusion Distance settings is used.

Occlusion Distance is specified relative to the current ink spread. Thus an Occlusion Distance of 0.1 units is taken to mean 0.2 units when Spread is 2, for example. This ensures that hidden seams remain hidden even when thick ink contours are rendered.

Furthermore, Toon_Ink_Lens attempts to "normalize" the threshold distance relative to the distance from ray origins to the samples in question.

Blend Objects

Given two objects, if one object is in the Blend Objects list of the other (or vice-versa), no contour will be detected at their intersection.

Group

Contours are hidden where they would normally be drawn between surface samples sharing the same Blend Group id. A setting of 0 deactivates this feature.

Unblend

Grouping to reveal (unblend) ink contours where they would not normally be visible.

Group

Contours are inked where they would not normally be detected. This allows arbitrary placement of contours, even on a surface that does not satisfy the usual criteria for contour detection (discontinuity, occlusion, different materials, etc.).

A setting of 0 deactivates this feature. By texturing this parameter it is possible to texture-map contours onto a surface.

Transparency

These controls control the rendering of refractive and transparent surfaces, including ink seen through such surfaces. For these controls to have any effect on ink contours, the Toon Ink Lens shader's Trace Depth control (Sampling tab) must be set to a value greater than 1.

Enable

Enable transparency/refraction effects.

Mode

There are two modes available for composition of secondary ray effects: Standard Blend and Preserve Colors.

Standard Blend is the usual method of combining the surface color with the transmitted color (the two colors are mixed according to the degree of transparency).

With Preserve Colors selected, the transmitted color is composited onto the surface according to the opacity of the occluded surface. This has the sometimes-useful effect of leaving a surface color unchanged where nothing is transmitted through it.

Color

Specification of transparency for red, green, and blue. This color modifies transmitted colors, like a filter: if it is set to red, for example, objects seen through the surface will be tinted red (i.e., only their red components will be transmitted).

Index of Refraction

The index of refraction of this material (more specifically, the ratio of the refractive indices of the media on both sides of a surface to which this shader is assigned).

Detection Threshold

Allows the user to adjust the threshold above which a surface is considered transparent (and below which, opaque). The greatest of the transparency RGB channels is compared to the threshold, and the surface considered transparent, if found greater-than the threshold.

Modify Surface Ink

Allows the transparency of a surface to modify the color of ink rendered on it.

Enable

Enable these parameters to modify the surface ink color/alpha.

Color/Alpha

The degree to which the ink color/alpah is affected. A setting of 0 will leave ink color/alpha unmodified, and a setting of 1 will result in 100% weight given the transparency color.

Compositing

The method by which transparency color and ink color are combined. Choose from the available transfer modes.

The modes are the same as described for the Compositing parameter for the Override options on the Ink tab in this property editor.

Modify Refracted Ink

Allows the transparency of a surface to modify the color of ink seen through it. The parameters are the same as for Modify Surface Ink above.

Reflection

These controls control the rendering of reflective surfaces, including ink seen reflected in such surfaces. For these controls to have any effect on ink contours, the Toon Ink Lens shader's Trace Depth control (Sampling tab) must be set to a value greater than 1.

Enable

Enables reflection effects.

Mode

There are two modes available for composition of secondary ray effects: Standard Blend and Preserve Colors.

Standard Blend is the usual method of combining the surface color with the reflected color (the two colors are mixed according to the degree of reflectivity).

With Preserve Colors selected, the reflected color is composited onto the surface according to the opacity of the reflected surface. This has the sometimes-useful effect of leaving a surface color unchanged where nothing is reflected off it.

Color

Specification of reflectivity for red, green, and blue. This color modifies reflected colors: if it is set to blue, for example, objects seen in reflections will be tinted blue (i.e., only their blue components will be reflected).

Modify Surface Ink

Allows the reflectivity of a surface to modify the color of ink rendered on it.

Enable

Enable these parameters to modify the surface ink color/alpha.

Color/Alpha

The degree to which the ink color/alpha is affected. A setting of 0 will leave ink color/alpha unmodified, and a setting of 1 will result in 100% weight given the reflection color.

Compositing

The method by which reflection color and ink color are combined. Choose from the available transfer modes.

The modes are the same as described for the Compositing parameter for the Override options on the Ink tab in this property editor.

Modify Reflected Ink

Allows the reflectivity of a surface to modify the color of ink reflected in it. The parameters are the same as for Modify Surface Ink parameters above.

Render Tree Usage

Must be used in conjunction with Toon_Ink_Lens, its companion lens shader, and is typically used with a Toon_Paint shader as well.