Documentation/Articles/Overview of Material Editor

From NeoAxis Engine Wiki

Jump to: navigation, search
Go to higher level
NeoAxis Material Editor

Contents

Description

Material Editor is a part of Resource Editor. Being one of major editors, it is designed for material adjustment. You can use Material Editor to adjust texture, animation, transparency, and shades for colors and reflections.

To edit a material, you have to double-click on it or just select the Edit button from context menu. Editable properties will be appear in a side window.

MaterialEditor 010.jpg

With the Properties window you can only edit properties of *. highMaterial files. *.material files are not officially supported and will be removed in the nearest future.

Editor Adjustment

Click on the Options button and select the Material Editor option in order to specify the following properties:

Name Description
Background Color Main background color in the editor.
Preview Mesh Name Name of a 3d model, to apply the material to during preview.
Show Axes If this parameter is set to True, auxiliary axes will be shown to facilitate orientation in space.
Show Grid If this value is set to True, a meter grid will be displayed.
Sky Box Specifies the Sky Box, to be displayed in the background when viewing the edited material .
Light Diffuse Color Specifies color of light illuminating the edited material.
Light Position Specifies position of the light source that illuminates the edited material.
Light Specular Color Specifies color of reflected light to illuminate the edited material.
Ambient Light Color Specifies brightness of the light source.

You can configure up to three light sources for the edited material, by specifying Light 2 and Light 3 parameters.

Material Creation

In order to create a new material, you have to right-click on a folder and select the New Resource option.

MaterialEditor 012.jpg

In the New Resource window, specify the resource type:Material. Click the Continue button.

MaterialEditor 013.jpg

In the next window specify a name for the new material, chose the material type, then click the Next button.

Available material types:

  • ShaderBaseMaterial - The base material type in the engine. This is the most commonly used material type.
  • FPSWeaponMaterial - This material is intended for use with weapon types. The key feature of this material is that it is visible through any objects. It is necessary so that weapon does not penetrate other objects in first-person view.
  • VegetationMaterial - This material is used for grass and tree creation. This material is animated, making an impression of "teeter in the wind."
MaterialEditor 014.jpg

After a material has been created, you have to double-click the file, containing this material.

MaterialEditor 015.jpg

Material Parameters

All material types have same parameters. For this reason we will only consider the ShaderBaseMaterial material type in this article. This is the basic material type used in most materials.

Parameters of basic shader effects

You can use shader effects to add transparency, adjust lighting of the material, etc.

Parameter Description
AllowFog Applies fog effect in case it is enabled. E.g.: this feature is disabled for the SkyBox TYPE, so that even in heavy fog the skies would stay clear)
AlphaRejectFunction Disables pixel rendering, depending on the value of alpha-channel of the texture. By default this function is set to AlwaysPass, i.e. always allow rendering.
AlphaR ejectValue The alpha value for pixel discarding in AlphaRejectFunction mode.
AlphaToCoverage Enables the Alpha To Coverage mode for rendering of transparent objects.
Blending Transparency type selection. Opaque for opaque material; AlphaAdd for additive blending; AlphaBlend to take the transparency value from the alpha channel of the diffuse texture.
Culling Show triangles directed from the camera.
DepthTest Switches depth test on/off.
DepthWrite Enables\disables writing to depth buffer when rendering geometry.
FadingByDistanceRange Fades an object with a specified material out when the camera moves away at a certain distance. This parameter is defined by two values: 1. The distance to start object fading at. 2. The distance, at which the object becomes completely transparent.
Lightning Enables lighting for this scene.
ReceiveShadows Enables shadow rendering on models with the specified material.
UseNormals Enables/disables normal processing for triangles when calculating lighting. We recommend you to switch this parameter off for grass, in order to make triangles evenly illuminated.

Parameters of diffuse maps

MaterialEditor 001.jpg
Parameter Description
Diffuse"№"Map With this parameter you can select basic textures (up to four at the same time) and adjust their mixing using advanced mixing settings (see below).
DiffuseColor Enables color adjustment of the main texture.
DiffusePower Gain factor of the DiffuseColor parameter.
DiffuseScaleDynamic Specifies if the DiffuseColor of the material may change during operation.
DiffuseVertexColor Enables the use of vertex colors for 3d models. Each vertex can have a certain color affecting the material.


Parameters for self-illumination maps

Self-illumination means that the material will be illuminated, even when lighting is off.

MaterialEditor 002.jpg
Parameter Description
EmissionMap Specifies emission map.
EmissionScale Specifies light color for the emission map.
EmissionScaleDynamic Specifies if the EmissionScale parameter of the material may change during operation.


Parameters of normal maps and heightmaps

Normal maps and bump heights are used for implementing surface effects. With this technology, you can significanly reduce the number of polygons, though retaining picture quality.

MaterialEditor 003.jpg
Parameter Description
NormalMap Specifies a normal map for the material.
HeightMap Specifies a heightmap for the material.
HeightFromNormalMap If this parameter is set to true True, the height value will be taken from alpha-channel of the normal map.
HeightScale Height factor. Determines the maximum possible height value.


Parameters for glares and glare maps

The key feature of glares is the fact that they can only be seen at a certain angle relative to the model.

MaterialEditor 004.jpg
Parameter Description
SpecularMap Specifies a specular map for the material.
SpecularScale Specifies glare color for the material.
SpecularScaleDymanic This parameter is used to specify that the SpecularScale parameter of the material may change during operation.
SpecularShininess Determines glare intensity (dispersion angle).


Parameters of reflection maps

Reflection maps are used for applying precomputed reflections. I.e. reflections are obtained from precomputed cube textures, that can be created in Map Editor.

MaterialEditor 005.jpg
Parameter Description
ReflectionMap Specifies a mask/stencil to use when applying reflection maps.
ReflectionScale Specifies reflection map color.
ReflectionScaleDynamic Specifies if the ReflectionScale parameter of the material may change during operation.
ReflectionSpecificCubemap Enables the use of specially designated cubemap reflection maps. If the value of this parameter is not specified, the global reflection map will be used. You can learn more on this link.


Advanced map parameters

Advanced settings are available for all map types (Diffuse, Specular, Emission, Height, etc.). To view them, open the map parameters list.

MaterialEditor 016.jpg
Parameter Description
Texture Specifies a texture for the chosen map.
Clamp Enables clamping of texture coordinates if they are less than 0 or greater than 1.
TexCoord Specifies a channel for texture coordinates.

Transform

With the "transformation" property you can change texture size, rotate it or move it right on the material.

Parameter Description
DynamicParameters Specifies if transformation parameters may change during operation.
Rotate Enables texture rotation about Z axis.
Scale Enables you to change texture size in X and Y direction.
Scroll Enables you to shift ("scroll") texture along X and Y axes.

Animation

With this tab, you can animate texture on material.

Parameter Description
RotateSpeed Specifies texture rotation speed along Z. If the value of this parameter is positive, the texture is rotated counterclockwise, if the value is negative the texture is rotated clockwise.
ScrollSpeed Enables scroll speed adjustment for the texture.
ScrollRound With this parameter you can adjust scrolling to be performed with certain intervals. This parameter is used for creating animations, where texture is comprised of numerous images that have to be scrolled. For example, using this parameter, you can implement animation of an explosion.