This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

mesh_reflection_2d_base

A mesh_reflection_2d_base material is used for flat meshes, dynamic meshes and skinned meshes with 2D reflections. If you need to create reflections on complex or curved surfaces, use a mesh_reflection_cube_base material.

Notice
Meshes, for which this material is applied, should be exported in zero coordinates (either world or local ones).

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.

For this material states divide into 3 groups: Passes, Options and Reflection.

Possible values for an Ambient pass:

GUI name XML name Description
Skip none Material is not rendered.
Opacity opacity Material diffuse colors are blended with the ambient color.
Transparent transparent Material diffuse colors are not modulated by the ambient color.
LightMap lightmap Material is rendered lit by a light map. Material diffuse colors are multiplied by the light map and the ambient color. To create and automatically set a light map for an object, a Lightmap Generation Tool can be used.

Possible values for a Light omni, Light proj and Light world passes:

GUI name XML name Description
Skip none Material is not rendered.
Phong rim phong-rim Material is rendered with a Phong rim shading (by default) or simple Phong shading*
Anisotropy anisotropy Material is rendered with anisotropic shading. This shader creates surfaces with elliptical (anisotropic) specular highlights (for example, reflections from the brushed metal).

* The shading to be used depends on the Phong rim option (or a render_use_phong_rim console command value).

Possible values for all the other 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 Detail option:

GUI name XML name Description
Skip disabled A material is not rendered.
Overlay first overlay_0

Material is rendered in the Overlay mode: detail textures are blended with the base ones according to the first UV coordinates.

The formula is: A + (B - 0.5) * k,
where A and B are base and detail textures correspondingly;
k is an alpha blending coefficient that allows smooth interpolation between alpha values of base and detail textures.

For example, if Alpha test option for material is disabled, k = base Alpha * detail Alpha.

Overlay second overlay_1 Material is rendered in the Overlay mode: detail textures are blended with the base ones according to the second UV coordinates.
Multiply first multiply_0

Material is rendered in the Multiply mode: detail textures are blended with the base ones according to the first UV coordinates.

The formula is: mix(A,A * B,k),
where A and B are base and detail textures correspondingly;
k is an alpha blending coefficient that allows smooth interpolation between alpha values of base and detail textures.

Multiply second multiply_1 Material is rendered in the Multiply mode: detail textures are blended with the base ones according to the second UV coordinates.

All the other options can be either enabled or disabled by ticking the respective boxes.

Possible values for an Map size reflection parameter:

GUI name XML name Description
128 128 A size of the reflection image is 128 pixels.
256 256 A size of the reflection image is 256 pixels.
512 512 A size of the reflection image is 512 pixels.
1024 1024 A size of the reflection image is 1024 pixels.
2048 2048 A size of the reflection image is 2048 pixels.
quart_height quart_height A size of the reflection image is a quart of the height value.
half_height half_height A size of the reflection image is a half of the height value.
height height A size of the reflection image is equal to the height value.

Possible values for an Filter reflection parameter:

GUI name XML name Description
Skip disabled Reflection image is not filtered.
One pass 1x Reflection image is filtered during the one pass.
Two passes 2x Reflection image is filtered during two passes.
Three passes 3x Reflection image is filtered during three passes.
Four passes 4x Reflection image is filtered during four passes.

All the other reflection options can be either enabled or disabled by ticking the respective boxes.

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.
Refraction refraction Specifies if the material should be rendered during the refraction pass. For transparent surfaces see also Post refraction option.
Velocity velocity Specifies if the material should be rendered in the velocity buffer to create motion blur for moving objects, i.e. physical objects. It makes no sense to write static objects into this buffer as they do not have their own velocity.
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
Detail detail Specifies if additional detail textures with the specified UV channel will be provided for the material. Such textures allow to render unique details (such as dirt or worn spots).
Parallax mapping parallax Specifies if an additional height texture will be provided for the material and a parallax mapping technique will be applied to it.
Ambient emission emission Specifies if a light emission (glow) should be simulated for the material and an additional emission texture will be simulated for the material.
Shadow shafts volumetric Specifies if volumetric shadows from world lights will be rendered from surfaces with the applied material.

Reflection

The following reflection options are set in the Reflection field of the States tab.

GUI name XML name Description
Dynamical reflection_dynamic Specifies if the reflection is dynamic. Disabling this parameter specifies that the static reflection texture will be added.
Map size reflection_size Specifies the size of the reflection in pixels.
Filter reflection_filter Specifies the amount of rendering passes for the post-process filter.
Shared reflection_shared Specifies if the reflection will be shared with all the nodes across nodes hierarchy.
Shadow reflection_shadow Specifies if shadows will be rendered in the reflection.
TwoSided reflection_two_sided Specifies if the reflection is two-sided.

Textures

The textures available for meshes are listed below.

Base Textures

Base textures are loaded and modified in the Base field of the Textures tab.

GUI name XML name Description Channels
Diffuse diffuse Diffuse map. A texture to define a surface's main color. RGBA:
  • RGB values store a color of the texture
  • An alpha (A) value contains either transparency values or a detail mask
Notice
An alpha (A) value will store transparency values if an Alpha test option is enabled. Otherwise it will store a detail mask.
Normal normal Normal map. A texture to store information about a surface's normals deviation. RG:
  • RG values contain two components of a normal
  • The third component's value is calculated from the given components
Specular specular Specular map. A texture to define a surface's shininess and highlight color. RGBA:
  • RGB values store reflection color and intensity (black color means no reflection)
  • An alpha (A) value specifies the specular power: 0 means specular highlights are very bright and intense, 256 - specular highlights are dull

Detail Textures

Detail textures are present if Detail option on the States tab is enabled and can be loaded and modified in the Detail field of the Textures tab.

GUI name XML name Description Channels
Diffuse diffuse_detail Diffuse map. A texture to define a surface's main color. RGBA:
  • RGB values store a color of the texture
  • An alpha (A) value contains either transparency values or a detail mask
Notice
An alpha (A) value will store transparency values if an Alpha test option is enabled. Otherwise it will store a detail mask.
Normal normal_detail Normal map. A texture to store information about a surface's normals deviation. RG:
  • RG values contain two components of a normal
  • The third component's value is calculated from the given components
Specular specular_detail Specular map. A texture to define a surface's shininess and highlight color. RGBA:
  • RGB values store reflection color and intensity (black color means no reflection)
  • An alpha (A) value specifies the specular power: 0 means specular highlights are very bright and intense, 256 - specular highlights are dull

Additional Textures

Additional parallax and emission textures are present only if an Ambient emission and Parallax mapping options are enabled and are modified in the Additional field of the Textures tab.

GUI name XML name Description Channels
Parallax parallax Parallax map. A height texture for per-pixel parallax displacement. R value stores height data (white areas correspond to the neutral value, such pixels are not displaced; black areas correspond to pixels that will be depressed farthest away).
Emission emission Emission map. A texture to store information about the light emission. RGBA:
  • RGB values store a glowing color
  • An alpha (A) value stores a glow mask: black is for non-glowing areas, white - for glowing ones
Ambient ambient

Ambient map. A texture to modulate the global environment illumination (when an object is lighter at the top from sky above, darker at the bottom from the ground below etc).

The texture takes effect only if the scene environment texture is loaded.

RGBA:

  • RGB values store a glowing color
  • An alpha (A) value stores a glow mask: black is for non-glowing areas, white - for glowing ones

Second UV map channel.

LightMap Textures

Light map texture is present if a LightMap option is selected to be used during an Ambient pass. The texture can be loaded and modified in the LightMap field of the Textures tab.

GUI name XML name Description Channels
Lightmap lightmap Light map. A texture to store lighting information.

RGB:

  • RGB values store a color of the light
  • An alpha (A) value does not influence anything and is used solely for viewing convenience

Second UV map channel.

Reflection Textures

Reflection static texture is present if a Dynamic option is in the Reflection field of the States tab is disabled. The texture can be loaded and modified in the LightMap field of the Textures tab.

GUI name XML name Description Channels
Static reflection Static reflection mask. A texture to store reflection information. RGB values store a reflection mask of the specified value.
Notice
The above textures with the _d (diffuse map), _n (normal map), _s (specular map) and _h (parallax map) postfixes in the name respectively, located in a folder named uncompressed, will be automatically compressed by the engine.

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

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.

GUI name XML name Type Description
Base base_transform expression Base texture coordinates transformation. A vector of the four float components, consisting of two pairs of vector elements:
  1. Scale texture coordinates, along X and Y axes.

    For example, by the scale of 2;2 the texture will be repeated four times on the surface.
  2. An offset of the texture respectively to its initial position along X and Y axes. For example, by the offset of 0.5 along X axis the texture will be repositioned to the right (so the left edge of the texture will be rendered in the center).
Detail detail_transform expression Detail texture native coordinates transformation. A vector of the four float components, consisting of two pairs of vector elements:
  1. Scale texture coordinates, along X and Y axes.
  2. An offset of the texture respectively to its initial position along X and Y axes.

Notice
Besides the native texture coordinates transformation, there are more options of setting texture coordinates. They are described in the Texture coordinates transformation article.

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
Auxiliary auxiliary_color color A color picker to choose an auxiliary color for the Auxiliary rendering pass.

Detail Parameters

Detail parameters are activated only if the a Detail option in the Options tab is enabled and a detail material is created.

Detail material parameters are modified in the Detail field of the Parameters tab.

The detail material has the following parameters:

GUI name XML name Type Description
Diffuse detail_diffuse slider A coefficient to modify the visibility of the detail diffuse map:
  • By the minimum of 0, the diffuse texture is not visible at all
  • By the maximum of 1, the diffuse texture is fully appeared
Normal detail_normal slider A coefficient to modify the visibility of the detail normal map.
Specular detail_specular slider A coefficient to modify the visibility of the detail specular map.

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.

Lightmap Parameters

Light map parameter is present only if an LightMap option is set during the Ambient Emission rendering pass. The parameter is modified in the Lightmap field of the Parameters tab.

GUI name XML name Type Description
Scale lightmap_scale slider A coefficient to scale the intensity of illumination by the light map.

By the value of 0 the light map does not illuminate the surface with this material applied.

The higher the value, the more visible and the brighter a light map is.

Parallax Parameters

Parallax height parameter is present only if an Parallax mapping option is enabled and is modified in the Parallax field of the Parameters tab.

GUI name XML name Type Description
Height parallax_scale slider A coefficient to scale a parallax height map offset.

The higher the value, the bigger a height map offset is.

Emission Parameters

Emission parameters are present only if an Ambient emission option is enabled and are modified in the Emission field of the Parameters tab.

GUI name XML name Type Description
Color emission_color color

A color picker to choose an ambient emission color for the emission texture.

Scale emission_scale slider Visibility scale for the emission texture.

The higher the value, the more visible emission texture is: light areas will be lighter and brighter.
Glow glow_scale slider A coefficient to scale the glow component of the emission texture, which creates a halo around an object surface.

The higher the value, the larger the halo and the brighter the material.
Notice
To increase the glow parameter a lot, go to the Render settings -> Postprocess tab -> Glow small parameter to increase the glow throughout in the scene. After that, readjust the glow on the per-material basis.

Refraction Parameters

Refraction parameters are present only if Refraction pass option set as Default and are modified in the Refraction field of the Parameters tab.

GUI name XML name Type Description
Scale refraction_scale slider A coefficient to scale the refraction area.

By the value of 0 there is no refraction of the light for the material.

The higher the positive value, the more distorted the image behind the refracting material is.

Negative values invert the direction of distortion: the lower the negative value, the bigger a distortion is.
Power refraction_power slider A coefficient to scale the refraction post-processing power.

The higher the value, the brighter the reflection is.

Shading Parameters

Shading parameters are modified in the Shading field of the Parameters tab.

GUI name XML name Type Description
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:

  • Low values imitate wider highlights, typically appropriate to create diffuse reflection from the mat surface
  • High values imitate pinpoint highlights, typically appropriate to create uniform reflection of light rays from the glossy surface
Phong rim width phong_rim_width slider A coefficient to modify the width of an additionally lightened rim of an object, where incident light is perpendicular to surface being lit:
  • By the minimum value of 0, there is no additional lightning of the rim by Phong shading
  • By the maximum value of 1, all the shaded area is lightened according to the scale parameter
Phong rim scale phong_rim_scale slider A coefficient to scale brightness of the additionally lightened rim at the edges of an object, where incident light is perpendicular to surface being lit:
  • By the minimum value of 0, there is no additional lightning of the rim by Phong shading
  • By the maximum value of 1, the shaded edges are the brightest
Anisotropy angle anisotropy_angle slider A coefficient to modify the main angle determining direction of the anisotropy reflective highlight.

The angle in range from 0 to 180 degrees determines a clockwise rotation of the reflective highlight.
Notice
This parameter takes effect only if anisotropic shading option is enabled.
Anisotropy scale anisotropy_scale slider A coefficient to control the anisotropy strength and thus the shape of the reflective highlight:
  • By the minimum value of 0, the material shows no anisotropic properties. Phong shading is applied
  • By the maximum value of 4, the material has the highest anisotropy and most directional and narrow reflections from the surface
Notice
This parameter takes effect only if anisotropic shading option is enabled.
Fresnel bias fresnel_bias slider A coefficient to compensate for the Fresnel effect and set the minimum necessary reflectance level.

By the minimum value of 0, there is no compensation for the Fresnel effect.

Increasing the value leads to more prominent overall reflections.

By the maximum value of 1, reflections are at their maximum and the Fresnel power parameter does not influence the rendered image.
Fresnel power fresnel_power slider

A coefficient to scale Fresnel effect that defines the amount of reflectance depending on the viewing angle:

  • Low values provide good reflectance even at a large viewing angles
  • High values provide the reflectance only at a small viewing angles. When looking at a large viewing angle, from above, there are no reflections rendered

Reflection Parameters

Reflection parameters are modified in the Reflection field of the Parameters tab. Mask and Plane parameters are activated only when the Dynamical option in the States tab is enabled.

GUI name XML name Type Description
Mask reflection_mask expression A mask that specifies materials to reflect.

Each bit of the value contains a separate mask.
Plane reflection_plane expression Reflection plane coordinates. A vector of the four float components:
  • First three elements - a reflection normal coordinates
  • The fourth element - an offset along the normal
Distance reflection_distance value Reflection rendering distance, units.
Normal reflection_normal slider A coefficient to scale the reflection of the normal map.
Power reflection_power slider A coefficient to filter the bright spots of reflection.

The higher the value, the brighter the spot will be.
Color reflection_color color A color picker to choose a reflection color.
Scale reflection_scale slider A coefficient to modify the influence of the reflector normal map's distortion.
Last update: 2017-07-03
Build: ()