HairToonMaterial
Overview
HairToonMaterial allows for the creation of stylized hair using the diffuse options of HairDiffuseMaterial and specular options controlled by ramps. This allows artists to make complex and specific falloff and specular shapes.
When working with ramps in rdla, each vector attribute (specular_X_positions, specular_X_values, specular_X_interpolations) must have the same number of elements.
Here is an example to create one of the images below:
mtl = HairToonMaterial("mtl") {
["specular_1_model"] = "Toon_Hair",
["specular_1_roughness"] = 0.25,
["specular_1_values"] = {0.0, 0.05, 1.0, 1.0, 1.0},
["specular_1_positions"] = {0.0, 0.15, 0.2, 0.5, 1.0},
["specular_1_interpolation"] = {1, 1, 1, 1, 1},
["hair_color"] = Rgb(0.351, 0.275, 0.15),
["bssrdf"] = 1,
["scattering_radius"] = 0.25,
}
Attribute Reference
Advanced attributes
back_hair_color
Rgb bindable
default: [ 1, 1, 1 ]
(advanced only) hair color used for back-lit hair (transmission/forward reflectance)
front_hair_color
Rgb bindable
default: [ 1, 1, 1 ]
(advanced only) hair color used for front-lit hair (backward reflectance)
sss_trace_set
TraceSet
default: None
Set of geometries that contribute neighboring subsurface points. By default, only the geometry associated with this material contributes to subsurface. If you want adjacent geometry with different material to contribute as well, specify all those parts here.
use_independent_front_and_back_hair_color
Bool
default: False
(advanced) use a separate hair color for front and back
Common attributes
presence
Float bindable
default: 1.0
controls the visibility of this object. Useful for fading an object in/out, or to specify a cut-out mask on thin single-sided geometry (eg. a complex leaf texture on a simple card).
Diffuse attributes
hair_color
Rgb bindable
default: [ 1, 1, 1 ]
No documentation available
hair_diffuse
Float bindable
default: 1.0
Amount of hair diffuse
show_hair_diffuse
Bool
default: True
Show the hair diffuse lobe
Emission attributes
emission
Rgb bindable
default: [ 1, 1, 1 ]
the energy emitted from this material
show_emission
Bool
default: False
enables/disable emission
Specular attributes
specular_1_fresnel_blend
Float bindable
default: 1.0
The amount of fresnel to use for the toon specular response
specular_1_ramp_input_scale
Float bindable
default: 1.0
Scales the input value x to the ramp lookup y, where x is based on the angle between the sample direction and normal. This has the effect of squashing or stretching the ramp point positions towards/away from 0.
specular_2_fresnel_blend
Float bindable
default: 1.0
The amount of fresnel to use for the toon specular response
specular_2_ramp_input_scale
Float bindable
default: 1.0
Scales the input value x to the ramp lookup y, where x is based on the angle between the sample direction and normal. This has the effect of squashing or stretching the ramp point positions towards/away from 0.
specular_3_fresnel_blend
Float bindable
default: 1.0
The amount of fresnel to use for the toon specular response
specular_3_ramp_input_scale
Float bindable
default: 1.0
Scales the input value x to the ramp lookup y, where x is based on the angle between the sample direction and normal. This has the effect of squashing or stretching the ramp point positions towards/away from 0.
Specular 1 attributes
specular_1_enable_indirect_reflections
Bool
default: False
enables indirect GGX reflections for toon specular model
specular_1_enable_input_normal
Bool
default: False
enables sampling the normal map for toon specular 1
specular_1_indirect_reflections_intensity
Float bindable
default: 1.0
the intensity for the indirect reflections of the toon specular model
specular_1_indirect_reflections_roughness
Float bindable
default: 0.5
the roughness for the indirect reflections of the toon specular model
specular_1_input_U
Vec3f bindable
default: [ 0, 0, 0 ]
input U / tangent for specular stretch
specular_1_input_V
Vec3f bindable
default: [ 0, 0, 0 ]
input V / bitangent for specular stretch
specular_1_input_normal
NormalMap
default: None
specifies an alternate shading normal for toon specular 1
specular_1_input_normal_dial
Float bindable
default: 1.0
controls influence of input normal versus hair normal for toon specular 1
specular_1_intensity
Float bindable
default: 1.0
The overall intensity of the specular response
specular_1_interpolations
IntVector
default: {}
None: 0 | Linear: 1 | Exponential Up: 2 | Exponential Down: 3 |
Smooth: 4 | Catmull Rom: 5 | Monotone Cubic: 6
specular_1_model
Int enum
2 = “Toon_Surface” (default)
3 = “Toon_Hair”
sets the normal distribution function for specular
specular_1_mult0
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult1
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult2
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult3
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult4
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult5
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult6
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult7
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult8
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_mult9
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_1_offset0
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset1
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset2
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset3
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset4
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset5
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset6
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset7
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset8
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_offset9
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_1_positions
FloatVector
default: {}
ramp positions, maximum 10 allowed
specular_1_roughness
Float bindable
default: 0.9
The roughness of the toon specular. Smaller values produce tighter highlights
specular_1_show
Bool
default: True
Show first toon specular lobe
specular_1_stretch_u
Float bindable
default: 0.0
Amount to stretch or compress the specular in the u direction
specular_1_stretch_v
Float bindable
default: 0.0
Amount to stretch or compress the specular in the v direction
specular_1_tint
Rgb bindable
default: [ 1, 1, 1 ]
No documentation available
specular_1_use_input_vectors_for_stretch
Bool
default: False
when checked, use input_U and V. otherwise use geometry dPds/t
specular_1_values
FloatVector
default: {}
List of colors on the ramp
Specular 2 attributes
specular_2_enable_indirect_reflections
Bool
default: False
enables indirect GGX reflections for toon specular model
specular_2_enable_input_normal
Bool
default: False
enables sampling the normal map for toon specular 2
specular_2_indirect_reflections_intensity
Float bindable
default: 1.0
the intensity for the indirect reflections of the toon specular model
specular_2_indirect_reflections_roughness
Float bindable
default: 0.5
the roughness for the indirect reflections of the toon specular model
specular_2_input_U
Vec3f bindable
default: [ 0, 0, 0 ]
input U / tangent for specular stretch
specular_2_input_V
Vec3f bindable
default: [ 0, 0, 0 ]
input V / bitangent for specular stretch
specular_2_input_normal
NormalMap
default: None
specifies an alternate shading normal for toon specular 2
specular_2_input_normal_dial
Float bindable
default: 1.0
controls influence of input normal versus hair normal for toon specular 2
specular_2_intensity
Float bindable
default: 1.0
The overall intensity of the specular response
specular_2_interpolations
IntVector
default: {}
None: 0 | Linear: 1 | Exponential Up: 2 | Exponential Down: 3 |
Smooth: 4 | Catmull Rom: 5 | Monotone Cubic: 6
specular_2_model
Int enum
2 = “Toon_Surface” (default)
3 = “Toon_Hair”
sets the normal distribution function for specular
specular_2_mult0
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult1
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult2
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult3
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult4
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult5
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult6
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult7
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult8
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_mult9
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_2_offset0
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset1
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset2
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset3
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset4
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset5
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset6
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset7
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset8
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_offset9
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_2_positions
FloatVector
default: {}
ramp positions, maximum 10 allowed
specular_2_roughness
Float bindable
default: 0.9
The roughness of the toon specular. Smaller values produce tighter highlights
specular_2_show
Bool
default: False
Show second toon specular lobe
specular_2_stretch_u
Float bindable
default: 0.0
Amount to stretch or compress the specular in the u direction
specular_2_stretch_v
Float bindable
default: 0.0
Amount to stretch or compress the specular in the v direction
specular_2_tint
Rgb bindable
default: [ 1, 1, 1 ]
No documentation available
specular_2_use_input_vectors_for_stretch
Bool
default: False
when checked, use input_U and V. otherwise use geometry dPds/t
specular_2_values
FloatVector
default: {}
List of colors on the ramp
Specular 3 attributes
specular_3_enable_indirect_reflections
Bool
default: False
enables indirect GGX reflections for toon specular model
specular_3_enable_input_normal
Bool
default: False
enables sampling the normal map for toon specular 3
specular_3_indirect_reflections_intensity
Float bindable
default: 1.0
the intensity for the indirect reflections of the toon specular model
specular_3_indirect_reflections_roughness
Float bindable
default: 0.5
the roughness for the indirect reflections of the toon specular model
specular_3_input_U
Vec3f bindable
default: [ 0, 0, 0 ]
input U / tangent for specular stretch
specular_3_input_V
Vec3f bindable
default: [ 0, 0, 0 ]
input V / bitangent for specular stretch
specular_3_input_normal
NormalMap
default: None
specifies an alternate shading normal for toon specular 3
specular_3_input_normal_dial
Float bindable
default: 1.0
controls influence of input normal versus hair normal for toon specular 3
specular_3_intensity
Float bindable
default: 1.0
The overall intensity of the specular response
specular_3_interpolations
IntVector
default: {}
None: 0 | Linear: 1 | Exponential Up: 2 | Exponential Down: 3 |
Smooth: 4 | Catmull Rom: 5 | Monotone Cubic: 6
specular_3_model
Int enum
2 = “Toon_Surface” (default)
3 = “Toon_Hair”
sets the normal distribution function for specular
specular_3_mult0
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult1
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult2
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult3
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult4
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult5
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult6
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult7
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult8
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_mult9
Float bindable
default: 1.0
Bindable multiplier on the toon specular ramp value
specular_3_offset0
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset1
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset2
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset3
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset4
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset5
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset6
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset7
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset8
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_offset9
Float bindable
default: 0.0
Bindable offset to the toon specular ramp-position, add a small variation using noise etc for art-directable ramp thresholds
specular_3_positions
FloatVector
default: {}
ramp positions, maximum 10 allowed
specular_3_roughness
Float bindable
default: 0.9
The roughness of the toon specular. Smaller values produce tighter highlights
specular_3_show
Bool
default: False
Show third toon specular lobe
specular_3_stretch_u
Float bindable
default: 0.0
Amount to stretch or compress the specular in the u direction
specular_3_stretch_v
Float bindable
default: 0.0
Amount to stretch or compress the specular in the v direction
specular_3_tint
Rgb bindable
default: [ 1, 1, 1 ]
No documentation available
specular_3_use_input_vectors_for_stretch
Bool
default: False
when checked, use input_U and V. otherwise use geometry dPds/t
specular_3_values
FloatVector
default: {}
List of colors on the ramp
Subsurface attributes
bssrdf
Int enum
0 = “normalized diffusion” (default)
1 = “dipole”
0 for NormalizedDiffuse, 1 for Dipole. Random walk unsupported for hair.
enable_sss_input_normal
Bool
default: False
enables sampling the normal map for sss samples. More accurate but potentially expensive
input_normal
NormalMap
default: None
specifies an alternate shading normal (only for SSS lobe)
input_normal_dial
Float bindable
default: 1.0
controls influence of input normal versus hair normal for SSS
scattering_color
Rgb bindable
default: [ 1, 1, 1 ]
the subsurface scattering 'falloff' color
scattering_radius
Float bindable
default: 0.0
the distance the light scatters beneath the surface. When 0 surface diffuse is used
subsurface_blend
Float bindable
default: 1.0
0 is fully hair diffuse, 1 is fully SSS. No effect if scattering radius is 0.
General attributes
extra_aovs
Map
default: None
Bind this attribute to a 'ListMap' that contains references to ExtraAovMaps that specify additional outputs that can be assigned to a RenderOutput "light aov" result
label
String
default:
label used in material and light aovs
priority
Int
default: 0
The material's place in an order of precedence for overlapping dielectrics. A value of 0 means the priority should be ignored. Materials with lower numbers (higher priority) "override" materials with higher numbers (lower priority). To enable automatic removal of self-overlapping geometry, a non-zero priority must be set on the geometry's material.
record_reflected_cryptomatte
Bool
default: False
Indicates whether the next reflected surface should appear in the reflected cryptomatte layers
record_refracted_cryptomatte
Bool
default: False
Indicates whether the next refracted surface should appear in the refracted cryptomatte layers