Materials

From Space Engineers Wiki
Jump to navigation Jump to search

Materials are the color displayed on models in the game. They are made up of several textures, containing various information, as well as additional parameters.

Material Definition

Here is an example for a material definition in Space Engineers:

	<Material Name="Atlas3_Colorable">
		<Parameter Name="Technique">DECAL_CUTOUT</Parameter>
		<Parameter Name="ColorMetalTexture">Textures\Models\Cubes\Atlas3_Colorable_cm.dds</Parameter>
		<Parameter Name="NormalGlossTexture">Textures\Models\Cubes\Atlas3_Colorable_ng.dds</Parameter>
		<Parameter Name="AddMapsTexture">Textures\Models\Cubes\Atlas3_Colorable_add.dds</Parameter>
		<Parameter Name="AlphamaskTexture">Textures\Models\Cubes\Atlas3_alphamask.dds</Parameter>
	</Material>

Note that this does not include all parameters a material definition can hold.

Materials in Blender

Note that the material shown in Blender with SEUT is not representative of what it looks like ingame. Space Engineers does not care about the material node tree within Blender at all, as it pulls all material information exclusively from the material definition as shown above. The only way to adjust the appearance of the material ingame is by editing the texture files or the parameters of the material within that material definition.

SEUT does do this on export of a model using a custom material, however it cannot save properties that Space Engineers does not accept as input. As a result, any changes you may make in the Blender Shader Node Editor beyond the paths to the predefined image files as well as the parameters that can be defined within the SEUT Shader Node Editor menu won’t have any effect ingame.

Textures

Textures are images made up of RGB information. Each of these colors have their own channel, together making up a full RGB color image. In addition, there is a fourth channel which is alpha - transparency, which defines which parts of an image are transparent. Looking at a channel’s color information independently of other channels results in a black / white image with black defining areas that do not contain this channel’s color, and white defining the areas which contain 100% of that channel’s color. The shades of grey define areas that contain some of that channel’s color - the closer to white, the more of that color.

Space Engineers uses the fact that color information can be separated into these four channels - RGB and Alpha - by storing different information within them. As such, the following will introduce what channel is used for which information within the (up to) four textures that can make up a material.

Textures for Space Engineers are saved in the DDS format with BC7 compression. Unfortunately, many applications do not (yet) support this format.

Texture resolutions must be to the power of 2 but don’t have to be square: 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 etc. are valid numbers of pixels for the height or width of a texture.

CM: Color / Metalness

texconv [path in] -ft DDS -f BC7_UNORM_SRGB -sepalpha -sRGB -y -o [path out]

RED, GREEN, BLUE Channels: Material Color

This is the base color of the material.

ALPHA Channel: Metalness

The amount of Metalness influences the way light is reflected off of the material.

NG: Normal / Gloss

texconv [path in] -ft DDS -f BC7_UNORM -sepalpha -y -o [path out]

RED, GREEN, BLUE Channels: Normal Map

Normal Maps make flat textures look like they have 3D detail on them.

ALPHA Channel: Gloss

Together with Metalness, Gloss influences the way light is reflected off of the material.

ADD: Additive

texconv [path in] -ft DDS -f BC7_UNORM_SRGB -if POINT_DITHER_DIFFUSION -sepalpha -sRGB -y -o [path out]

RED Channel: Ambient Occlusion

Ambient Occlusion, in essence, helps the material appear more 3D. It contains shadow information that corresponds to the 3D information stored in the Normal Map. If no AO exists, this channel should be fully white.

GREEN Channel: Emissiveness

Emissiveness defines area on a texture that emit a glow. The glow’s color is based on the CM texture’s color at that same location. The more white the pixels of this channel are, the stronger the glow.

BLUE Channel: Unused

This channel used to contain information used for certain terrain materials. It is not in use anymore.

ALPHA Channel: Paintability

The information contained within this channel tell the game which parts of your material can be painted with a color and to what intensity. The more white the pixels of this channel are, the stronger the paint will overlay over the existing colors.

ALPHAMASK: Alpha Masked

texconv [path in] -ft DDS -f BC7_UNORM -if POINT_DITHER_DIFFUSION -y -o [path out]

RED, GREEN, BLUE Channels: Alpha Mask

White areas in this texture define opaque areas on the material, black areas define transparent areas.

ALPHA Channel: Unused

This channel is unused.

Example

These example images by Digi show how Metalness and Gloss interact with materials of different types ingame under different conditions. The numbers represent the color value of the gloss / metalness channels from their maximum of 255 to their minimum of 1.

Additional Parameters

Materials can define a selection of additional parameters. However, not all of them will work on all types of materials. All of them can be set through the SEUT Shader Node Editor menu.

Technique

This parameter defines the way Space Engineers renders the material. Valid techniques are:

  • MESH - The standard technique.
  • DECAL - Makes the material look like it’s part of the model behind it.
  • DECAL_NOPREMULT - Higher accuracy of transparency than ‘DECAL’, but same visual style.
  • DECAL_CUTOUT - Makes the material look like it cuts into the model behind it.
  • GLASS - Transparent material - requires additional values to be set in TransparentMaterials.sbc.
  • ALPHA_MASKED - Has an alphamask texture.
  • SHIELD - Animated material used on SafeZone shield - currently limited to default one.
  • HOLO - Transparent LCD screen texture.
  • FOLIAGE - Used for half-transparent textures like leaves - shadows observe transparency in texture.
Using the Technique SHIELD on a material applied to a block of certain types might cause Space Engineers to crash.

Facing

This parameter affects the way a mesh is rotated towards camera. Valid options are:

  • None - The default which disables this feature.
  • Vertical - Rotates mesh towards the camera around model's up axis.
  • Full - Rotates mesh on all axis to always face towards camera.
  • Imposter - Uses a special texture layout to switch between perspectives as camera moves around it (More research required).

Also note that shadows don't reflect the rotated mesh properly.

Wind Scale FOLIAGE

This parameter is mainly relevant for tree and bush materials, but if you use the technique FOLIAGE, it can also be used on blocks. It determines the amount of displacement of the material during the wind animation.

Wind Frequency FOLIAGE

This parameter is mainly relevant for tree and bush materials, but if you use the technique FOLIAGE, it can also be used on blocks. It determines the speed of the displacement animation of the material.

Transparent Materials

If a material is set to use GLOSS, HOLO or SHIELD as Technique, they are automatically connected with an entry in TransparentMaterials.sbc (using the material’s name as the SubtypeId). This allows for a number of additional parameters to be defined for the material. Find detailed informations about TransparentMaterial-entries on the TransparentMaterials Reference page.

Two texture types can be linked to this entry:

CA: Color / Alpha

RED, GREEN, BLUE Channels: Material Color

This is the base color of the material.

ALPHA Channel: Alpha

White areas in this texture define opaque areas on the material, black areas define transparent areas.

NG: Normal / Gloss

texconv [path in] -ft DDS -f BC7_UNORM -sepalpha -y -o [path out]

RED, GREEN, BLUE Channels: Normal Map

Normal Maps make flat textures look like they have 3D detail on them.

ALPHA Channel: Gloss

Together with Metalness, Gloss influences the way light is reflected off of the material.