Material baking
Material baking is a feature available for most pipelines. It takes the materials of a mesh and merges them into one single simple material. It uses a Mapping image and Material casters to cast the different material channels to separate textures. After material casting is finished a new Unreal Engine material will be automatically created using the new textures.
Note
The Simplygon plugin uses Unreal Engine's flattening to bake Unreal Engine material channels into textures, and then pass them along with the rest of the scene to Simplygon. Material export depending on the flattening functionality has a few limitations, such as unsupported material nodes which could lead to black textures. If this happens, try playing around with the Material Proxy Replace node to bypass the unsupported node.
Material Proxy Replace details
The Material Proxy Replace node is a material node that can be used when you want to use a different or simplified material for material flattening purposes.
It functions such that it uses the "Realtime" input at runtime, and the “MaterialProxy” input during the generation process.
Mapping image settings
Simplygon uses a mapping image under-the-hood to cast new textures. It's possible to tweak settings related to this, such as texture resolution and gutter space, by going into the Mapping Image Settings under the Pipeline settings.
Material property casters
All pipelines that support material baking has a property called Material Property Casters. Each entry in the Material Property Casters list corresponds to a material channel getting baked to a texture and used in the final material. Casting multiple material channels will increase the quality of the output material at the cost of memory and computation time.
Figure 1 shows the caster options available in the Unreal Engine plugin.
Simple material casters
Example: BaseColor, Normal, Roughness
The options without the Simplygon prefix are templated versions of the advanced casters. They are set up to work nicely together with the material attribute outputs that are available in a material. Most use cases work well with the default caster settings, but if that's not the case it is possible to tweak settings for each separate caster.
Advanced casters
Example: Simplygon Color Caster, Simplygon Normal Caster
These casters are pure extensions from the Simplygon API and are not set up for any specific use case. Most of them require some manual input to work which is why they have been classified as "advanced". You can read more about these under the API concept Material casters.
Baked material output
After the process has run, the Simplygon Unreal Engine plugin will create a material instance of a specified parent material. The default parent material is different depending on what pipeline is chosen. See table below for the material used.
Pipeline | Default Parent Material |
---|---|
Aggregation, Reduction, Remeshing | /Engine/EngineMaterials/BaseFlattenMaterial |
Billboard Cloud | /Simplygon/Materials/M_SG_BaseImposter |
Flipbook | /Simplygon/Materials/M_SG_BaseFlipbook |
TIP
It is possible to override what parent material to use by adding your own base material under Output Material Settings → Parent Material Override. As long as the override shares the same parameter names as the default material for the specific pipeline the LOD will be generated with a material instance of your material instead.
Since the Simplygon plugin is relying on the flatten material functionality the base material needs to have the Use{MaterialChannel} + {MaterialChannel}Texture syntax, eg UseSpecular + SpecularTexture. The engine also packs Metallic, Roughness and Specular together into one texture. If another channel packing is desired it is possible to change this, but it requires engine modifications and is therefore not something the plugin supports.