Version:

Terrain Surface Materials List Component

The Terrain Surface Materials List component defines mappings between surface types and render materials. You can use this to change the appearance of a surface type within different areas of your game. When you assign a material to a surface type, all the visible surfaces of that type, within the bounds of the required Axis Aligned Box Shape component, will adopt that material.

This component uses macro materials and detail materials across a large terrain surface and blends between them. This blending of detail materials with the macro material enables you to use small high-fidelity tiled detail materials that have variations in color and lighting across the terrain.

Macro and detail material blending is based on the surface weights of the materials. The three surface materials with the highest weight values at every point blend together with relative weighting to add up to 100%, or 1.0. For example, suppose you have the following surface materials and weights:

  • Grass = 0.25
  • Dirt = 0.125
  • Sand = 0.125
  • Rock = 0.05

In this scenario, the blend ignores rock, and the result is 50% grass, 25% dirt, and 25% sand.

For an example of how to use the detail materials with a surface materials list, follow the Apply detail materials section of the Create Terrain from Images tutorial.

Usage

Select the surface type tag using the SurfaceTag drop-down menu, then assign a material by clicking and choosing a material, or by dragging a material from the AssetBrowser window.

Provider

Terrain Gem

Dependencies

Axis-Aligned Box Shape

Properties

Terrain Surface Materials List component properties

PropertyDescriptionValuesDefault
Default MaterialThe default material to fall back to when no other material surface mappings exist.

NOTE: The default material doesn’t blend with other materials because it has no surface weight. The primary intended uses of the default material are either as an error material to see every place that a detail material hasn’t been mapped, or to quickly cover an entire terrain surface with a single material without setting up more complicated mappings.
Material AssetNone
Material MappingsAn array of surface tags and material assets to map together.
Surface TagSelects a surface tag to map to a material.Surface: Surface TagNone
Material AssetSelects a material asset to apply to the surface.Material AssetNone

TerrainAreaMaterialRequestBus

Use the following request functions with the TerrainAreaMaterialRequestBus EBus interface to communicate with Surface Material List components of your game.

Request NameDescriptionParameterReturnScriptable
GetTerrainSurfaceMaterialRegionRetrieves the Aabb for the region where a TerrainSurfaceMaterialMapping exists.NoneAabbNo
GetSurfaceMaterialMappingsRetrieves all the assigned surface types, the materials that you have assigned to them, and the bounds that are set for this entity.NoneTerrain Surface Material Mapping: VectorNo
GetDefaultMaterialRetrieves the default material for this surface material.NoneTerrain Surface Material MappingNo

TerrainAreaMaterialNotificationBus

Notification NameDescriptionParameterReturnScriptable
OnTerrainDefaultSurfaceMaterialCreatedNotifies listeners when the default surface material has been assigned and loaded.NoneEntityId; MaterialNo
OnTerrainDefaultSurfaceMaterialDestroyedNotifies listeners when the default surface material has been unassigned.NoneEntityIdNo
OnTerrainDefaultSurfaceMaterialChangedNotifies listeners when the default surface material has been changed to a different material.NoneEntityId; MaterialNo
OnTerrainSurfaceMaterialMappingCreatedNotifies listeners when a new mapping between a Surface and a Material is set up.NoneEntityId; Surface Tag; MaterialNo
OnTerrainSurfaceMaterialMappingDestroyedNotifies listeners when a mapping between a Surface and a Material is removed.NoneEntityId; Surface TagNo
OnTerrainSurfaceMaterialMappingTagChangedNotifies listeners when a surface tag has changed to tag for an existing material.NoneEntityId; Surface Tag; Surface TagNo
OnTerrainSurfaceMaterialMappingMaterialChangedNotifies listeners when the material has changed for an existing surface tag.NoneEntityId; Surface Tag; MaterialNo
OnTerrainSurfaceMaterialMappingRegionCreatedNotifies listeners when a set of surface material mappings has been created.NoneEntityId; AabbNo
OnTerrainSurfaceMaterialMappingRegionDestroyedNotifies listeners when a set of surface material mappings has been destroyed.NoneEntityId; AabbNo
OnTerrainSurfaceMaterialMappingRegionChangedNotifies listeners when the bounds of this set of surface material mappings has changed.NoneEntityId; Old Region: Aabb; New Region: AabbNo