# Material data

Materials contain color, intensity and multi-layered textures properties for the different channels. There are a number of different standard color channels and the user is also able to create custom user channels.

Materials in Simplygon support multi layered textures. Each channel in a Simplygon material can be composed of multiple texture layers having their own UV set. Multi layered textures for a channel are baked into a single texture while casting based on the blend function, see the casting with texture blend example.

# MaterialTable

The MaterialTable is a collection of materials. The material table is assigned to an object. The material each part of the geometry is using is found in the array of material IDs received when calling GetMaterialIds from the geometry object.

# Material

The Material class contains the material information. Materials are either imported alongside the object or created using the Simplygon API. They are identified by their name or index and the names are set with SetName. Channels for all commonly used PBR and non-PBR material models are pre-defined in Simplygon, and it is possible to add additional user-defined custom channels as well. The channels are defined using shading networks. If a shading network with texture nodes is used, a texture table must also be defined in order to successfully use any of the Simplygon material casters.

  • AddUserChannel
    Creates user channels in the material.

  • ShadingNetwork
    Set/get a shading network that will be used instead of the defined texture path or texture image in the relevant channel.

# TextureTable

The TextureTable is a collection of textures. This structure is used by the material casters when casting based on input materials defined by shading networks. Each texture referenced by a texture node in the shading node networks that define the input materials must be represented in this table, which is supplied to the material casters along with the material table.

# Texture

The Texture class contains definition of a single texture. The image data can either be defined using a single file path pointing to the input image, or by setting its ImageData object directly, using the format discussed in the Image Data section. When these are added to the texture table for usage in material casting with node networks, the name, as set by SetName(), is the identifier used to correlate a texture in the shading networks with a texture in the texture table. The Material Casting Example contains an example implementation of how to use this in a casting context properly.

# Material casting

For information about casting materials see the Material Casters section.

# Example

This example shows how to use the Reduction processor with material casting.