mesh_leaf_base
A mesh_leaf_base material is used to create realistic leaves. Can be applied to meshes and dynamic meshes. Animation for leaves is supported.
See also
Step-by-step guide how to export mesh with leaves and set up leaf material (Adding Vegetation tutorial).
Billboards Leaves Requirements
For billboard leaves, the second UV channel of the exported model should contain information about the size and orientation of leaf billboards.
If leaves are animated, the anchor to rotate billboards is:
- In 3ds Max, the top left corner of the UVW zero-to-one square (at [1,0] coordinates)
- In Maya, the lower left corner ( at [0,0] coordinates)
Materials are modified via Materials Editor.
States
In the States tab you can set rendering passes and available options. Enabling some of the states activates additional textures and parameters in the Textures and Parameters tabs respectively.
The states divide into 2 groups: Passes and Options.
Possible values for all the passes:
GUI name | XML name | Description |
---|---|---|
Skip | none | Material is not rendered during the pass. |
Default | default | Material is rendered during the pass. |
Possible values for a Leaves option:
GUI name | XML name | Description |
---|---|---|
None | none | Leaves are not rendered. |
Geometry | geometry | Leaves are rendered as a standard polygons. |
Billboard | billboard | Leaves are rendered as billboards that always face the camera. |
All the other options can be either enabled or disabled by ticking the respective boxes.
All the states can be set to default ones - click a Set to parent button near the state (if the state is different from the default one, its field will be highlighted with green).
The states available for this kind of materials are listed below.
Passes
Passes specify during which rendering pass the material should be rendered. They are modified in the Passes field of the States tab.
GUI name | XML name | Description |
---|---|---|
Deferred | deferred | Deferred rendering pass. Specifies if the material should be rendered during the deferred pass. For the transparent surfaces see also a Post deferred option. |
Auxiliary | auxiliary | Auxiliary rendering pass. Specifies if the material should be rendered into the auxiliary buffer to create a custom post-process. |
Ambient | ambient | Ambient rendering pass. Specifies, how the material should be rendered during the Ambient light pass for the opaque objects. The actual opacity or transparency of the material depends solely on the set blending options. |
Light prob | light_prob | Probe lights rendering pass. Specifies, if the material should be rendered illuminated by the Probe light sources during the light and shadows rendering passes. |
Light spot | light_spot | Spot lights rendering pass. Specifies, if the material should be rendered illuminated by the Spot light sources during the light and shadows rendering passes. |
Light omni | light_omni | Omni-directional lights rendering pass. Specifies, if the material should be rendered illuminated by the Omni light sources during the light and shadows rendering passes. |
Light proj | light_proj | Projected lights rendering pass. Specifies, if the material should be rendered illuminated by the Projected light sources during the light and shadows rendering passes. |
Light world | light_world | World lights rendering pass. Specifies, if the material should be rendered illuminated by the World light sources during the light and shadows rendering passes. |
Options
The following options are set in the Options field of the States tab.
GUI name | XML name | Description | ||||
---|---|---|---|---|---|---|
Leaves | leafs | Specifies the way to render the leaves geometry. | ||||
Angle fade | angle_fade | Used only for polygon-based leaves (with the set Geometry type).
Fades leaves by their alpha channel when the polygon is viewed from the side. When viewed from the front, it is rendered in its full color.
|
||||
Animation | animation | Enables leaves animation (if they are moved by wind). | ||||
Phong shading | phong | Specifies if additional normal and specular maps for the leaves lighting will be added. If disabled, the whole leaf polygon will be lit uniformly. | ||||
Color noise | noise | Specifies if additional spatial noise and color gradient textures will be added. These textures add a random color variation to leaves.
|
||||
Shadow shafts | volumetric | Specifies if volumetric shadows from world lights will be rendered from surfaces with the applied material.
|
||||
Ambient light | ambient_light | Optimizes leaves rendering. When enabled, leaves are rendered only once - during the ambient rendering pass, and are not redrawn one more time for a world light pass (it is automatically skipped in this case).
This option allows to get rid of leaf flickering caused by the limited depth buffer precision in the distance.
It is not possible to use two or more world light sources to light leaves if this option is enabled. This limitation does not apply to other types of light sources. |
Textures
In the Textures tab of the Materials Editor you can:
- Load the textures - click a Load button near the texture and specify the path to the texture or type the path in the texture field manually
- Open the view window to see texture's details - click a View button near the texture
- Set the current texture to default one - click a Set to parent button near the texture (if the texture is different from the default one, its field will be highlighted with green)
The textures available for this kind of materials are listed below.
Base Textures
Base textures are loaded and modified in the Base field of the Textures tab. Normal and specular textures are present only if Phong Shading option in the States tab is enabled.
GUI name | XML name | Description | Channels | ||||
---|---|---|---|---|---|---|---|
Diffuse | diffuse | Diffuse map. A texture to define a surface's main color.
|
RGBA:
An alpha (A) value will store transparency values if an Alpha test option is enabled. Otherwise it will store a detail mask. |
||||
Thickness | thickness | A texture to darken leaves and make the foliage look more thick. It is visible only against the light and allows to create leaf vein patterns. Thickness value is subtracted from translucency. | R: The higher the color value, the darker the leaves are (the thicker the foliage). | ||||
Normal | normal | Normal map. A texture to store information about a surface's normals deviation.
Use only 2-channel normal map
|
RG:
|
||||
Specular | specular | Specular map. A texture to define a surface's shininess and highlight color.
Specular map
|
RGBA:
|
Additional Textures
Additional textures are present only if an Color noise option is enabled and are modified in the Additional field of the Textures tab.
GUI name | XML name | Description | Channels |
---|---|---|---|
Spatial noise | noise | A 3D noise texture to randomize the coloring of leaves according to the gradient color texture.
3D color noise texture (rotated and cut)
|
R. |
Color gradient | color | A gradient texture that modulates leaves colors (for example, from bright green to yellow).
Color gradient |
RGB. 0.5 means the texture does not affect leaf color. Higher values lighten the colors (are added). Lower values darken the colors (are subtracted). |
Parameters
In the Parameters tab you can set or modify base and additional parameters.
Parameters of different types are set in different ways:
- expression - vector values can be set either in the field near the parameter or in the dialog window opened when double clicking this field
- slider - the value can be set either by smoothly moving the slider of the scroll box or manually in the box near the parameter (if required, the value bigger than maximum one for the slider can be set)
- color - the color can be chosen in the dialog window, activated after double clicking the color field
All the parameters can be set to default ones - click a Set to parent button near the parameter (if the parameter is different from the default one, its field will be highlighted with green).
The parameters available for this kind of materials are listed below.
Transform Parameters
Texture transformation parameters are modified in the Transform field of the Parameters tab. Detail materials transformation parameters are present only if the Detail option is enabled.
Animation Parameters
Animation parameters are present only if an Animation state is enabled. Leaf noise, Leaf offset and Leaf scale parameters are present only if leaves are rendered as billboards. The parameters are modified in the Animation field of the Parameters tab.
GUI name | XML name | Type | Description |
---|---|---|---|
Stem noise | animation_stem_noise | slider |
A coefficient to scale a spatial noise that diversifies the direction of movement of the vegetation stems.
Should be the same as in the mesh_stem_base material.
|
Stem offset | animation_stem_offset | slider |
A coefficient to scale an amplitude of horizontal movement for the vegetation stems.
Should be the same as in the mesh_stem_base material.
|
Stem radius | animation_stem_radius | slider |
A coefficient to scale an amplitude of vertical movement for the vegetation stems.
Should be the same as in the mesh_stem_base material.
|
Stem scale | animation_stem_scale | slider |
A coefficient to scale the speed of vegetation stems movement.
Should be the same as in the mesh_stem_base material.
|
Leaf noise | animation_leaf_noise | slider | A coefficient to randomize the orientation and direction of rotation for leaves (seen only on several nodes with the same material). By the minimum value of 0, all leaves are synchronized in their movement. By higher values leaves randomly move in different directions. |
Leaf offset | animation_leaf_offset | slider | A coefficient to scale leaves rotation amplitude. By the minimum value of 0, leaves do not move at all. By higher values leaves move with greater amplitude. |
Leaf scale | animation_leaf_scale | slider | A coefficient to scale the speed of leaves rotation. By the minimum value of 0, leaves do not move at all. By higher values leaves move with faster. |
Auxiliary Parameters
Auxiliary color parameter is present only if an Auxiliary pass is set as a Default. The parameter is modified in the Auxiliary field of the Parameters tab.
GUI name | XML name | Type | Description |
---|---|---|---|
Stem radius | animation_stem_radius | slider |
A coefficient to scale an amplitude of vertical movement for the vegetation stems.
Should be the same as in the mesh_stem_base material.
|
Auxiliary | auxiliary_color | color | A color picker to choose an auxiliary color for the Auxiliary rendering pass. |
Stem scale | animation_stem_scale | slider |
A coefficient to scale the speed of vegetation stems movement.
Should be the same as in the mesh_stem_base material.
|
Base Parameters
Shadow base parameter is present only if leaves are rendered as billboards. Angle base parameter is present only if Angle fade option in the States tab is enabled.The parameters are modified in the Base field of the Parameters tab.
GUI name | XML name | Type | Description | ||||
---|---|---|---|---|---|---|---|
Shadow | shadow_offset | slider |
A coefficient to determine how much billboard leaves are shadowed. Shadow offset adjusts the distance from a leaf to the light.
Negative values decrease the distance to the light, making leaves less shadowed.
By the value of 0, there is no adjustment at all.
Positive values increase the distance from the light, making the leaves more shadowed.
|
||||
Angle | angle_power | slider | A coefficient to scale the fade angle. |
Ambient Parameters
Ambient parameter is modified in the Ambient field of the Parameters tab.
GUI name | XML name | Type | Description |
---|---|---|---|
Environment | environment_scale | slider | Environment lighting scale. A coefficient to scale how much the global environment texture illuminates the surface. The higher the value, the more the colors will be corrected (lightened or darkened) according to the environment component. |
Shading Parameters
Shading parameters are modified in the Shading field of the Parameters tab.
GUI name | XML name | Type | Description | ||||
---|---|---|---|---|---|---|---|
Translucency | translucent_scale | slider |
Translucency of the leaves when looking at them against the light (independent from the alpha channel):
|
||||
Thickness | thickness_scale | slider |
The visibility of thickness texture when looking at leaves against the light, thus modulating the thickness of the foliage:
|
||||
Diffuse | diffuse_color | color |
A color picker to choose the color of the diffuse map. |
||||
Diffuse | diffuse_scale | slider | A coefficient to scale the brightness of the diffuse map. The higher the value, the brighter the diffuse map is. | ||||
Specular | specular_color | color |
A color picker to choose the color of the specular map. |
||||
Specular | specular_scale | slider | A coefficient to scale the brightness of the specular map reflections. The default value of 1 grants the correct color. The higher the value, the brighter the specular reflections are. | ||||
Glossiness | specular_power | slider |
A coefficient to modify size of the highlight (Phong lighting) of the specular map:
|
Noise Parameters
Noise parameters are present only if Color noise option is enabled in the States tab and are modified in the Noise field of the Parameters tab.
GUI name | XML name | Type | Description | ||||
---|---|---|---|---|---|---|---|
Transform | noise_transform | expression | Noise textures native coordinates transformation along X, Y and Z axes. A vector of the three float components:
|
||||
Scale | noise_scale | expression | Noise textures native coordinates transformation along X, Y and Z axes. A vector of the three float components:
|